You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
445 lines
1.2 MiB
445 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[255,5,6,7],{"+NIl":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.defineMode("stex",function($,P){"use strict";function Y(u,l){u.cmdState.push(l)}function j(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var l=u.cmdState.pop();l&&l.closeBracket()}function z(u){for(var l=u.cmdState,d=l.length-1;d>=0;d--){var o=l[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(u,l,d){return function(){this.name=u,this.bracketNo=0,this.style=l,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=G("importmodule","tag",["string","builtin"]),n.documentclass=G("documentclass","tag",["","atom"]),n.usepackage=G("usepackage","tag",["atom"]),n.begin=G("begin","tag",["atom"]),n.end=G("end","tag",["atom"]),n.label=G("label","tag",["atom"]),n.ref=G("ref","tag",["atom"]),n.eqref=G("eqref","tag",["atom"]),n.cite=G("cite","tag",["atom"]),n.bibitem=G("bibitem","tag",["atom"]),n.Bibitem=G("Bibitem","tag",["atom"]),n.RBibitem=G("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(u,l){u.f=l}function v(u,l){var d;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return d=n.hasOwnProperty(o)?n[o]:n.DEFAULT,d=new d,Y(l,d),R(l,p),d.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return R(l,function(s,a){return m(s,a,"\\]")}),"keyword";if(u.match("\\("))return R(l,function(s,a){return m(s,a,"\\)")}),"keyword";if(u.match("$$"))return R(l,function(s,a){return m(s,a,"$$")}),"keyword";if(u.match("$"))return R(l,function(s,a){return m(s,a,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(d=j(l),d)d.closeBracket(h),R(l,p);else return"error";return"bracket"}else return h=="{"||h=="["?(d=n.DEFAULT,d=new d,Y(l,d),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),d=z(l),d.name=="begin"&&(d.argument=u.current()),d.styleIdentifier())}function m(u,l,d){if(u.eatSpace())return null;if(d&&u.match(d))return R(l,v),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function p(u,l){var d=u.peek(),o;return d=="{"||d=="["?(o=j(l),o.openBracket(d),u.eat(d),R(l,v),"bracket"):/[ \t\r]/.test(d)?(u.eat(d),null):(R(l,v),U(l),v(u,l))}return{startState:function(){var u=P.inMathMode?function(l,d){return m(l,d)}:v;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,l){return l.f(u,l)},blankLine:function(u){u.f=v,u.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(ot,xe,Z){},"/cxE":function(ot,xe,Z){"use strict";Z.d(xe,"f",function(){return P}),Z.d(xe,"g",function(){return Y}),Z.d(xe,"h",function(){return j}),Z.d(xe,"e",function(){return z}),Z.d(xe,"b",function(){return G}),Z.d(xe,"c",function(){return n}),Z.d(xe,"d",function(){return R}),Z.d(xe,"a",function(){return v});class re{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const $=new re;function P(m){z(m)||$.onUnexpectedError(m);return}function Y(m){z(m)||$.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:u}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:u,stack:l}}return m}const U="Canceled";function z(m){return m instanceof Error&&m.name===U&&m.message===U}function G(){const m=new Error(U);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function R(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){re.defineOption("placeholder","",function(G,n,R){var v=R&&R!=re.Init;if(n&&!v)G.on("blur",j),G.on("change",U),G.on("swapDoc",U),re.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){Y(G)}),U(G);else if(!n&&v){G.off("blur",j),G.off("change",U),G.off("swapDoc",U),re.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),$(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}n&&!G.hasFocus()&&j(G)});function $(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){$(G);var n=G.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=G.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),n.appendChild(R),G.display.lineSpace.insertBefore(n,G.display.lineSpace.firstChild)}function Y(G){setTimeout(function(){var n=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?n=!R.value:G.lineCount()==1&&(n=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),n?P(G):$(G)},20)}function j(G){z(G)&&P(G)}function U(G){var n=G.getWrapperElement(),R=z(G);n.className=n.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(G):$(G)}function z(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(Y,j){var U=Y.indentUnit,z={},G=j.htmlMode?$:P;for(var n in G)z[n]=G[n];for(var n in j)z[n]=j[n];var R,v;function m(f,C){function y(F){return C.tokenize=F,F(f,C)}var b=f.next();if(b=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?y(l("atom","]]>")):null:f.match("--")?y(l("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),y(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=l("meta","?>"),"meta"):(R=f.eat("/")?"closeTag":"openTag",C.tokenize=p,"tag bracket");if(b=="&"){var B;return f.eat("#")?f.eat("x")?B=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):B=f.eatWhile(/[\d]/)&&f.eat(";"):B=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),B?"atom":"error"}else return f.eatWhile(/[^&<]/),null}m.isInText=!0;function p(f,C){var y=f.next();if(y==">"||y=="/"&&f.eat(">"))return C.tokenize=m,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){C.tokenize=m,C.state=a,C.tagName=C.tagStart=null;var b=C.tokenize(f,C);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(C.tokenize=u(y),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var C=function(y,b){for(;!y.eol();)if(y.next()==f){b.tokenize=p;break}return"string"};return C.isInAttribute=!0,C}function l(f,C){return function(y,b){for(;!y.eol();){if(y.match(C)){b.tokenize=m;break}y.next()}return f}}function d(f){return function(C,y){for(var b;(b=C.next())!=null;){if(b=="<")return y.tokenize=d(f+1),y.tokenize(C,y);if(b==">")if(f==1){y.tokenize=m;break}else return y.tokenize=d(f-1),y.tokenize(C,y)}return"meta"}}function o(f,C,y){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=y,(z.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function h(f){f.context&&(f.context=f.context.prev)}function s(f,C){for(var y;;){if(!f.context)return;if(y=f.context.tagName,!z.contextGrabbers.hasOwnProperty(y)||!z.contextGrabbers[y].hasOwnProperty(C))return;h(f)}}function a(f,C,y){return f=="openTag"?(y.tagStart=C.column(),A):f=="closeTag"?E:a}function A(f,C,y){return f=="word"?(y.tagName=C.current(),v="tag",L):z.allowMissingTagName&&f=="endTag"?(v="tag bracket",L(f,C,y)):(v="error",A)}function E(f,C,y){if(f=="word"){var b=C.current();return y.context&&y.context.tagName!=b&&z.implicitlyClosed.hasOwnProperty(y.context.tagName)&&h(y),y.context&&y.context.tagName==b||z.matchClosing===!1?(v="tag",T):(v="tag error",D)}else return z.allowMissingTagName&&f=="endTag"?(v="tag bracket",T(f,C,y)):(v="error",D)}function T(f,C,y){return f!="endTag"?(v="error",T):(h(y),a)}function D(f,C,y){return v="error",T(f,C,y)}function L(f,C,y){if(f=="word")return v="attribute",w;if(f=="endTag"||f=="selfcloseTag"){var b=y.tagName,B=y.tagStart;return y.tagName=y.tagStart=null,f=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new o(y,b,B==y.indented)),a}return v="error",L}function w(f,C,y){return f=="equals"?O:(z.allowMissing||(v="error"),L(f,C,y))}function O(f,C,y){return f=="string"?S:f=="word"&&z.allowUnquoted?(v="string",L):(v="error",L(f,C,y))}function S(f,C,y){return f=="string"?S:L(f,C,y)}return{startState:function(f){var C={tokenize:m,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;R=null;var y=C.tokenize(f,C);return(y||R)&&y!="comment"&&(v=null,C.state=C.state(R||y,f,C),v&&(y=v=="error"?y+" error":v)),y},indent:function(f,C,y){var b=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+U;if(b&&b.noIndent)return re.Pass;if(f.tokenize!=p&&f.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(f.tagName)return z.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+U*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var B=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(B&&B[1])for(;b;)if(b.tagName==B[2]){b=b.prev;break}else if(z.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(B)for(;b;){var F=z.contextGrabbers[b.tagName];if(F&&F.hasOwnProperty(B[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+U:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(f){f.state==O&&(f.state=L)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],y=f.context;y;y=y.prev)y.tagName&&C.push(y.tagName);return C.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});class re{constructor(P){this.element=P,this.next=re.Undefined,this.prev=re.Undefined}}re.Undefined=new re(void 0);class ${constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let P=this._first;for(;P!==re.Undefined;){const Y=P.next;P.prev=re.Undefined,P.next=re.Undefined,P=Y}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,Y){const j=new re(P);if(this._first===re.Undefined)this._first=j,this._last=j;else if(Y){const z=this._last;this._last=j,j.prev=z,z.next=j}else{const z=this._first;this._first=j,j.next=z,z.prev=j}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===re.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===re.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==re.Undefined&&P.next!==re.Undefined){const Y=P.prev;Y.next=P.next,P.next.prev=Y}else P.prev===re.Undefined&&P.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):P.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):P.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==re.Undefined;)yield P.element,P=P.next}}},"3/fG":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});function re(P,Y){let j;return Y.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,z){const G=z[0];return typeof Y[G]!="undefined"?Y[G]:U}),j}function $(P,Y,...j){return re(Y,j)}},"5VLF":function(ot,xe,Z){"use strict";var re,$;function P(Y,j,U){var z=function(G,n){return Y.js_beautify(G,n)};return z.js=Y.js_beautify,z.css=j.css_beautify,z.html=U.html_beautify,z.js_beautify=Y.js_beautify,z.css_beautify=j.css_beautify,z.html_beautify=U.html_beautify,z}!(re=[Z("6UM0"),Z("TXwP"),Z("psGv")],$=function(Y,j,U){return P(Y,j,U)}.apply(xe,re),$!==void 0&&(ot.exports=$))},"5Y4S":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var re=Z("MNsG");const $=re.b.performance&&typeof re.b.performance.now=="function";class P{constructor(Y){this._highResolution=$&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new P(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?re.b.performance.now():Date.now()}}},"6UM0":function(ot,xe,Z){var re,$;(function(){var P;(function(){"use strict";var j=[function(n,R,v){var m=v(1).Beautifier,p=v(5).Options;function u(l,d){var o=new m(l,d);return o.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new p}},function(n,R,v){var m=v(2).Output,p=v(3).Token,u=v(4),l=v(5).Options,d=v(7).Tokenizer,o=v(7).line_starters,h=v(7).positionable_operators,s=v(7).TOKEN;function a(g,W){return W.indexOf(g)!==-1}function A(g){return g.replace(/^\s+/g,"")}function E(g){for(var W={},J=0;J<g.length;J++)W[g[J].replace(/-/g,"_")]=g[J];return W}function T(g,W){return g&&g.type===s.RESERVED&&g.text===W}function D(g,W){return g&&g.type===s.RESERVED&&a(g.text,W)}var L=["case","return","do","if","throw","else","await","break","continue","async"],w=["before-newline","after-newline","preserve-newline"],O=E(w),S=[O.before_newline,O.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(g,W){if(W.multiline_frame||W.mode===f.ForInitializer||W.mode===f.Conditional)return;g.remove_indent(W.start_line_index)}function y(g){g=g.replace(u.allLineBreaks,`
|
|
`);for(var W=[],J=g.indexOf(`
|
|
`);J!==-1;)W.push(g.substring(0,J)),g=g.substring(J+1),J=g.indexOf(`
|
|
`);return g.length&&W.push(g),W}function b(g){return g===f.ArrayLiteral}function B(g){return a(g,[f.Expression,f.ForInitializer,f.Conditional])}function F(g,W){for(var J=0;J<g.length;J++){var ie=g[J].trim();if(ie.charAt(0)!==W)return!1}return!0}function x(g,W){for(var J=0,ie=g.length,ue;J<ie;J++)if(ue=g[J],ue&&ue.indexOf(W)!==0)return!1;return!0}function N(g,W){W=W||{},this._source_text=g||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new l(W)}N.prototype.create_flags=function(g,W){var J=0;g&&(J=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>J&&(J=g.line_indent_level));var ie={mode:W,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:J,alignment:0,line_indent_level:g?g.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},N.prototype._reset=function(g){var W=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var J=new d(g,this._options);return this._tokens=J.tokenize(),g},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,W=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
`,W&&u.lineBreak.test(W||"")&&(J=W.match(u.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return g=this._output.get_code(J),g},N.prototype.handle_token=function(g,W){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,W):g.type===s.COMMENT?this.handle_comment(g,W):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,W):this.handle_unknown(g,W)},N.prototype.handle_whitespace_and_comments=function(g,W){var J=g.newlines,ie=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var ue=g.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,W),this.handle_token(ue,W),ue=g.comments_before.next();if(ie)for(var Re=0;Re<J;Re+=1)this.print_newline(Re>0,W);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,W);for(var ve=1;ve<J;ve+=1)this.print_newline(!0,W)}};var I=["async","break","continue","return","throw","yield"];N.prototype.allow_wrap_or_preserved_newline=function(g,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&g.newlines||W,ie=a(this._flags.last_token.text,h)||a(g.text,h);if(ie){var ue=a(this._flags.last_token.text,h)&&a(this._options.operator_position,S)||a(g.text,h);J=J&&ue}if(J)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},N.prototype.print_newline=function(g,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var J=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},N.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},N.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},N.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},N.prototype.start_of_statement=function(g){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,W=W||T(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&D(this._flags.last_token,I)&&!g.newlines,W=W||T(this._flags.last_token,"else")&&!(T(g,"if")&&!g.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,W=W||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},N.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var W=f.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=f.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var ie=this._tokens.peek(-4);D(J,["async","function"])||J.text==="*"&&D(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},N.prototype.handle_end_expr=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},N.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var W=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):J&&(a(J.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a(J.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(J.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!W.comments_before&&W.text==="}",ue=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,ve=null;this._flags.inline_frame=!0;do if(Re+=1,ve=this._tokens.peek(Re-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==s.EOF&&!(ve.type===s.END_BLOCK&&ve.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},N.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===f.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},N.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(T(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),T(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var J="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?J="SPACE":this._flags.last_token.type===s.STRING?J="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?D(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(g,"if")&&T(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(g,"from")&&(this._flags.import_block=!1))},N.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},N.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},N.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},N.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(B(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},N.prototype.handle_operator=function(g){var W=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),J=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ie=!W;this.handle_whitespace_and_comments(g,ie)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,S)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ue=!0,Re=!0,ve=!1;if(g.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,ve=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!J&&!W&&this._options.preserve_newlines&&a(g.text,h)){var Se=g.text===":",Le=Se&&ve,be=Se&&!ve;switch(this._options.operator_position){case O.before_newline:this._output.space_before_token=!be,this.print_token(g),(!Se||Le)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case O.after_newline:this._output.space_before_token=!0,!Se||Le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case O.preserve_newline:be||this.allow_wrap_or_preserved_newline(g),ue=!(this._output.just_added_newline()||be),this._output.space_before_token=ue,this.print_token(g),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(g),ue=!1;var ce=this._tokens.peek();Re=ce&&a(ce.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),ue=this._flags.last_token.type===s.START_BLOCK,Re=!1;else if(a(g.text,["--","++","!","~"])||J){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),ue=!1,Re=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var he=D(this._flags.last_token,L)&&g.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(g),this._output.space_before_token=Re},N.prototype.handle_block_comment=function(g,W){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,W),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,W)},N.prototype.print_block_commment=function(g,W){var J=y(g.text),ie,ue=!1,Re=!1,ve=g.whitespace_before,Se=ve.length;if(this.print_newline(!1,W),this.print_token_line_indentation(g),this._output.add_token(J[0]),this.print_newline(!1,W),J.length>1){for(J=J.slice(1),ue=F(J,"*"),Re=x(J,ve),ue&&(this._flags.alignment=1),ie=0;ie<J.length;ie++)ue?(this.print_token_line_indentation(g),this._output.add_token(A(J[ie]))):Re&&J[ie]?(this.print_token_line_indentation(g),this._output.add_token(J[ie].substring(Se))):(this._output.current_line.set_indent(-1),this._output.add_token(J[ie])),this.print_newline(!1,W);this._flags.alignment=0}},N.prototype.handle_comment=function(g,W){g.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,W)},N.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,L)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},N.prototype.handle_unknown=function(g,W){this.print_token(g),g.text[g.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},N.prototype.handle_eof=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},n.exports.Beautifier=N},function(n){function R(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},R.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,u){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var l=this.__base_string_length;return u=u||0,p<0&&(l=0),l+=p*this.__indent_size,l+=u,l},v.prototype.get_indent_string=function(p,u){var l=this.__base_string;return u=u||0,p<0&&(p=0,l=""),u+=p*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,u=0,l="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,u){this.__indent_cache=new v(p,u),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},m.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var u=this.__lines.length;p<u;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,u){for(var l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(p)!==0&&d.item(-1)!==u){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=m},function(n){function R(v,m,p,u){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=R},function(n,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])*";R.identifier=new RegExp(l+d,"g"),R.identifierStart=new RegExp(l),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|
|
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(n,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function u(l){m.call(this,l,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h<o.length;h++)o[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[h];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new m,n.exports.Options=u},function(n){function R(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}R.prototype._get_array=function(p,u){var l=this.raw_options[p],d=u||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},R.prototype._get_boolean=function(p,u){var l=this.raw_options[p],d=l===void 0?!!u:!!l;return d},R.prototype._get_characters=function(p,u){var l=this.raw_options[p],d=u||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},R.prototype._get_number=function(p,u){var l=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(l,10);return isNaN(d)&&(d=u),d},R.prototype._get_selection=function(p,u,l){var d=this._get_selection_list(p,u,l);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return d[0]},R.prototype._get_selection_list=function(p,u,l){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[u[0]],!this._is_valid_selection(l,u))throw new Error("Invalid Default Value!");var d=this._get_array(p,l);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return d},R.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(l){return u.indexOf(l)===-1})};function v(p,u){var l={};p=m(p);var d;for(d in p)d!==u&&(l[d]=p[d]);if(u&&p[u])for(d in p[u])l[d]=p[u][d];return l}function m(p){var u={},l;for(l in p){var d=l.replace(/-/g,"_");u[d]=p[l]}return u}n.exports.Options=R,n.exports.normalizeOpts=m,n.exports.mergeOpts=v},function(n,R,v){var m=v(8).InputScanner,p=v(9).Tokenizer,u=v(9).TOKEN,l=v(13).Directives,d=v(4),o=v(12).Pattern,h=v(14).TemplatablePattern;function s(F,x){return x.indexOf(F)!==-1}var a={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},A=new l(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,D=/[^\d\.]/,L=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var O=new RegExp(w),S="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=S.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),y,b=function(F,x){p.call(this,F,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var N=new o(this._input),I=new h(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(d.identifier).matching(d.identifierMatch),number:N.matching(E),punct:N.matching(O),comment:N.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:N.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:N.matching(/<!--/),html_comment_end:N.matching(/-->/),include:N.starting_with(/#include/).until_after(d.lineBreak),shebang:N.starting_with(/#!/).until_after(d.lineBreak),xml:N.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,x){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&x&&(F.text==="]"&&x.text==="["||F.text===")"&&x.text==="("||F.text==="}"&&x.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,x){var N=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(N=N||this._read_non_javascript(I),N=N||this._read_string(I),N=N||this._read_word(F),N=N||this._read_singles(I),N=N||this._read_comment(I),N=N||this._read_regexp(I,F),N=N||this._read_xml(I,F),N=N||this._read_punctuation(),N=N||this._create_token(a.UNKNOWN,this._input.next()),N)},b.prototype._read_word=function(F){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(d.allLineBreaks,`
|
|
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&C.test(x)?(x==="in"||x==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,x):this._create_token(a.RESERVED,x):this._create_token(a.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(a.WORD,x)},b.prototype._read_singles=function(F){var x=null;return F==="("||F==="["?x=this._create_token(a.START_EXPR,F):F===")"||F==="]"?x=this._create_token(a.END_EXPR,F):F==="{"?x=this._create_token(a.START_BLOCK,F):F==="}"?x=this._create_token(a.END_BLOCK,F):F===";"?x=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?x=this._create_token(a.DOT,F):F===","&&(x=this._create_token(a.COMMA,F)),x&&this._input.next(),x},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var x="";if(F==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(a.UNKNOWN,x.trim()+`
|
|
`);if(x=this.__patterns.include.read(),x)return this._create_token(a.UNKNOWN,x.trim()+`
|
|
`);F=this._input.next();var N="#";if(this._input.hasNext()&&this._input.testChar(T)){do F=this._input.next(),N+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(N+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(N+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,N)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)x+=this._input.next();return y=!0,this._create_token(a.COMMENT,x)}}else if(y&&F==="-"&&(x=this.__patterns.html_comment_end.read(),x))return y=!1,this._create_token(a.COMMENT,x);return null},b.prototype._read_comment=function(F){var x=null;if(F==="/"){var N="";if(this._input.peek(1)==="*"){N=this.__patterns.block_comment.read();var I=A.get_directives(N);I&&I.ignore==="start"&&(N+=A.readIgnored(this._input)),N=N.replace(d.allLineBreaks,`
|
|
`),x=this._create_token(a.BLOCK_COMMENT,N),x.directives=I}else this._input.peek(1)==="/"&&(N=this.__patterns.comment.read(),x=this._create_token(a.COMMENT,N))}return x},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var x=this._input.next();return this.has_char_escapes=!1,F==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(x=B(x)),this._input.peek()===F&&(x+=this._input.next()),x=x.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,x)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,x){if(F==="/"&&this._allow_regexp_or_xml(x)){for(var N=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(d.newline);)N+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(N+=this._input.next(),N+=this._input.read(d.identifier)),this._create_token(a.STRING,N)}return null},b.prototype._read_xml=function(F,x){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(x)){var N="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=g.indexOf("{")===0,J=0;I;){var ie=!!I[1],ue=I[2],Re=!!I[I.length-1]||ue.slice(0,8)==="![CDATA[";if(!Re&&(ue===g||W&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--J:++J),N+=I[0],J<=0)break;I=this.__patterns.xml.read_match()}return I||(N+=this._input.match(/[\s\S]*/g)[0]),N=N.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,N)}}return null};function B(F){for(var x="",N=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(x+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",I.hasNext()&&(x+=I.next());continue}if(!g)return F;if(N=parseInt(g[1],16),N>126&&N<=255&&g[0].indexOf("x")===0)return F;if(N>=0&&N<32){x+="\\"+g[0];continue}else N===34||N===39||N===92?x+="\\"+String.fromCharCode(N):x+=String.fromCharCode(N)}return x}b.prototype._read_string_recursive=function(F,x,N){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var W=g.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===F||!x&&d.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),J+=this._input.next()):N&&(N==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),N===J&&(F==="`"?J+=this._read_string_recursive("}",x,"`"):J+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=g.read(),W+=J}return W},n.exports.Tokenizer=b,n.exports.TOKEN=a,n.exports.positionable_operators=L.slice(),n.exports.line_starters=S.slice()},function(n){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var u=m.exec(this.__input);return u&&!(R&&m.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var u=this.peek(p);return m.lastIndex=0,u!==null&&m.test(u)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,u){var l="",d;return m&&(d=this.match(m),d&&(l+=d[0])),p&&(d||!m)&&(l+=this.readUntil(p,u)),l},v.prototype.readUntil=function(m,p){var u="",l=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(l=d.index,p&&(l+=d[0].length)):l=this.__input_length,u=this.__input.substring(this.__position,l),this.__position=l,u},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var u=null,l="g";return p&&R&&(l="y"),typeof m=="string"&&m!==""?u=new RegExp(m,l):m&&(u=new RegExp(m.source,l)),u},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,u=this.readUntilAfter(m);return this.__position=p,u},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},n.exports.InputScanner=v},function(n,R,v){var m=v(8).InputScanner,p=v(3).Token,u=v(10).TokenStream,l=v(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(h,s){this._input=new m(h),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,s=new p(d.START,""),a=null,A=[],E=new u;s.type!==d.EOF;){for(h=this._get_next_token(s,a);this._is_comment(h);)E.add(h),h=this._get_next_token(s,a);E.isEmpty()||(h.comments_before=E,E=new u),h.parent=a,this._is_opening(h)?(A.push(a),a=h):a&&this._is_closing(h,a)&&(h.opened=a,a.closed=h,a=A.pop(),h.parent=a),h.previous=s,s.next=h,this.__tokens.add(h),s=h}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(h,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(d.RAW,a):this._create_token(d.EOF,"")},o.prototype._is_comment=function(h){return!1},o.prototype._is_opening=function(h){return!1},o.prototype._is_closing=function(h,s){return!1},o.prototype._create_token=function(h,s){var a=new p(h,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=o,n.exports.TOKEN=d},function(n){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position<this.__tokens_length},R.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},R.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},R.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},n.exports.TokenStream=R},function(n,R,v){var m=v(12).Pattern;function p(u,l){m.call(this,u,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(u,l){u+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var l=this.__split(this._newline_regexp,u);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return u},p.prototype.matching=function(u,l){var d=this._create();return d.__set_whitespace_patterns(u,l),d._update(),d},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(u,l){u.lastIndex=0;for(var d=0,o=[],h=u.exec(l);h;)o.push(l.substring(d,h.index)),d=h.index+h[0].length,h=u.exec(l);return d<l.length?o.push(l.substring(d,l.length)):o.push(""),o},n.exports.WhitespacePattern=p},function(n){function R(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}R.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},R.prototype.read_match=function(){return this._input.match(this._match_pattern)},R.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype._create=function(){return new R(this._input,this)},R.prototype._update=function(){},n.exports.Pattern=R},function(n){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=R},function(n,R,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(l,d){m.call(this,l,d),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var o=new m(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new m,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(l){var d=this._create();return d._disabled[l]=!0,d._update(),d},u.prototype.read_options=function(l){var d=this._create();for(var o in p)d._disabled[o]=l.templating.indexOf(o)===-1;return d._update(),d},u.prototype.exclude=function(l){var d=this._create();return d._excluded[l]=!0,d._update(),d},u.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),l+=d,d=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},u.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},u.prototype._read_template=function(){var l="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},n.exports.TemplatablePattern=u}],U={};function z(n){var R=U[n];if(R!==void 0)return R.exports;var v=U[n]={exports:{}};return j[n](v,v.exports,z),v.exports}var G=z(0);P=G})();var Y=P;!(re=[],$=function(){return{js_beautify:Y}}.apply(xe,re),$!==void 0&&(ot.exports=$))})()},"746U":function(ot,xe,Z){"use strict";Z.d(xe,"f",function(){return re}),Z.d(xe,"l",function(){return $}),Z.d(xe,"k",function(){return P}),Z.d(xe,"j",function(){return Y}),Z.d(xe,"g",function(){return j}),Z.d(xe,"m",function(){return U}),Z.d(xe,"h",function(){return z}),Z.d(xe,"n",function(){return G}),Z.d(xe,"c",function(){return n}),Z.d(xe,"a",function(){return R}),Z.d(xe,"i",function(){return v}),Z.d(xe,"o",function(){return m}),Z.d(xe,"e",function(){return l}),Z.d(xe,"d",function(){return d}),Z.d(xe,"p",function(){return o}),Z.d(xe,"b",function(){return h});function re(s){return Array.isArray(s)}function $(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Y(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function z(s){return!G(s)}function G(s){return U(s)||s===null}function n(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(G(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const A=Math.min(s.length,a.length);for(let E=0;E<A;E++)p(s[E],a[E])}function p(s,a){if($(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(v(a)){try{if(s instanceof a)return}catch(A){}if(!G(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(s){let a=[],A=Object.getPrototypeOf(s);for(;Object.prototype!==A;)a=a.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return a}function l(s){const a=[];for(const A of u(s))typeof s[A]=="function"&&a.push(A);return a}function d(s,a){const A=T=>function(){const D=Array.prototype.slice.call(arguments,0);return a(T,D)};let E={};for(const T of s)E[T]=A(T);return E}function o(s){return s===null?void 0:s}function h(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(ot,xe,Z){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function P(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re($)}var Y=/^(?:[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 j(p){return typeof p=="string"&&Y.test(p)}for(var U=j,z=[],G=0;G<256;++G)z.push((G+256).toString(16).substr(1));function n(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(z[p[u+0]]+z[p[u+1]]+z[p[u+2]]+z[p[u+3]]+"-"+z[p[u+4]]+z[p[u+5]]+"-"+z[p[u+6]]+z[p[u+7]]+"-"+z[p[u+8]]+z[p[u+9]]+"-"+z[p[u+10]]+z[p[u+11]]+z[p[u+12]]+z[p[u+13]]+z[p[u+14]]+z[p[u+15]]).toLowerCase();if(!U(l))throw TypeError("Stringified UUID is invalid");return l}var R=n;function v(p,u,l){p=p||{};var d=p.random||(p.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){l=l||0;for(var o=0;o<16;++o)u[l+o]=d[o];return u}return R(d)}var m=xe.a=v},"7ahc":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return A});var re=Z("k1fw"),$=Z("0Owb"),P=Z("+L6B"),Y=Z("2/Rp"),j=Z("y8nQ"),U=Z("Vl3Y"),z=Z("tJVT"),G=Z("OaEy"),n=Z("2fM7"),R=Z("q1tI"),v=Z.n(R),m=Z("VrN/"),p=Z.n(m),u=Z("p77/"),l=Z.n(u),d=Z("c5Ni"),o=Z.n(d),h=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={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"]};xe.b=function(E){var T=E.callback,D=E.onCancel,L=Object(R.useState)("python"),w=Object(z.a)(L,2),O=w[0],S=w[1];function f(y){S(a[y][1])}function C(y){T(y)}return v.a.createElement(U.a,Object($.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(n.a,{onChange:f},Object.keys(a).map(function(y){return v.a.createElement(h,{key:y,value:y},a[y][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(A,{mode:O})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Y.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function A(E){var T=E.value,D=E.onChange,L=E.mode,w=E.options,O=w===void 0?{}:w,S=Object(R.useRef)(),f=Object(R.useState)(),C=Object(z.a)(f,2),y=C[0],b=C[1];return Object(R.useEffect)(function(){if(y){function B(F){var x=F.getValue();D&&D(x)}return y.on("change",B),function(){y.off("change",B)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(R.useEffect)(function(){y&&((T!==y.getValue()||T==="")&&setTimeout(function(){y.setValue(T||" ")},300))},[y,T]),Object(R.useEffect)(function(){if(S.current&&!y){var B=p.a.fromTextArea(S.current,Object(re.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},O));b(B)}},[S.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:S}))}},"8EBN":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.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;$<re.modeInfo.length;$++){var P=re.modeInfo[$];P.mimes&&(P.mime=P.mimes[0])}re.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var j=0;j<re.modeInfo.length;j++){var U=re.modeInfo[j];if(U.mime==Y)return U;if(U.mimes){for(var z=0;z<U.mimes.length;z++)if(U.mimes[z]==Y)return U}}if(/\+xml$/.test(Y))return re.findModeByMIME("application/xml");if(/\+json$/.test(Y))return re.findModeByMIME("application/json")},re.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var j=0;j<re.modeInfo.length;j++){var U=re.modeInfo[j];if(U.ext){for(var z=0;z<U.ext.length;z++)if(U.ext[z]==Y)return U}}},re.findModeByFileName=function(Y){for(var j=0;j<re.modeInfo.length;j++){var U=re.modeInfo[j];if(U.file&&U.file.test(Y))return U}var z=Y.lastIndexOf("."),G=z>-1&&Y.substring(z+1,Y.length);if(G)return re.findModeByExtension(G)},re.findModeByName=function(Y){Y=Y.toLowerCase();for(var j=0;j<re.modeInfo.length;j++){var U=re.modeInfo[j];if(U.name.toLowerCase()==Y)return U;if(U.alias){for(var z=0;z<U.alias.length;z++)if(U.alias[z].toLowerCase()==Y)return U}}}})},"8HAY":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return j}),Z.d(xe,"b",function(){return U}),Z.d(xe,"d",function(){return z}),Z.d(xe,"e",function(){return G}),Z.d(xe,"c",function(){return n});var re=Z("MI8n"),$=Z("pmY6"),P=Z("3/fG"),Y=function(R,v,m,p){function u(l){return l instanceof m?l:new m(function(d){d(l)})}return new(m||(m=Promise))(function(l,d){function o(a){try{s(p.next(a))}catch(A){d(A)}}function h(a){try{s(p.throw(a))}catch(A){d(A)}}function s(a){a.done?l(a.value):u(a.value).then(o,h)}s((p=p.apply(R,v||[])).next())})};class j extends $.a{constructor(R,v="",m="",p=!0,u){super();this._onDidChange=this._register(new re.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=R,this._label=v,this._cssClass=m,this._enabled=p,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(R){this._setLabel(R)}_setLabel(R){this._label!==R&&(this._label=R,this._onDidChange.fire({label:R}))}get tooltip(){return this._tooltip||""}set tooltip(R){this._setTooltip(R)}_setTooltip(R){this._tooltip!==R&&(this._tooltip=R,this._onDidChange.fire({tooltip:R}))}get class(){return this._cssClass}set class(R){this._setClass(R)}_setClass(R){this._cssClass!==R&&(this._cssClass=R,this._onDidChange.fire({class:R}))}get enabled(){return this._enabled}set enabled(R){this._setEnabled(R)}_setEnabled(R){this._enabled!==R&&(this._enabled=R,this._onDidChange.fire({enabled:R}))}get checked(){return this._checked}set checked(R){this._setChecked(R)}_setChecked(R){this._checked!==R&&(this._checked=R,this._onDidChange.fire({checked:R}))}run(R,v){return Y(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(R))})}}class U extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new re.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new re.b),this.onDidRun=this._onDidRun.event}run(R,v){return Y(this,void 0,void 0,function*(){if(!R.enabled)return;this._onBeforeRun.fire({action:R});let m;try{yield this.runAction(R,v)}catch(p){m=p}this._onDidRun.fire({action:R,error:m})})}runAction(R,v){return Y(this,void 0,void 0,function*(){yield R.run(v)})}}class z extends j{constructor(R){super(z.ID,R,R?"separator text":"separator");this.checked=!1,this.enabled=!1}}z.ID="vs.actions.separator";class G{constructor(R,v,m,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=R,this.label=v,this.class=p,this._actions=m}get actions(){return this._actions}dispose(){}run(){return Y(this,void 0,void 0,function*(){})}}class n extends j{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(ot,xe,Z){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,xe,Z){"use strict";var re=Z("DYRE"),$=Z("zeV3"),P=Z("+L6B"),Y=Z("2/Rp"),j=Z("k1fw"),U=Z("9og8"),z=Z("tJVT"),G=Z("WmNS"),n=Z.n(G),R=Z("q1tI"),v=Z.n(R),m=Z("vg9a"),p=Z("DlQD"),u=Z.n(p),l=Z("rUJ1");function d(X,_){var k=X.match(/^(\s+)(?:```)/);if(k===null)return _;var H=k[1];return _.split(`
|
|
`).map(function(ee){var V=ee.match(/^\s+/);if(V===null)return ee;var Ee=Object(z.a)(V,1),Ke=Ee[0];return Ke.length>=H.length?ee.slice(H.length):ee}).join(`
|
|
`)}var o=[],h=["<ul>"],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){o.length=0,h=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(X,_,k,H){if(_>=X.length||X[_].level<=k)return _;var ee=X[_];H.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),_++;var V=[];return _=T(X,_,ee.level,V),V.length>0&&(H.push("<ul>"),V.forEach(function(Ee){H.push(Ee)}),H.push("</ul>")),H.push("</li>"),_=T(X,_,k,H),_}function D(){return T(o,0,0,h),h.push("</ul>"),h.join("")}var L={heading:function(_){var k=a.exec(_);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(_){var k=this.rules.block.fences.exec(_);if(k){var H=k[0],ee=d(H,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Ee=S(),Ke=ee;ee=Ee,f[Ee]={type:"block",expression:Ke}}return{type:"code",raw:H,lang:V,text:ee}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,O=0,S=function(){return"__special_katext_id_".concat(O++,"__")},f={};function C(){return f}function y(){O=0,f={}}function b(X){return X=X.replace(w,function(_,k){var H=S();return f[H]={type:"inline",expression:k},H}),X}var B=s.listitem;s.listitem=function(X){return B(b(X))};var F=s.paragraph;s.paragraph=function(X){return F(b(X))};var x=s.tablecell;s.tablecell=function(X,_){return x(b(X),_)},s.code=function(X,_,k){var H=(_||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(_,'">').concat(k?X:Object(l.escape)(X,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(k?X:Object(l.escape)(X,!0))+"</code></pre>"},s.heading=function(X,_,k){var H=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:H,level:_,text:X}),"<h"+_+' id="'+H+'">'+X+"</h"+_+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:L,renderer:s});var N=u.a,I=Z("SJMd"),g=Z("ulZh"),W=Z.n(g),J=Z("m3rI"),ie=Z("Oy/b"),ue=Z("p5ED"),Re=Z("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 ve=function(X,_){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,H){k.__proto__=H}||function(k,H){for(var ee in H)Object.prototype.hasOwnProperty.call(H,ee)&&(k[ee]=H[ee])})(X,_)};function Se(X,_){function k(){this.constructor=X}ve(X,_),X.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}function Le(X,_,k,H){return new(k||(k=Promise))(function(ee,V){function Ee(vt){try{it(H.next(vt))}catch(Ve){V(Ve)}}function Ke(vt){try{it(H.throw(vt))}catch(Ve){V(Ve)}}function it(vt){var Ve;vt.done?ee(vt.value):(Ve=vt.value,Ve instanceof k?Ve:new k(function(Tt){Tt(Ve)})).then(Ee,Ke)}it((H=H.apply(X,_||[])).next())})}function be(X,_){var k,H,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(it){return function(vt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,H&&(ee=2&Ve[0]?H.return:Ve[0]?H.throw||((ee=H.return)&&ee.call(H),0):H.next)&&!(ee=ee.call(H,Ve[1])).done)return ee;switch(H=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,H=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){Ee.label=Ve[1];break}if(Ve[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Ve;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Ve);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Ve=_.call(X,Ee)}catch(Tt){Ve=[6,Tt],H=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([it,vt])}}}function ce(){for(var X=0,_=0,k=arguments.length;_<k;_++)X+=arguments[_].length;var H=Array(X),ee=0;for(_=0;_<k;_++)for(var V=arguments[_],Ee=0,Ke=V.length;Ee<Ke;Ee++,ee++)H[ee]=V[Ee];return H}var he=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(_,k){for(var H=0,ee=k;H<ee.length;H++){var V=ee[H],Ee=V[0],Ke=V[1];_.setAttribute(Ee,Ke)}},X.createRect=function(_,k,H){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",_.toString()),ee.setAttribute("height",k.toString()),H&&X.setAttributes(ee,H),ee},X.createLine=function(_,k,H,ee,V){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",_.toString()),Ee.setAttribute("y1",k.toString()),Ee.setAttribute("x2",H.toString()),Ee.setAttribute("y2",ee.toString()),V&&X.setAttributes(Ee,V),Ee},X.createPolygon=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",_),k&&X.setAttributes(H,k),H},X.createCircle=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(_/2).toString()),H.setAttribute("cy",(_/2).toString()),H.setAttribute("r",_.toString()),k&&X.setAttributes(H,k),H},X.createEllipse=function(_,k,H){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(_/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(_/2).toString()),ee.setAttribute("ry",(k/2).toString()),H&&X.setAttributes(ee,H),ee},X.createGroup=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&X.setAttributes(k,_),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(_,k,H,ee,V,Ee,Ke){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(it,[["id",_],["orient",k],["markerWidth",H.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Ee.toString()]]),it.appendChild(Ke),it},X.createText=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),_&&X.setAttributes(k,_),k},X.createTSpan=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=_,k&&X.setAttributes(H,k),H},X.createImage=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&X.setAttributes(k,_),k},X.createPoint=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=_,H.y=k,H},X.createPath=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",_),k&&X.setAttributes(H,k),H},X}(),ne=function(){function X(){}return X.addKey=function(_){X.key=_},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),de=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(_,k,H){var ee=this;return new Promise(function(V){var Ee=H!==void 0?H:document.createElement("canvas");_===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Ke=document.createElementNS("http://www.w3.org/2000/svg","svg");Ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ke.setAttribute("width",k.width.baseVal.valueAsString),Ke.setAttribute("height",k.height.baseVal.valueAsString),Ke.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),Ke.innerHTML=k.innerHTML,ee.naturalSize===!0?(Ke.width.baseVal.value=_.naturalWidth,Ke.height.baseVal.value=_.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ke.width.baseVal.value=ee.width,Ke.height.baseVal.value=ee.height),Ee.width=Ke.width.baseVal.value,Ee.height=Ke.height.baseVal.value;var it=Ke.outerHTML,vt=Ee.getContext("2d");ee.markersOnly!==!0&&vt.drawImage(_,0,0,Ee.width,Ee.height);var Ve=window.URL,Tt=new Image(Ee.width,Ee.height);Tt.setAttribute("crossOrigin","anonymous");var Wt=new Blob([it],{type:"image/svg+xml"}),qt=Ve.createObjectURL(Wt);Tt.onload=function(){vt.drawImage(Tt,0,0),Ve.revokeObjectURL(qt);var Wn=Ee.toDataURL(ee.imageType,ee.imageQuality);V(Wn)},Tt.src=qt})},X}(),se=function(){},De=function(){function X(_){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},X.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new Ne("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ae("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ae("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),Ne=function(X,_){this.selector=X,this.style=_},Ae=function(X,_){this.localName=X,this.style=_},Pe=function(){function X(_,k,H,ee,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=_,this.displayMode=k,this.markerItems=H,this.uiStyleSettings=ee,this.styles=V,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(_){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(H,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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(V){var Ee=document.createElement("div");Ee.className=""+k.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",V.typeName),Ee.innerHTML=V.icon,Ee.addEventListener("click",function(){k.markerToolbarButtonClicked(Ee,V)}),k.buttons.push(Ee),k.markerButtons.push(Ee)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ee,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},X.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<_||k===_&&this.markerButtons.length-1===_?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===_&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var _=this;this.buttons.forEach(function(k){k.className=k.className.replace(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:_.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(_,k,H){var ee=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=k,V.setAttribute("data-action",H),V.addEventListener("click",function(){ee.actionToolbarButtonClicked(V,H)}),H){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}_.appendChild(V),this.buttons.push(V)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ae("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Ae("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(_,k){this.setActiveButton(_),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(_,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(_){var k=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===_});k&&this.setActiveButton(k)},X.prototype.setCurrentMarker=function(_){var k=this;this.currentMarker=_,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){k.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},X}(),Be=function(){function X(_,k,H,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=k,this.uiStyleSettings=H,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
|
|
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
padding: `+k+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(_){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(_){var k,H,ee=this;this.panels=_,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ee;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(_){var k=this,H=-1;if(_!==this.activePanel){H=this.panels.indexOf(_),this.panelRow.innerHTML="";var ee=_.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=_}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ee){var Ke,it;V.className=k.toolboxButtonStyleClass.name+" "+(Ee===H?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((it=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:k.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,_){this.title=X,this.icon=_},ge=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=H,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);H.appendChild(V),k.colorBoxes.push(V)}),H},_.prototype.getColorBox=function(k){var H=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=V-2+"px",Ee.style.height=V-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(V+2)/2+"px",Ee.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){H.setCurrentColor(k,Ee)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),Ee.appendChild(Ke),Ee},_.prototype.setCurrentColor=function(k,H){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},_}(oe),Oe=function(){function X(_,k,H){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=k,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(_){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(_,k){},X.prototype.dblClick=function(_,k){},X.prototype.manipulate=function(_){},X.prototype.pointerUp=function(_){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},X.prototype.scale=function(_,k){},X.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},X.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Ie=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},X}(),He=function(){function X(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},X}(),Xe=function(){function X(){}return X.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},X.toSVGMatrix=function(_,k){return _.a=k.a,_.b=k.b,_.c=k.c,_.d=k.d,_.e=k.e,_.f=k.f,_},X}(),qe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return Se(_,X),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var H=he.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},_.prototype.pointerUp=function(k){var H=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},_.prototype.manipulate=function(k){var H=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(k)},_.prototype.resize=function(k){var H=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=H,this.width=ee):(this.left=H+ee,this.width=-ee),Ee>=0?(this.top=V,this.height=Ee):(this.top=V+Ee,this.height=-Ee),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var H=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},_.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},_.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var H=this.container.getCTM(),ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(H)).x,y:ee.y}},_.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var H=this.container.getCTM();H=H.inverse();var ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(H)).x,y:ee.y}},_.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var k=he.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=he.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=he.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,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()},_.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()},_.prototype.createGrip=function(){var k=new He;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},_.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,H=-k/2,ee=H,V=(this.width+this.CB_DISTANCE)/2-k/2,Ee=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,it=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,H,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,it,ee),this.positionGrip(this.controlGrips.centerLeft.visual,H,Ee),this.positionGrip(this.controlGrips.centerRight.visual,it,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,H,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,it,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(k,H,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(H,ee),k.transform.baseVal.replaceItem(V,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*H});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*H,this.adjustControlBox()},_}(Oe),Ze=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=he.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)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){X.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){var H=k;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize()},_.title="Rectangle marker",_}(qe),nt=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=H,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",V.appendChild(Ee);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,it.style.flexGrow="2",Ke.appendChild(it),V.appendChild(Ke),k.widthBoxes.push(V)}),H},_.prototype.setCurrentWidth=function(k,H){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(oe),$e=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Ee.styles=[],Ee.styleBoxes=[],Ee.styles=H,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ke=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
|
|
</svg>`;Ee.innerHTML=Ke,V.appendChild(Ee),k.styleBoxes.push(V)}),H},_.prototype.setCurrentStyle=function(k,H){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(oe),Qe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="FrameMarker",_.title="Frame marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',_}(Ze),Fe=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(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(_,X),_.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(k){var H=this.state;X.prototype.pointerUp.call(this,k),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(k),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},_.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},_.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var k=new He;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},_.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},_.prototype.positionGrip=function(k,H,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(H,ee),k.transform.baseVal.replaceItem(V,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.x1=this.x1*k,this.y1=this.y1*H,this.x2=this.x2*k,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},_}(Oe),lt=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',_}(ut),je=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=H,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ke),V.appendChild(Ee),k.fontBoxes.push(V)}),H},_.prototype.setCurrentFont=function(k,H){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(oe),We=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(_,X),_.prototype.ownsTarget=function(k){if(X.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(H=!0)}),H},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.renderText=function(){var k=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(H){k.textElement.appendChild(he.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var k=this.textElement.getBBox(),H=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;H=Math.min(ee,V)}return H},_.prototype.getTextPosition=function(k){var H=this.textElement.getBBox(),ee=0,V=0;return H.width>0&&H.height>0&&(ee=(this.width-H.width*k)/2,V=this.height/2-H.height*k/2),{x:ee,y:V}},_.prototype.sizeText=function(){var k=this.textElement.getBBox(),H=this.getTextScale(),ee=this.getTextPosition(H);ee.y-=k.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(k){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,k),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.prototype.showTextEditor=function(){var k=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&H>.9;)H-=.1,k.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var ee=H.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};H.x-=V.x/2,H.y-=V.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},_.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},_.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},_.prototype.dblClick=function(k,H){X.prototype.dblClick.call(this,k,H),this.showTextEditor()},_.prototype.setColor=function(k){this.textElement&&he.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},_.prototype.setFont=function(k){this.textElement&&he.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var H=k;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',_}(qe),Ce=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var k=he.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){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(k.x,k.y),this.drawing=!0):X.prototype.pointerDown.call(this,k,H)},_.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,k)},_.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)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=H[0],V=H[1],Ee=H[2],Ke=H[3],it=!1,vt=0;vt<this.canvasElement.height;vt++)for(var Ve=0;Ve<this.canvasElement.width;Ve++)k.data[vt*this.canvasElement.width*4+4*Ve+3]>0&&(it=!0,vt<V&&(V=vt),Ve<ee&&(ee=Ve),vt>Ke&&(Ke=vt),Ve>Ee&&(Ee=Ve));if(it){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var Tt=document.createElement("canvas");Tt.width=Ee-ee,Tt.height=Ke-V,Tt.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Ee-ee,Ke-V),0,0),this.drawingImgUrl=Tt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},_.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){this.createVisual(),X.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',_}(qe),_e=function(X){function _(k,H,ee){var V=X.call(this,k,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=H,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var ee=function(Ke){var it="both";switch(Ke){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var vt=document.createElement("div");if(vt.style.display="flex",vt.style.flexGrow="2",vt.style.alignItems="center",vt.style.justifyContent="space-between",vt.style.padding="5px",vt.style.borderWidth="2px",vt.style.borderStyle="solid",vt.style.borderColor=it===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",vt.addEventListener("click",function(){k.setCurrentType(it,vt)}),H.appendChild(vt),it==="both"||it==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ve.style.marginLeft="5px",vt.appendChild(Ve)}var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.style.flexGrow="2";var Wt=document.createElement("hr");if(Wt.style.minWidth="20px",Wt.style.border="0px",Wt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),Wt.style.flexGrow="2",Tt.appendChild(Wt),vt.appendChild(Tt),it==="both"||it==="end"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,qt.style.marginRight="5px",vt.appendChild(qt)}V.typeBoxes.push(vt)},V=this,Ee=0;Ee<4;Ee++)ee(Ee);return H},_.prototype.setCurrentType=function(k,H){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(oe),Te=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new _e("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},_.prototype.getArrowPoints=function(k,H){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(H+V/2)+" "+k+","+(H-V/2)+" "+(k+ee/2)+","+(H+V/2)},_.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(X.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",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},_.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',_}(lt),ae=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ge("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="CoverMarker",_.title="Cover marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',_}(Ze),le=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=H,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",V.appendChild(Ee),k.opacityBoxes.push(V)}),H},_.prototype.setCurrentOpacity=function(k,H){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(oe),fe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ge("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(_,X),_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="HighlightMarker",_.title="Highlight marker",_.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',_}(ae),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',we=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ge("Text color",ee.defaultColorSet,V.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ge("Fill color",ee.defaultColorSet,V.bgColor,me),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new He,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(_,X),_.prototype.ownsTarget=function(k){return X.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},_.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(k,H){this.state==="new"&&X.prototype.pointerDown.call(this,k,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,k,H)},_.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,k);else{var H=this.state==="creating";X.prototype.pointerUp.call(this,k),this.setTipPoints(H),this.positionTip()}},_.prototype.manipulate=function(k){if(this.tipMoving){var H=this.unrotatePoint(k);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,k)},_.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",k]]),he.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},_.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},_.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var H=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:H+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+ee,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-ee,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-ee,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-ee},this.tipBase2Position={x:this.width,y:this.height-H}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-ee})},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.positionTip()},_.prototype.positionTip=function(){he.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},_.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var H=k;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,X.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*H},this.positionTip()},_.typeName="CalloutMarker",_.title="Callout marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',_}(We),Ue=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new ge("Line color",ce(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new ge("Fill color",ce(ee.defaultColorSet,["transparent"]),V.fillColor,me),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=he.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)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){X.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var H=k;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',_}(qe),ze=function(X){function _(k,H,ee){return X.call(this,k,H,ee)||this}return Se(_,X),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},_.prototype.createTips=function(){this.tip1=he.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(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.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(he.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.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()]]),he.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 k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',_}(lt),rt=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',_}(Ue),pt=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),ct=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/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()))},_.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),X.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},_.prototype.scale=function(k,H){this.curveX=this.curveX*k,this.curveY=this.curveY*H,X.prototype.scale.call(this,k,H)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',_}(ut),At=function(){function X(_,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=k}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),St=function(X){function _(k,H,ee){var V=X.call(this,k,!1)||this;return V.dataUrl=H,V.state=ee,V}return Se(_,X),_}(At),dt=function(X){function _(k,H,ee){ee===void 0&&(ee=!1);var V=X.call(this,k,ee)||this;return V.marker=H,V}return Se(_,X),_}(At),Ft=function(){function X(){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 X.prototype.addEventListener=function(_,k){this[_].push(k)},X.prototype.removeEventListener=function(_,k){var H=this[_].indexOf(k);H>-1&&this[_].splice(H,1)},X}(),gt=function(){function X(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new pt,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.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(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,rt,Ue,fe,we,ze,ae,lt,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,Ue,fe,we]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var k=this;this._availableMarkerTypes.splice(0),_.forEach(function(H){if(typeof H=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===H});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new At(_))})},X.prototype.render=function(){return Le(this,void 0,void 0,function(){var _;return be(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(_=new de).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},X.prototype.close=function(_){var k=this;if(_===void 0&&(_=!1),this.isOpen){var H=!1;_||this.eventListeners.beforeclose.forEach(function(ee){var V=new At(k,!0);ee(V),V.defaultPrevented&&(H=!0)}),H||(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(ee){return ee(new At(k))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var _,k=[],H=0;H<arguments.length;H++)k[H]=arguments[H];(_=this._availableMarkerTypes).push.apply(_,k)},X.prototype.addRenderEventListener=function(_){this.addEventListener("render",function(k){_(k.dataUrl,k.state)})},X.prototype.removeRenderEventListener=function(_){},X.prototype.addCloseEventListener=function(_){this.addEventListener("close",function(){_()})},X.prototype.removeCloseEventListener=function(_){},X.prototype.setupResizeObserver=function(){var _=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return _.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var _=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/_>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,H=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/_;this.resize(k,H)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(_,k){this._isResizing=!0;var H=_/this.imageWidth,ee=k/this.imageHeight;this.imageWidth=Math.round(_),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(H,ee),this._isResizing=!1},X.prototype.scaleMarkers=function(_,k){var H,ee=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(_,k):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==ee._currentMarker&&V.scale(_,k)}),H!==void 0&&this.setCurrentMarker(H)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var _=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=_.left-k.left,this.top=_.top-k.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var _,k=[],H=0;H<arguments.length;H++)k[H]=arguments[H];this.defs=he.createDefs(),this.addDefsToImage(),(_=this.defs).append.apply(_,k)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var _=document.createElement("a");_.href="https://markerjs.com/",_.target="_blank",_.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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 Pe(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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Be(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(_){this.markerImage.removeChild(_.container),this.markers.indexOf(_)>-1&&this.markers.splice(this.markers.indexOf(_),1),_.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(_,k){if(_==="marker"&&k!==void 0)this.createNewMarker(k);else if(_==="action")switch(k){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()}},X.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new dt(_,_._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var H=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(ee){return ee(new dt(_,H))})}}},X.prototype.clear=function(){var _=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ke=new dt(_,void 0,!0);Ee(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var H=function(Ee){var Ke=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(it){return it(new dt(_,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)H(V);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var _;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=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===k.width&&H.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new At(_))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(V){return V(new At(_))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var _=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new At(_))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var _=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new At(_))}))},X.prototype.stepZoom=function(){var _=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=_<this.zoomSteps.length-1?this.zoomSteps[_+1]:this.zoomSteps[0]},X.prototype.panTo=function(_){this.contentDiv.scrollBy({left:this.prevPanPoint.x-_.x,top:this.prevPanPoint.y-_.y}),this.prevPanPoint=_},X.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var _,k,H=this;return be(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return _=ee.sent(),k=this.getState(),this.eventListeners.render.forEach(function(V){return V(new St(H,_,k))}),this.close(!0),[2]}})})},X.prototype.getState=function(_){_===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(H){return k.markers.push(H.getState())}),k},X.prototype.restoreState=function(_){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);_.markers.forEach(function(H){var ee=k._availableMarkerTypes.find(function(Ee){return Ee.typeName===H.typeName});if(ee!==void 0){var V=k.addNewMarker(ee);V.restoreState(H),k.markers.push(V)}}),_.width&&_.height&&(_.width!==this.imageWidth||_.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/_.width,this.imageHeight/_.height),this.eventListeners.restorestate.forEach(function(H){return H(new At(k))})},X.prototype.addNewMarker=function(_){var k=he.createGroup();return this.markerImage.appendChild(k),new _(k,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(_){var k,H=this;(k=typeof _=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===_}):_)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new dt(H,H._currentMarker))}))},X.prototype.markerCreated=function(_){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(_),this.setCurrentMarker(_),_ instanceof Ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new dt(k,k._currentMarker))})},X.prototype.colorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=_,this.settings.defaultStrokeColor=_)},X.prototype.fillColorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=_)},X.prototype.markerStateChanged=function(_){var k=this;this.eventListeners.markerchange.forEach(function(H){return H(new dt(k,_))})},X.prototype.setCurrentMarker=function(_){var k=this;this._currentMarker!==_&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(H){return H(new dt(k,k._currentMarker))})),this._currentMarker=_,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(H){return H(new dt(k,k._currentMarker))}))},X.prototype.onPointerDown=function(_){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||_.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(H){return H.ownsTarget(_.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:_.clientX,y:_.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY))},X.prototype.onDblClick=function(_){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(H){return H.ownsTarget(_.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(_){this.touchPoints!==1&&_.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||_.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(_.clientX,_.clientY)):this.zoomLevel>1&&this.panTo({x:_.clientX,y:_.clientY}))},X.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.markerImage.getBoundingClientRect();return{x:(_-H.left)/this.zoomLevel,y:(k-H.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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()},X.prototype.addLicenseKey=function(_){ne.addKey(_)},X.prototype.addEventListener=function(_,k){this.eventListeners.addEventListener(_,k)},X.prototype.removeEventListener=function(_,k){this.eventListeners.removeEventListener(_,k)},X.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var _=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new At(_))}))},X.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new At(_))}))},X.instanceCounter=0,X}();/* **********************************
|
|
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 Lt=function(X,_){return(Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,H){k.__proto__=H}||function(k,H){for(var ee in H)Object.prototype.hasOwnProperty.call(H,ee)&&(k[ee]=H[ee])})(X,_)};function Dt(X,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function k(){this.constructor=X}Lt(X,_),X.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}function tt(X,_,k,H){return new(k||(k=Promise))(function(ee,V){function Ee(vt){try{it(H.next(vt))}catch(Ve){V(Ve)}}function Ke(vt){try{it(H.throw(vt))}catch(Ve){V(Ve)}}function it(vt){var Ve;vt.done?ee(vt.value):(Ve=vt.value,Ve instanceof k?Ve:new k(function(Tt){Tt(Ve)})).then(Ee,Ke)}it((H=H.apply(X,_||[])).next())})}function fn(X,_){var k,H,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(it){return function(vt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,H&&(ee=2&Ve[0]?H.return:Ve[0]?H.throw||((ee=H.return)&&ee.call(H),0):H.next)&&!(ee=ee.call(H,Ve[1])).done)return ee;switch(H=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,H=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]<ee[3])){Ee.label=Ve[1];break}if(Ve[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=Ve;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(Ve);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}Ve=_.call(X,Ee)}catch(Tt){Ve=[6,Tt],H=0}finally{k=ee=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([it,vt])}}}var En=function(){function X(){}return X.addKey=function(_){X.key=_},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),bt=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(_,k){for(var H=0,ee=k;H<ee.length;H++){var V=ee[H],Ee=V[0],Ke=V[1];_.setAttribute(Ee,Ke)}},X.createRect=function(_,k,H){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",_.toString()),ee.setAttribute("height",k.toString()),H&&X.setAttributes(ee,H),ee},X.createLine=function(_,k,H,ee,V){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",_.toString()),Ee.setAttribute("y1",k.toString()),Ee.setAttribute("x2",H.toString()),Ee.setAttribute("y2",ee.toString()),V&&X.setAttributes(Ee,V),Ee},X.createPolygon=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",_),k&&X.setAttributes(H,k),H},X.createCircle=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(_/2).toString()),H.setAttribute("cy",(_/2).toString()),H.setAttribute("r",_.toString()),k&&X.setAttributes(H,k),H},X.createEllipse=function(_,k,H){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(_/2).toString()),ee.setAttribute("cy",(k/2).toString()),ee.setAttribute("rx",(_/2).toString()),ee.setAttribute("ry",(k/2).toString()),H&&X.setAttributes(ee,H),ee},X.createGroup=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&X.setAttributes(k,_),k},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(_,k,H,ee,V,Ee,Ke){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(it,[["id",_],["orient",k],["markerWidth",H.toString()],["markerHeight",ee.toString()],["refX",V.toString()],["refY",Ee.toString()]]),it.appendChild(Ke),it},X.createText=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),_&&X.setAttributes(k,_),k},X.createTSpan=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=_,k&&X.setAttributes(H,k),H},X.createImage=function(_){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&X.setAttributes(k,_),k},X.createPoint=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=_,H.y=k,H},X.createPath=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",_),k&&X.setAttributes(H,k),H},X.createElement=function(_,k){var H=document.createElementNS("http://www.w3.org/2000/svg",_);return k&&X.setAttributes(H,k),H},X.getHollowRectanglePath=function(_,k,H,ee,V,Ee,Ke,it){return"M"+_+","+k+"V"+(k+ee)+"H"+(_+H)+"V"+k+"H"+V+"V"+Ee+"H"+(V+Ke)+"V"+(Ee+it)+"H"+V+"V"+k+"Z"},X}(),Vt=function(){function X(_){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},X.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new _t("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),_t=function(X,_){this.selector=X,this.style=_},xt=function(X,_){this.localName=X,this.style=_},Bt=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(_){_.className=this.blockClassName,_.buttonClassName=this.buttonClassName,_.buttonColorsClassName=this.buttonColorsClassName,_.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(_)},X.prototype.addElementBlock=function(_){_.className===void 0&&(_.className=this.blockClassName),this.blocks.push(_)},X.prototype.getUI=function(){var _=document.createElement("div");return _.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,_.style.display=this.display,this.blocks.forEach(function(k){return _.appendChild(k.getUI())}),_},X}(),$t=function(){function X(){}return X.prototype.getUI=function(){var _=document.createElement("div");if(_.className=this.className,this.minWidth!==void 0&&(_.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":_.style.justifyContent="flex-start";break;case"center":_.style.justifyContent="center";break;case"end":_.style.justifyContent="flex-end"}return _.style.whiteSpace="nowrap",_},X}(),pn=function(X){function _(){var k=X!==null&&X.apply(this,arguments)||this;return k.buttons=[],k}return Dt(_,X),_.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},_.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.buttons.forEach(function(H){return k.appendChild(H.getUI())}),k},_}($t),Ut=function(){function X(_,k){this._isActive=!1,this._isHidden=!1,this._icon=_,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(_){this._icon=_,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(_){this._isActive=_,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var _=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return _.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),mt=function(X){function _(){var k=X!==null&&X.apply(this,arguments)||this;return k.elements=[],k}return Dt(_,X),_.prototype.addElement=function(k){this.elements.push(k)},_.prototype.getUI=function(){var k=X.prototype.getUI.call(this);return this.elements.forEach(function(H){return k.appendChild(H)}),k},_}($t),Hn=function(){function X(_,k){this.horizontal=_,this.vertical=k}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(_){return _/this.ratio},X.prototype.getHorizontalLength=function(_){return _*this.ratio},X}(),Jt=function(){function X(){}return X.getIcon=function(_,k){if(_>0&&k>0){var H=new Hn(_,k),ee=H.ratio>=1?20:H.getHorizontalLength(20),V=H.ratio<1?20:H.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ke=bt.createDefs();Ee.appendChild(Ke);var it=bt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(it);var vt=bt.createPath(bt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Ee.appendChild(vt);var Ve=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(bt.createTSpan(_+":"+k)),Ee.appendChild(Ve);var Tt=Ve.getBBox();bt.setAttributes(Ve,[["x",((24-Tt.width)/2).toString()],["y",((24-Tt.height)/2-Tt.y).toString()]]);var Wt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Tt.width))/2,(24-Math.ceil(Tt.height))/2,Math.ceil(Tt.width),Math.ceil(Tt.height)));return it.appendChild(Wt),bt.setAttributes(vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},X}(),en=function(X){function _(k,H,ee){var V=X.call(this,k,H)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Dt(_,X),_.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=k.className,H.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},_.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},_.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},_.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},_.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},_.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},_}(Ut),It=function(){function X(_,k){this.GRIP_SIZE=10,this.color=_,this.fillColor=k,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},X.prototype.setCenter=function(_,k){this.visual.childNodes.forEach(function(H){return bt.setAttributes(H,[["cx",_.toString()],["cy",k.toString()]])})},X}(),hn=function(){function X(_,k,H,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=_,this.canvasHeight=k,this.margin=H,this.container=ee,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(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(_){this._aspectRatio=_,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(_){this._zoomFactor=_,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var _=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(H){return _.gridContainer.appendChild(H)}),this.verticalGridLines.forEach(function(H){return _.gridContainer.appendChild(H)}),this.cropRectElement=bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(_){this.cropRect=_;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),bt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var H=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ee){var Ke=k.y+H*(Ee+1);bt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ee){var Ke=k.x+ee*(Ee+1);bt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.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)},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.container.getBoundingClientRect();return{x:_-H.left+this.margin,y:k-H.top+this.margin}},X.prototype.onPointerDown=function(_){this.container.setPointerCapture(_.pointerId),this.previousPoint=this.clientToLocalCoordinates(_.clientX,_.clientY),this.cropRectElement===_.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(_.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(_.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(_.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(_.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(_){if(this.isMoving)this.move(this.clientToLocalCoordinates(_.clientX,_.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(_.clientX,_.clientY);this.resize(k)}_.preventDefault()},X.prototype.onPointerUp=function(_){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(_.pointerId)},X.prototype.move=function(_){var k=_.x-this.previousPoint.x,H=_.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=_},X.prototype.resize=function(_){var k=Object.assign({},this.cropRect),H=_.x-this.previousPoint.x,ee=_.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+H<this.margin&&(H=this.margin-k.x),k.x+=H,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+H>this.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-k.width),k.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=_,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var _=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=H:this.cropRect.height=ee,this.cropRect.width>this.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=_-this.cropRect.width/2,this.cropRect.y=k-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)}},X.prototype.getRescaledRect=function(_,k,H,ee,V,Ee){var Ke=H/_,it=ee/k;return{x:(V.x-Ee)*Ke+Ee,y:(V.y-Ee)*it+Ee,width:V.width*Ke,height:V.height*it}},X.prototype.scaleCanvas=function(_,k){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,_,k,this.cropRect,this.margin);this.canvasWidth=_,this.canvasHeight=k,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},X}(),kn=function(){function X(_){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=_,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(X.prototype,"angle",{get:function(){return this._angle},set:function(_){this._angle=_,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(_){this.controlContainer.setPointerCapture(_.pointerId),this.isDragging=!0,this.previousPoint={x:_.clientX,y:_.clientY}},X.prototype.onPointerMove=function(_){this.isDragging&&(this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.previousPoint.x=_.clientX)},X.prototype.onPointerUp=function(_){this.isDragging&&this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(_.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var _=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-_.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var _=this.scaleShape.transform.baseVal.getItem(0);_.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(_,0)}},X.prototype.getVisual=function(){var _=document.createElementNS("http://www.w3.org/2000/svg","svg");_.setAttribute("xmlns","http://www.w3.org/2000/svg"),_.setAttribute("width",this.width+"px"),_.setAttribute("height",this.height+"px"),_.setAttribute("viewBox","0 0 "+this.width+" "+this.height),_.style.flexShrink="0",document.body.appendChild(_);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var ee=H%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=bt.createPath(k);var V=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),_.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=bt.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),_.appendChild(this.angleLabelElement),document.body.removeChild(_),_},X}(),$n=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(_,k,H,ee,V,Ee,Ke){var it=this;return new Promise(function(vt){var Ve=document.createElement("canvas");Ve.width=_.width.baseVal.value-2*ee,Ve.height=_.height.baseVal.value-2*ee;var Tt=1,Wt=1;it.naturalSize===!0?(Tt=k.naturalWidth/(_.width.baseVal.value-2*ee)/Ee,Wt=k.naturalHeight/(_.height.baseVal.value-2*ee)/Ke,Ve.width=k.naturalWidth/Ee,Ve.height=k.naturalHeight/Ke):it.width!==void 0&&it.height!==void 0&&(Tt=it.width/H.width,Wt=it.height/H.height,Ve.width*=Tt,Ve.height*=Wt);var qt=Ve.getContext("2d");qt.translate(Ve.width/2,Ve.height/2),qt.rotate(V*Math.PI/180),qt.scale(Ee,Ke),qt.translate(-Ve.width/2,-Ve.height/2),qt.drawImage(k,0,0,Ve.width,Ve.height);var Wn=document.createElement("canvas");Wn.width=H.width*Tt,Wn.height=H.height*Wt,Wn.getContext("2d").putImageData(qt.getImageData((H.x-ee)*Tt,(H.y-ee)*Wt,H.width*Tt,H.height*Wt),0,0),vt(Wn.toDataURL(it.imageType,it.imageQuality))})},X}(),Je=function(){function X(_){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=X.instanceCounter++,this.styles=new Vt(this.instanceNo),this.target=_,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(_){this._zoomToCropEnabled=_,_?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(_){this._gridLines=_,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(_){this._rotationAngle=_,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var _;return(_=this._aspectRatio)!==null&&_!==void 0?_:this.aspectRatios[0]},set:function(_){this._aspectRatio=_},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(_){_===void 0&&(_=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),_||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(_){this.renderEventListeners.push(_)},X.prototype.removeRenderEventListener=function(_){this.renderEventListeners.indexOf(_)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(_),1)},X.prototype.addCloseEventListener=function(_){this.closeEventListeners.push(_)},X.prototype.removeCloseEventListener=function(_){this.closeEventListeners.indexOf(_)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(_),1)},X.prototype.setupResizeObserver=function(){var _=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.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))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var _=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/_>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*_:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/_;this.resize(k,H)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(_,k){this.imageWidth=Math.round(_),this.imageHeight=Math.round(k),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},X.prototype.setEditingTarget=function(){var _=document.createElement("canvas");_.width=this.target.naturalWidth,_.height=this.target.naturalHeight,_.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=_.toDataURL();bt.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var _=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=_.left-k.left-this.CANVAS_MARGIN,this.top=_.top-k.top-this.CANVAS_MARGIN},X.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var _=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(_);var k=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=bt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new hn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},X.prototype.zoomToCrop=function(){if(this.cropRect){var _=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=_+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-_+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},X.prototype.cropRectChanged=function(_){this.cropRect=_,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var _=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>_+this.CANVAS_MARGIN?this.target.offsetTop-(_+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"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},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var _=this;this.topToolbar=new Bt,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 k=new pn;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var H=[];this.aspectRatios.forEach(function(Wt){var qt=new Ut(Jt.getIcon(Wt.horizontal,Wt.vertical),Wt.horizontal===0&&Wt.vertical===0?"FREE":Wt.horizontal+":"+Wt.vertical);qt.onClick=function(){return _.ratioButtonClicked(Wt)},H.push(qt)}),this.aspectRatioButton=new en(Jt.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Ut('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){_.isGridVisible=!_.isGridVisible,ee.isActive=_.isGridVisible},k.addButton(ee);var V=new Ut('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){_.zoomToCropEnabled=!_.zoomToCropEnabled,V.isActive=_.zoomToCropEnabled},k.addButton(V),!En.isLicensed){var Ee=new mt;this.topToolbar.addElementBlock(Ee);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Ke.appendChild(it),Ee.addElement(Ke)}var vt=new pn;vt.minWidth=3*this.toolbarHeight+"px",vt.contentAlign="end",this.topToolbar.addButtonBlock(vt);var Ve=new Ut('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ve.onClick=this.startRenderAndClose,vt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new Ut('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Tt.onClick=this.close,vt.addButton(Tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var _=this;this.bottomToolbar=new Bt,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 k=new pn;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var H=new Ut('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");H.onClick=this.rotateLeftButtonClicked,k.addButton(H);var ee=new Ut('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new mt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new kn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(vt){_.rotateBy(vt),_.straightener.angle=_.rotationAngle},V.addElement(this.straightener.getUI());var Ee=new pn;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ke=new Ut('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ke);var it=new Ut('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,Ee.addButton(it)},X.prototype.ratioButtonClicked=function(_){this.aspectRatio=_,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(_){if(_){var k=this.cropLayer.getRescaledRect(_.width,_.height,this.imageWidth,this.imageHeight,_.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=_.flippedHorizontally,this.flippedVertically=_.flippedVertically,this.applyFlip(),this.rotationAngle=_.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.cropImage.getBoundingClientRect();return{x:_-H.left,y:k-H.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var _=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=_+"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()},X.prototype.rotateLeftButtonClicked=function(){var _=this.rotationAngle-90;this.rotationAngle%90!=0&&(_+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(_)},X.prototype.rotateRightButtonClicked=function(){var _=this.rotationAngle+90;this.rotationAngle%90!=0&&(_-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(_)},X.prototype.rotateTo=function(_){_=(_=_>180?_-360:_)<=-180?_+360:_,this.rotationAngle=_,this.applyRotation()},X.prototype.rotateBy=function(_){this.rotateTo((this.rotationAngle+_)%360)},X.prototype.applyRotation=function(){var _=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=_},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return tt(this,void 0,void 0,function(){var _,k;return fn(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return _=H.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(_,k)}),this.close(!0),[2]}})})},X.prototype.render=function(){return tt(this,void 0,void 0,function(){var _;return fn(this,function(k){switch(k.label){case 0:return(_=new $n).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.width=this.renderWidth,_.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,_.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 k.sent(),[4,_.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,k.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("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 xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var _=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*_)+`px;
|
|
height: `+(this.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},X.instanceCounter=0,X}(),Ot=Z("8hTe"),mi=Z.n(Ot),gi=/<pre[^>]*>/g;function vi(X){var _=document.createElement("div");return _.innerHTML=X,_.childNodes.length===0?"":_.childNodes[0].nodeValue}var yi=xe.a=function(X){var _=X.value,k=_===void 0?"":_,H=X.edit,ee=H===void 0?!1:H,V=X.className,Ee=X.showTextOnly,Ke=X.showLines,it=X.replaces,vt=X.zoomImg,Ve=X.hasMask,Tt=X.style,Wt=Tt===void 0?{}:Tt,qt=X.stylesPrev,Wn=qt===void 0?{}:qt,Sn=String(k),Cn=Object(R.useRef)(),Zn=Object(R.useRef)(),Di=Object(R.useState)(""),mn=Object(z.a)(Di,2),Vn=mn[0],ui=mn[1],hi=Object(R.useState)("office"),Gn=Object(z.a)(hi,2),ki=Gn[0],bi=Gn[1],Ki=function(){var Gt=new Je(Zn.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var xn=Object(U.a)(n.a.mark(function Pt(on){var Xt;return n.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Cn.current.style.display="none",gn.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Xt=gn.sent,Xt!=null&&Xt.id&&it(Zn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return gn.stop()}},Pt)}));return function(Pt){return xn.apply(this,arguments)}}()),Gt.show()},Vi=function(){var Gt=new gt(Zn.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var xn=Object(U.a)(n.a.mark(function Pt(on){var Xt;return n.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(Cn.current.style.display="none",!Zn.current){gn.next=6;break}return gn.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Xt=gn.sent,Xt!=null&&Xt.id&&it(Zn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return gn.stop()}},Pt)}));return function(Pt){return xn.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},qn=Object(R.useMemo)(function(){Cn.current&&(Cn.current.style.zIndex=-1);try{var an=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Sn=Sn.replace(an,"("+J.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+J.a.API_SERVER+"/api/attachments/").replace(xn,'"'+J.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(ri){}var Pt=N(Sn),on=C();if(Sn.match(/\[TOC\]/)&&(Pt=Pt.replace("<p>[TOC]</p>",D()),A()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(ri,gn){var Ln=on[gn],Xi=Ln.type,xi=Ln.expression;return Object(ie.renderToString)(vi(xi)||"",{displayMode:Xi==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),y(),Ee){var Xt=document.createElement("div");return Xt.innerHTML=Pt,Xt.innerText}return setTimeout(function(){return cr()},500),Pt},[Sn]),Jn=Object(R.useRef)();E.WebkitLineClamp=Ke,Ke&&(Wt=Object(j.a)(Object(j.a)({},Wt),E));function _i(an){var Gt=an.target;if(Gt.tagName.toUpperCase()==="IMG"){if(vt){var xn=Gt.getAttribute("src");ui(xn),bi("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Pt=Gt.getAttribute("href");if(Pt.indexOf("office")>-1)an.preventDefault(),ui(Pt),bi("office");else if(Pt.indexOf("application/pdf")>-1)an.preventDefault(),ui(Pt),bi("pdf");else if(Pt.indexOf("text/html")>-1)an.preventDefault(),ui(Pt),bi("html");else if(Pt.startsWith("#")){an.preventDefault();var on=document.getElementById(Pt.replace("#",""));on&&on.scrollIntoView(!0)}}}var cr=function(){var Gt,xn=(Gt=Jn.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");xn==null||xn.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var on=new W.a;on.loadSource(Pt.src),on.attachMedia(Pt)}}})};Object(R.useEffect)(function(){if(Jn.current&&qn&&(qn.match(gi)&&window.PR.prettyPrint()),Jn.current)return Jn.current.addEventListener("click",_i),function(){Jn.current.removeEventListener("click",_i),y(),A()}},[qn,Jn.current,_i]);var Ei=function(Gt){if(!ee)return;Gt.target.nodeName==="IMG"?(Cn.current.style.zIndex=1,Cn.current.style.display="flex",Cn.current.style.width=Gt.target.clientWidth+"px",Cn.current.style.height=Gt.target.clientHeight+"px",Cn.current.style.top=Gt.target.offsetTop+"px",Cn.current.style.left=Gt.target.offsetLeft+"px",Zn.current.src=Gt.target.getAttribute("src")):Cn.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Jn,style:Object(j.a)({},Wt),className:"".concat(V||""," markdown-body ").concat(mi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:qn}}),v.a.createElement("div",{ref:Cn,className:mi.a.button},v.a.createElement($.a,null,v.a.createElement(Y.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),v.a.createElement(Y.a,{onClick:function(){return Vi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Zn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ue.a,{close:!0,data:Vn,type:Vn!=null&&Vn.length?ki:"",style:Object(j.a)({},Wn),onClose:function(){return ui("")}}))}},"9VGf":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var re=Z("q1tI"),$=Z.n(re);function P(Y,j){var U=Object(re.useRef)();Object(re.useEffect)(function(){U.current=Y}),Object(re.useEffect)(function(){function z(){U.current()}if(j!==null){var G=setInterval(z,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return U});var re=Z("MNnm"),$="rc-util-key";function P(z){if(z.attachTo)return z.attachTo;var G=document.querySelector("head");return G||document.body}function Y(z){var G,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var R=document.createElement("style");if((G=n.csp)===null||G===void 0?void 0:G.nonce){var v;R.nonce=(v=n.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=z;var m=P(n),p=m.firstChild;return n.prepend&&m.prepend?m.prepend(R):n.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var j=new Map;function U(z,G){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(n);if(!j.has(R)){var v=Y("",n),m=v.parentNode;j.set(R,m),m.removeChild(v)}var p=Array.from(j.get(R).children).find(function(h){return h.tagName==="STYLE"&&h[$]===G});if(p){var u,l;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&p.nonce!==((l=n.csp)===null||l===void 0?void 0:l.nonce)){var d;p.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return p.innerHTML!==z&&(p.innerHTML=z),p}var o=Y(z,n);return o[$]=G,o}},Bd2K:function(ot,xe,Z){(function(re){re(Z("VrN/"),Z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(n,R,v){if(v!=re.Init&&v&&n.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return Y(p)}),n.addKeyMap(m)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 Y(n){if(n.getOption("disableInput"))return re.Pass;for(var R=n.listSelections(),v=[],m=n.getOption("autoCloseTags"),p=0;p<R.length;p++){if(!R[p].empty())return re.Pass;var u=R[p].head,l=n.getTokenAt(u),d=re.innerMode(n.getMode(),l.state),o=d.state,h=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(o),s=h&&h.name;if(!s)return re.Pass;var a=d.mode.configuration=="html",A=typeof m=="object"&&m.dontCloseTags||a&&$,E=typeof m=="object"&&m.indentTags||a&&P;l.end>u.ch&&(s=s.slice(0,s.length-l.end+u.ch));var T=s.toLowerCase();if(!s||l.type=="string"&&(l.end!=u.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&h.close||l.string.indexOf("/")==u.ch-l.start-1||A&&z(A,T)>-1||G(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],s,u,!0))return re.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&z(D,s)>-1){v[p]={text:"/>",newPos:re.Pos(u.line,u.ch+2)};continue}var L=E&&z(E,T)>-1;v[p]={indent:L,text:">"+(L?`
|
|
|
|
`:"")+"</"+s+">",newPos:L?re.Pos(u.line+1,0):re.Pos(u.line,u.ch+1)}}for(var w=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var O=v[p];n.replaceRange(O.text,R[p].head,R[p].anchor,"+insert");var S=n.listSelections().slice(0);S[p]={head:O.newPos,anchor:O.newPos},n.setSelections(S),!w&&O.indent&&(n.indentLine(O.newPos.line,null,!0),n.indentLine(O.newPos.line+1,null,!0))}}function j(n,R){for(var v=n.listSelections(),m=[],p=R?"/":"</",u=n.getOption("autoCloseTags"),l=typeof u=="object"&&u.dontIndentOnSlash,d=0;d<v.length;d++){if(!v[d].empty())return re.Pass;var o=v[d].head,h=n.getTokenAt(o),s=re.innerMode(n.getMode(),h.state),a=s.state;if(R&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=o.ch-1))return re.Pass;var A,E=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(E&&s.mode.name=="javascript")A=p+"script";else if(E&&s.mode.name=="css")A=p+"style";else{var T=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!T||T.length&&G(n,T,T[T.length-1],o))return re.Pass;A=p+T[T.length-1]}n.getLine(o.line).charAt(h.end)!=">"&&(A+=">"),m[d]=A}if(n.replaceSelections(m),v=n.listSelections(),!l)for(var d=0;d<v.length;d++)(d==v.length-1||v[d].head.line<v[d+1].head.line)&&n.indentLine(v[d].head.line)}function U(n){return n.getOption("disableInput")?re.Pass:j(n,!0)}re.commands.closeTag=function(n){return j(n)};function z(n,R){if(n.indexOf)return n.indexOf(R);for(var v=0,m=n.length;v<m;++v)if(n[v]==R)return v;return-1}function G(n,R,v,m,p){if(!re.scanForClosingTag)return!1;var u=Math.min(n.lastLine()+1,m.line+500),l=re.scanForClosingTag(n,m,null,u);if(!l||l.tag!=v)return!1;for(var d=p?1:0,o=R.length-1;o>=0&&R[o]==v;o--)++d;m=l.to;for(var o=1;o<d;o++){var h=re.scanForClosingTag(n,m,null,u);if(!h||h.tag!=v)return!1;m=h.to}return!0}})},BjJ7:function(ot,xe,Z){"use strict";Z.d(xe,"d",function(){return $}),Z.d(xe,"c",function(){return P}),Z.d(xe,"e",function(){return Y}),Z.d(xe,"b",function(){return j}),Z.d(xe,"a",function(){return z});var re=Z("m3rI");function $(G){var n=!0;if(G.length>0){for(var R=0;R<G.length;R++)if(G[R].compile_success==0||!G[R].compile_success){n=!1;break}}else n=!1;return n}function P(G){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;v<G.length;v++){var m=G[v],p=n?"".concat(n,"/").concat(m.name):"".concat(m.name);R.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return R}function Y(G,n,R){for(var v=0;v<G.length;v++){var m=G[v];if(m.key===n){m.children=R;break}m.children&&Y(m.children,n,R)}return G}function j(G,n,R){var v;return function(){var m=this,p=arguments,u=function(){v=null,R||G.apply(m,p)},l=R&&!v;clearTimeout(v),v=setTimeout(u,n),l&&G.apply(m,p)}}var U=!0,z=re.a.API_SERVER},"C+DQ":function(ot,xe,Z){},"C/vA":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return re});function re($){const P=this;let Y=!1,j;return function(){return Y||(Y=!0,j=$.apply(P,arguments)),j}}},"Cg/j":function(ot,xe,Z){"use strict";Z.d(xe,"b",function(){return re}),Z.d(xe,"a",function(){return $}),Z.d(xe,"c",function(){return Y}),Z.d(xe,"d",function(){return j});var re;(function(U){U.serviceIds=new Map,U.DI_TARGET="$di$target",U.DI_DEPENDENCIES="$di$dependencies";function z(G){return G[U.DI_DEPENDENCIES]||[]}U.getServiceDependencies=z})(re||(re={}));const $=Y("instantiationService");function P(U,z,G,n){z[re.DI_TARGET]===z?z[re.DI_DEPENDENCIES].push({id:U,index:G,optional:n}):(z[re.DI_DEPENDENCIES]=[{id:U,index:G,optional:n}],z[re.DI_TARGET]=z)}function Y(U){if(re.serviceIds.has(U))return re.serviceIds.get(U);const z=function(G,n,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(z,G,R,!1)};return z.toString=()=>U,re.serviceIds.set(U,z),z}function j(U){return function(z,G,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,z,n,!0)}}},DlQD:function(ot,xe,Z){(function(re,$){ot.exports=$()})(this,function(){"use strict";function re(Ce,_e){for(var Te=0;Te<_e.length;Te++){var ae=_e[Te];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Ce,ae.key,ae)}}function $(Ce,_e,Te){return _e&&re(Ce.prototype,_e),Te&&re(Ce,Te),Ce}function P(Ce,_e){if(!Ce)return;if(typeof Ce=="string")return Y(Ce,_e);var Te=Object.prototype.toString.call(Ce).slice(8,-1);if(Te==="Object"&&Ce.constructor&&(Te=Ce.constructor.name),Te==="Map"||Te==="Set")return Array.from(Ce);if(Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te))return Y(Ce,_e)}function Y(Ce,_e){(_e==null||_e>Ce.length)&&(_e=Ce.length);for(var Te=0,ae=new Array(_e);Te<_e;Te++)ae[Te]=Ce[Te];return ae}function j(Ce,_e){var Te;if(typeof Symbol=="undefined"||Ce[Symbol.iterator]==null){if(Array.isArray(Ce)||(Te=P(Ce))||_e&&Ce&&typeof Ce.length=="number"){Te&&(Ce=Te);var ae=0;return function(){return ae>=Ce.length?{done:!0}:{done:!1,value:Ce[ae++]}}}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 Te=Ce[Symbol.iterator](),Te.next.bind(Te)}function U(Ce,_e){return _e={exports:{}},Ce(_e,_e.exports),_e.exports}var z=U(function(Ce){function _e(){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 Te(ae){Ce.exports.defaults=ae}Ce.exports={defaults:_e(),getDefaults:_e,changeDefaults:Te}}),G=z.defaults,n=z.getDefaults,R=z.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(_e){return l[_e]};function o(Ce,_e){if(_e){if(v.test(Ce))return Ce.replace(m,d)}else if(p.test(Ce))return Ce.replace(u,d);return Ce}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ce){return Ce.replace(h,function(_e,Te){return Te=Te.toLowerCase(),Te==="colon"?":":Te.charAt(0)==="#"?Te.charAt(1)==="x"?String.fromCharCode(parseInt(Te.substring(2),16)):String.fromCharCode(+Te.substring(1)):""})}var a=/(^|[^\[])\^/g;function A(Ce,_e){Ce=Ce.source||Ce,_e=_e||"";var Te={replace:function(le,fe){return fe=fe.source||fe,fe=fe.replace(a,"$1"),Ce=Ce.replace(le,fe),Te},getRegex:function(){return new RegExp(Ce,_e)}};return Te}var E=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ce,_e,Te){if(Ce){var ae;try{ae=decodeURIComponent(s(Te)).replace(E,"").toLowerCase()}catch(le){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}_e&&!T.test(Te)&&(Te=f(_e,Te));try{Te=encodeURI(Te).replace(/%25/g,"%")}catch(le){return null}return Te}var L={},w=/^[^:]+:\/*[^/]*$/,O=/^([^:]+:)[\s\S]*$/,S=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Ce,_e){L[" "+Ce]||(w.test(Ce)?L[" "+Ce]=Ce+"/":L[" "+Ce]=B(Ce,"/",!0)),Ce=L[" "+Ce];var Te=Ce.indexOf(":")===-1;return _e.substring(0,2)==="//"?Te?_e:Ce.replace(O,"$1")+_e:_e.charAt(0)==="/"?Te?_e:Ce.replace(S,"$1")+_e:Ce+_e}var C={exec:function(){}};function y(Ce){for(var _e=1,Te,ae;_e<arguments.length;_e++){Te=arguments[_e];for(ae in Te)Object.prototype.hasOwnProperty.call(Te,ae)&&(Ce[ae]=Te[ae])}return Ce}function b(Ce,_e){var Te=Ce.replace(/\|/g,function(fe,me,we){for(var Ue=!1,ze=me;--ze>=0&&we[ze]==="\\";)Ue=!Ue;return Ue?"|":" |"}),ae=Te.split(/ \|/),le=0;if(ae.length>_e)ae.splice(_e);else for(;ae.length<_e;)ae.push("");for(;le<ae.length;le++)ae[le]=ae[le].trim().replace(/\\\|/g,"|");return ae}function B(Ce,_e,Te){var ae=Ce.length;if(ae===0)return"";for(var le=0;le<ae;){var fe=Ce.charAt(ae-le-1);if(fe===_e&&!Te)le++;else if(fe!==_e&&Te)le++;else break}return Ce.substr(0,ae-le)}function F(Ce,_e){if(Ce.indexOf(_e[1])===-1)return-1;for(var Te=Ce.length,ae=0,le=0;le<Te;le++)if(Ce[le]==="\\")le++;else if(Ce[le]===_e[0])ae++;else if(Ce[le]===_e[1]&&(ae--,ae<0))return le;return-1}function x(Ce){Ce&&Ce.sanitize&&!Ce.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var N={escape:o,unescape:s,edit:A,cleanUrl:D,resolveUrl:f,noopTest:C,merge:y,splitCells:b,rtrim:B,findClosingBracket:F,checkSanitizeDeprecation:x},I=z.defaults,g=N.rtrim,W=N.splitCells,J=N.escape,ie=N.findClosingBracket;function ue(Ce,_e,Te){var ae=_e.href,le=_e.title?J(_e.title):null,fe=Ce[1].replace(/\\([\[\]])/g,"$1");return Ce[0].charAt(0)!=="!"?{type:"link",raw:Te,href:ae,title:le,text:fe}:{type:"image",raw:Te,href:ae,title:le,text:J(fe)}}function Re(Ce,_e){var Te=Ce.match(/^(\s+)(?:```)/);if(Te===null)return _e;var ae=Te[1];return _e.split(`
|
|
`).map(function(le){var fe=le.match(/^\s+/);if(fe===null)return le;var me=fe[0];return me.length>=ae.length?le.slice(ae.length):le}).join(`
|
|
`)}var ve=function(){function Ce(Te){this.options=Te||I}var _e=Ce.prototype;return _e.space=function(ae){var le=this.rules.block.newline.exec(ae);if(le)return le[0].length>1?{type:"space",raw:le[0]}:{raw:`
|
|
`}},_e.code=function(ae,le){var fe=this.rules.block.code.exec(ae);if(fe){var me=le[le.length-1];if(me&&me.type==="paragraph")return{raw:fe[0],text:fe[0].trimRight()};var we=fe[0].replace(/^ {4}/gm,"");return{type:"code",raw:fe[0],codeBlockStyle:"indented",text:this.options.pedantic?we:g(we,`
|
|
`)}}},_e.fences=function(ae){var le=this.rules.block.fences.exec(ae);if(le){var fe=le[0],me=Re(fe,le[3]||"");return{type:"code",raw:fe,lang:le[2]?le[2].trim():le[2],text:me}}},_e.heading=function(ae){var le=this.rules.block.heading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},_e.nptable=function(ae){var le=this.rules.block.nptable.exec(ae);if(le){var fe={type:"table",header:W(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
|
|
`):[],raw:le[0]};if(fe.header.length===fe.align.length){var me=fe.align.length,we;for(we=0;we<me;we++)/^ *-+: *$/.test(fe.align[we])?fe.align[we]="right":/^ *:-+: *$/.test(fe.align[we])?fe.align[we]="center":/^ *:-+ *$/.test(fe.align[we])?fe.align[we]="left":fe.align[we]=null;for(me=fe.cells.length,we=0;we<me;we++)fe.cells[we]=W(fe.cells[we],fe.header.length);return fe}}},_e.hr=function(ae){var le=this.rules.block.hr.exec(ae);if(le)return{type:"hr",raw:le[0]}},_e.blockquote=function(ae){var le=this.rules.block.blockquote.exec(ae);if(le){var fe=le[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:le[0],text:fe}}},_e.list=function(ae){var le=this.rules.block.list.exec(ae);if(le){for(var fe=le[0],me=le[2],we=me.length>1,Ue=me[me.length-1]===")",ze={type:"list",raw:fe,ordered:we,start:we?+me.slice(0,-1):"",loose:!1,items:[]},rt=le[0].match(this.rules.block.item),pt=!1,ct,At,St,dt,Ft,gt,Lt,Dt=rt.length,tt=0;tt<Dt;tt++)ct=rt[tt],fe=ct,At=ct.length,ct=ct.replace(/^ *([*+-]|\d+[.)]) */,""),~ct.indexOf(`
|
|
`)&&(At-=ct.length,ct=this.options.pedantic?ct.replace(/^ {1,4}/gm,""):ct.replace(new RegExp("^ {1,"+At+"}","gm"),"")),tt!==Dt-1&&(St=this.rules.block.bullet.exec(rt[tt+1])[0],(we?St.length===1||!Ue&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==me)&&(dt=rt.slice(tt+1).join(`
|
|
`),ze.raw=ze.raw.substring(0,ze.raw.length-dt.length),tt=Dt-1)),Ft=pt||/\n\n(?!\s*$)/.test(ct),tt!==Dt-1&&(pt=ct.charAt(ct.length-1)===`
|
|
`,Ft||(Ft=pt)),Ft&&(ze.loose=!0),gt=/^\[[ xX]\] /.test(ct),Lt=void 0,gt&&(Lt=ct[1]!==" ",ct=ct.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:fe,task:gt,checked:Lt,loose:Ft,text:ct});return ze}},_e.html=function(ae){var le=this.rules.block.html.exec(ae);if(le)return{type:this.options.sanitize?"paragraph":"html",raw:le[0],pre:!this.options.sanitizer&&(le[1]==="pre"||le[1]==="script"||le[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):J(le[0]):le[0]}},_e.def=function(ae){var le=this.rules.block.def.exec(ae);if(le){le[3]&&(le[3]=le[3].substring(1,le[3].length-1));var fe=le[1].toLowerCase().replace(/\s+/g," ");return{tag:fe,raw:le[0],href:le[2],title:le[3]}}},_e.table=function(ae){var le=this.rules.block.table.exec(ae);if(le){var fe={type:"table",header:W(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
|
|
`):[]};if(fe.header.length===fe.align.length){fe.raw=le[0];var me=fe.align.length,we;for(we=0;we<me;we++)/^ *-+: *$/.test(fe.align[we])?fe.align[we]="right":/^ *:-+: *$/.test(fe.align[we])?fe.align[we]="center":/^ *:-+ *$/.test(fe.align[we])?fe.align[we]="left":fe.align[we]=null;for(me=fe.cells.length,we=0;we<me;we++)fe.cells[we]=W(fe.cells[we].replace(/^ *\| *| *\| *$/g,""),fe.header.length);return fe}}},_e.lheading=function(ae){var le=this.rules.block.lheading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[2].charAt(0)==="="?1:2,text:le[1]}},_e.paragraph=function(ae){var le=this.rules.block.paragraph.exec(ae);if(le)return{type:"paragraph",raw:le[0],text:le[1].charAt(le[1].length-1)===`
|
|
`?le[1].slice(0,-1):le[1]}},_e.text=function(ae,le){var fe=this.rules.block.text.exec(ae);if(fe){var me=le[le.length-1];return me&&me.type==="text"?{raw:fe[0],text:fe[0]}:{type:"text",raw:fe[0],text:fe[0]}}},_e.escape=function(ae){var le=this.rules.inline.escape.exec(ae);if(le)return{type:"escape",raw:le[0],text:J(le[1])}},_e.tag=function(ae,le,fe){var me=this.rules.inline.tag.exec(ae);if(me)return!le&&/^<a /i.test(me[0])?le=!0:le&&/^<\/a>/i.test(me[0])&&(le=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:le,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):J(me[0]):me[0]}},_e.link=function(ae){var le=this.rules.inline.link.exec(ae);if(le){var fe=ie(le[2],"()");if(fe>-1){var me=le[0].indexOf("!")===0?5:4,we=me+le[1].length+fe;le[2]=le[2].substring(0,fe),le[0]=le[0].substring(0,we).trim(),le[3]=""}var Ue=le[2],ze="";if(this.options.pedantic){var rt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);rt?(Ue=rt[1],ze=rt[3]):ze=""}else ze=le[3]?le[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=ue(le,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},le[0]);return pt}},_e.reflink=function(ae,le){var fe;if((fe=this.rules.inline.reflink.exec(ae))||(fe=this.rules.inline.nolink.exec(ae))){var me=(fe[2]||fe[1]).replace(/\s+/g," ");if(me=le[me.toLowerCase()],!me||!me.href){var we=fe[0].charAt(0);return{type:"text",raw:we,text:we}}var Ue=ue(fe,me,fe[0]);return Ue}},_e.strong=function(ae,le,fe){fe===void 0&&(fe="");var me=this.rules.inline.strong.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){le=le.slice(-1*ae.length);var we=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;we.lastIndex=0;for(var Ue;(me=we.exec(le))!=null;)if(Ue=this.rules.inline.strong.middle.exec(le.slice(0,me.index+3)),Ue)return{type:"strong",raw:ae.slice(0,Ue[0].length),text:ae.slice(2,Ue[0].length-2)}}},_e.em=function(ae,le,fe){fe===void 0&&(fe="");var me=this.rules.inline.em.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){le=le.slice(-1*ae.length);var we=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;we.lastIndex=0;for(var Ue;(me=we.exec(le))!=null;)if(Ue=this.rules.inline.em.middle.exec(le.slice(0,me.index+2)),Ue)return{type:"em",raw:ae.slice(0,Ue[0].length),text:ae.slice(1,Ue[0].length-1)}}},_e.codespan=function(ae){var le=this.rules.inline.code.exec(ae);if(le){var fe=le[2].replace(/\n/g," "),me=/[^ ]/.test(fe),we=fe.startsWith(" ")&&fe.endsWith(" ");return me&&we&&(fe=fe.substring(1,fe.length-1)),fe=J(fe,!0),{type:"codespan",raw:le[0],text:fe}}},_e.br=function(ae){var le=this.rules.inline.br.exec(ae);if(le)return{type:"br",raw:le[0]}},_e.del=function(ae){var le=this.rules.inline.del.exec(ae);if(le)return{type:"del",raw:le[0],text:le[1]}},_e.autolink=function(ae,le){var fe=this.rules.inline.autolink.exec(ae);if(fe){var me,we;return fe[2]==="@"?(me=J(this.options.mangle?le(fe[1]):fe[1]),we="mailto:"+me):(me=J(fe[1]),we=me),{type:"link",raw:fe[0],text:me,href:we,tokens:[{type:"text",raw:me,text:me}]}}},_e.url=function(ae,le){var fe;if(fe=this.rules.inline.url.exec(ae)){var me,we;if(fe[2]==="@")me=J(this.options.mangle?le(fe[0]):fe[0]),we="mailto:"+me;else{var Ue;do Ue=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(Ue!==fe[0]);me=J(fe[0]),fe[1]==="www."?we="http://"+me:we=me}return{type:"link",raw:fe[0],text:me,href:we,tokens:[{type:"text",raw:me,text:me}]}}},_e.inlineText=function(ae,le,fe){var me=this.rules.inline.text.exec(ae);if(me){var we;return le?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):J(me[0]):me[0]:we=J(this.options.smartypants?fe(me[0]):me[0]),{type:"text",raw:me[0],text:we}}},Ce}(),Se=N.noopTest,Le=N.edit,be=N.merge,ce={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*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\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:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Le(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Le(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Le(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Le(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Le(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=Le(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=be({},ce),ce.gfm=be({},ce.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*|$)"}),ce.gfm.nptable=Le(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=Le(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=be({},ce.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:Se,paragraph:Le(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=Le(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Le(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Le(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Le(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Le(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Le(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Le(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Le(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Le(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Le(he._blockSkip,"g").getRegex(),he.overlapSkip=Le(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=Le(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Le(he.tag).replace("comment",ce._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Le(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Le(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Le(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=be({},he),he.pedantic=be({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=be({},he.normal,{escape:Le(he.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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),he.gfm.url=Le(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=be({},he.gfm,{br:Le(he.br).replace("{2,}","*").getRegex(),text:Le(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:ce,inline:he},de=z.defaults,se=ne.block,De=ne.inline;function Ne(Ce){return Ce.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Ae(Ce){var _e="",Te,ae,le=Ce.length;for(Te=0;Te<le;Te++)ae=Ce.charCodeAt(Te),Math.random()>.5&&(ae="x"+ae.toString(16)),_e+="&#"+ae+";";return _e}var Pe=function(){function Ce(Te){this.tokens=[],this.tokens.links=Object.create(null),this.options=Te||de,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:De.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=De.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=De.breaks:ae.inline=De.gfm),this.tokenizer.rules=ae}Ce.lex=function(ae,le){var fe=new Ce(le);return fe.lex(ae)};var _e=Ce.prototype;return _e.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ae,le,fe){le===void 0&&(le=[]),fe===void 0&&(fe=!0),ae=ae.replace(/^ +$/gm,"");for(var me,we,Ue,ze;ae;){if(me=this.tokenizer.space(ae)){ae=ae.substring(me.raw.length),me.type&&le.push(me);continue}if(me=this.tokenizer.code(ae,le)){ae=ae.substring(me.raw.length),me.type?le.push(me):(ze=le[le.length-1],ze.raw+=`
|
|
`+me.raw,ze.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.heading(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.nptable(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.hr(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.blockquote(ae)){ae=ae.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],fe),le.push(me);continue}if(me=this.tokenizer.list(ae)){for(ae=ae.substring(me.raw.length),Ue=me.items.length,we=0;we<Ue;we++)me.items[we].tokens=this.blockTokens(me.items[we].text,[],!1);le.push(me);continue}if(me=this.tokenizer.html(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(fe&&(me=this.tokenizer.def(ae))){ae=ae.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.lheading(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(fe&&(me=this.tokenizer.paragraph(ae))){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.text(ae,le)){ae=ae.substring(me.raw.length),me.type?le.push(me):(ze=le[le.length-1],ze.raw+=`
|
|
`+me.raw,ze.text+=`
|
|
`+me.text);continue}if(ae){var rt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return le},_e.inline=function(ae){var le,fe,me,we,Ue,ze,rt=ae.length;for(le=0;le<rt;le++){ze=ae[le];switch(ze.type){case"paragraph":case"text":case"heading":{ze.tokens=[],this.inlineTokens(ze.text,ze.tokens);break}case"table":{for(ze.tokens={header:[],cells:[]},we=ze.header.length,fe=0;fe<we;fe++)ze.tokens.header[fe]=[],this.inlineTokens(ze.header[fe],ze.tokens.header[fe]);for(we=ze.cells.length,fe=0;fe<we;fe++)for(Ue=ze.cells[fe],ze.tokens.cells[fe]=[],me=0;me<Ue.length;me++)ze.tokens.cells[fe][me]=[],this.inlineTokens(Ue[me],ze.tokens.cells[fe][me]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(we=ze.items.length,fe=0;fe<we;fe++)this.inline(ze.items[fe].tokens);break}}}return ae},_e.inlineTokens=function(ae,le,fe,me,we){le===void 0&&(le=[]),fe===void 0&&(fe=!1),me===void 0&&(me=!1),we===void 0&&(we="");var Ue,ze=ae,rt;if(this.tokens.links){var pt=Object.keys(this.tokens.links);if(pt.length>0)for(;(rt=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)pt.includes(rt[0].slice(rt[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rt=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ue=this.tokenizer.escape(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.tag(ae,fe,me)){ae=ae.substring(Ue.raw.length),fe=Ue.inLink,me=Ue.inRawBlock,le.push(Ue);continue}if(Ue=this.tokenizer.link(ae)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),le.push(Ue);continue}if(Ue=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),le.push(Ue);continue}if(Ue=this.tokenizer.strong(ae,ze,we)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.em(ae,ze,we)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.codespan(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.br(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.del(ae)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.autolink(ae,Ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(!fe&&(Ue=this.tokenizer.url(ae,Ae))){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.inlineText(ae,me,Ne)){ae=ae.substring(Ue.raw.length),we=Ue.raw.slice(-1),le.push(Ue);continue}if(ae){var ct="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ct);break}else throw new Error(ct)}}return le},$(Ce,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ce}(),Be=z.defaults,oe=N.cleanUrl,ge=N.escape,Oe=function(){function Ce(Te){this.options=Te||Be}var _e=Ce.prototype;return _e.code=function(ae,le,fe){var me=(le||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(ae,me);we!=null&&we!==ae&&(fe=!0,ae=we)}return me?'<pre><code class="'+this.options.langPrefix+ge(me,!0)+'">'+(fe?ae:ge(ae,!0))+`</code></pre>
|
|
`:"<pre><code>"+(fe?ae:ge(ae,!0))+`</code></pre>
|
|
`},_e.blockquote=function(ae){return`<blockquote>
|
|
`+ae+`</blockquote>
|
|
`},_e.html=function(ae){return ae},_e.heading=function(ae,le,fe,me){return this.options.headerIds?"<h"+le+' id="'+this.options.headerPrefix+me.slug(fe)+'">'+ae+"</h"+le+`>
|
|
`:"<h"+le+">"+ae+"</h"+le+`>
|
|
`},_e.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},_e.list=function(ae,le,fe){var me=le?"ol":"ul",we=le&&fe!==1?' start="'+fe+'"':"";return"<"+me+we+`>
|
|
`+ae+"</"+me+`>
|
|
`},_e.listitem=function(ae){return"<li>"+ae+`</li>
|
|
`},_e.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},_e.paragraph=function(ae){return"<p>"+ae+`</p>
|
|
`},_e.table=function(ae,le){return le&&(le="<tbody>"+le+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ae+`</thead>
|
|
`+le+`</table>
|
|
`},_e.tablerow=function(ae){return`<tr>
|
|
`+ae+`</tr>
|
|
`},_e.tablecell=function(ae,le){var fe=le.header?"th":"td",me=le.align?"<"+fe+' align="'+le.align+'">':"<"+fe+">";return me+ae+"</"+fe+`>
|
|
`},_e.strong=function(ae){return"<strong>"+ae+"</strong>"},_e.em=function(ae){return"<em>"+ae+"</em>"},_e.codespan=function(ae){return"<code>"+ae+"</code>"},_e.br=function(){return this.options.xhtml?"<br/>":"<br>"},_e.del=function(ae){return"<del>"+ae+"</del>"},_e.link=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='<a href="'+ge(ae)+'"';return le&&(me+=' title="'+le+'"'),me+=">"+fe+"</a>",me},_e.image=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='<img src="'+ae+'" alt="'+fe+'"';return le&&(me+=' title="'+le+'"'),me+=this.options.xhtml?"/>":">",me},_e.text=function(ae){return ae},Ce}(),Ie=function(){function Ce(){}var _e=Ce.prototype;return _e.strong=function(ae){return ae},_e.em=function(ae){return ae},_e.codespan=function(ae){return ae},_e.del=function(ae){return ae},_e.html=function(ae){return ae},_e.text=function(ae){return ae},_e.link=function(ae,le,fe){return""+fe},_e.image=function(ae,le,fe){return""+fe},_e.br=function(){return""},Ce}(),He=function(){function Ce(){this.seen={}}var _e=Ce.prototype;return _e.slug=function(ae){var le=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(le)){var fe=le;do this.seen[fe]++,le=fe+"-"+this.seen[fe];while(this.seen.hasOwnProperty(le))}return this.seen[le]=0,le},Ce}(),Xe=z.defaults,qe=N.unescape,Ze=function(){function Ce(Te){this.options=Te||Xe,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new He}Ce.parse=function(ae,le){var fe=new Ce(le);return fe.parse(ae)};var _e=Ce.prototype;return _e.parse=function(ae,le){le===void 0&&(le=!0);var fe="",me,we,Ue,ze,rt,pt,ct,At,St,dt,Ft,gt,Lt,Dt,tt,fn,En,bt,Vt=ae.length;for(me=0;me<Vt;me++){dt=ae[me];switch(dt.type){case"space":continue;case"hr":{fe+=this.renderer.hr();continue}case"heading":{fe+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,qe(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{fe+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(At="",ct="",ze=dt.header.length,we=0;we<ze;we++)ct+=this.renderer.tablecell(this.parseInline(dt.tokens.header[we]),{header:!0,align:dt.align[we]});for(At+=this.renderer.tablerow(ct),St="",ze=dt.cells.length,we=0;we<ze;we++){for(pt=dt.tokens.cells[we],ct="",rt=pt.length,Ue=0;Ue<rt;Ue++)ct+=this.renderer.tablecell(this.parseInline(pt[Ue]),{header:!1,align:dt.align[Ue]});St+=this.renderer.tablerow(ct)}fe+=this.renderer.table(At,St);continue}case"blockquote":{St=this.parse(dt.tokens),fe+=this.renderer.blockquote(St);continue}case"list":{for(Ft=dt.ordered,gt=dt.start,Lt=dt.loose,ze=dt.items.length,St="",we=0;we<ze;we++)tt=dt.items[we],fn=tt.checked,En=tt.task,Dt="",tt.task&&(bt=this.renderer.checkbox(fn),Lt?tt.tokens.length>0&&tt.tokens[0].type==="text"?(tt.tokens[0].text=bt+" "+tt.tokens[0].text,tt.tokens[0].tokens&&tt.tokens[0].tokens.length>0&&tt.tokens[0].tokens[0].type==="text"&&(tt.tokens[0].tokens[0].text=bt+" "+tt.tokens[0].tokens[0].text)):tt.tokens.unshift({type:"text",text:bt}):Dt+=bt),Dt+=this.parse(tt.tokens,Lt),St+=this.renderer.listitem(Dt,En,fn);fe+=this.renderer.list(St,Ft,gt);continue}case"html":{fe+=this.renderer.html(dt.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;me+1<Vt&&ae[me+1].type==="text";)dt=ae[++me],St+=`
|
|
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);fe+=le?this.renderer.paragraph(St):St;continue}default:{var _t='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(_t);return}else throw new Error(_t)}}}return fe},_e.parseInline=function(ae,le){le=le||this.renderer;var fe="",me,we,Ue=ae.length;for(me=0;me<Ue;me++){we=ae[me];switch(we.type){case"escape":{fe+=le.text(we.text);break}case"html":{fe+=le.html(we.text);break}case"link":{fe+=le.link(we.href,we.title,this.parseInline(we.tokens,le));break}case"image":{fe+=le.image(we.href,we.title,we.text);break}case"strong":{fe+=le.strong(this.parseInline(we.tokens,le));break}case"em":{fe+=le.em(this.parseInline(we.tokens,le));break}case"codespan":{fe+=le.codespan(we.text);break}case"br":{fe+=le.br();break}case"del":{fe+=le.del(this.parseInline(we.tokens,le));break}case"text":{fe+=le.text(we.text);break}default:{var ze='Token with "'+we.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return fe},Ce}(),nt=N.merge,$e=N.checkSanitizeDeprecation,Qe=N.escape,Fe=z.getDefaults,ut=z.changeDefaults,lt=z.defaults;function je(Ce,_e,Te){if(typeof Ce=="undefined"||Ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");if(typeof _e=="function"&&(Te=_e,_e=null),_e=nt({},je.defaults,_e||{}),$e(_e),Te){var ae=_e.highlight,le;try{le=Pe.lex(Ce,_e)}catch(Ue){return Te(Ue)}var fe=function(ze){var rt;if(!ze)try{rt=Ze.parse(le,_e)}catch(pt){ze=pt}return _e.highlight=ae,ze?Te(ze):Te(null,rt)};if(!ae||ae.length<3)return fe();if(delete _e.highlight,!le.length)return fe();var me=0;je.walkTokens(le,function(Ue){Ue.type==="code"&&(me++,setTimeout(function(){ae(Ue.text,Ue.lang,function(ze,rt){if(ze)return fe(ze);rt!=null&&rt!==Ue.text&&(Ue.text=rt,Ue.escaped=!0),me--,me===0&&fe()})},0))}),me===0&&fe();return}try{var we=Pe.lex(Ce,_e);return _e.walkTokens&&je.walkTokens(we,_e.walkTokens),Ze.parse(we,_e)}catch(Ue){if(Ue.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,_e.silent)return"<p>An error occurred:</p><pre>"+Qe(Ue.message+"",!0)+"</pre>";throw Ue}}je.options=je.setOptions=function(Ce){return nt(je.defaults,Ce),ut(je.defaults),je},je.getDefaults=Fe,je.defaults=lt,je.use=function(Ce){var _e=nt({},Ce);if(Ce.renderer&&function(){var ae=je.defaults.renderer||new Oe,le=function(we){var Ue=ae[we];ae[we]=function(){for(var ze=arguments.length,rt=new Array(ze),pt=0;pt<ze;pt++)rt[pt]=arguments[pt];var ct=Ce.renderer[we].apply(ae,rt);return ct===!1&&(ct=Ue.apply(ae,rt)),ct}};for(var fe in Ce.renderer)le(fe);_e.renderer=ae}(),Ce.tokenizer&&function(){var ae=je.defaults.tokenizer||new ve,le=function(we){var Ue=ae[we];ae[we]=function(){for(var ze=arguments.length,rt=new Array(ze),pt=0;pt<ze;pt++)rt[pt]=arguments[pt];var ct=Ce.tokenizer[we].apply(ae,rt);return ct===!1&&(ct=Ue.apply(ae,rt)),ct}};for(var fe in Ce.tokenizer)le(fe);_e.tokenizer=ae}(),Ce.walkTokens){var Te=je.defaults.walkTokens;_e.walkTokens=function(ae){Ce.walkTokens(ae),Te&&Te(ae)}}je.setOptions(_e)},je.walkTokens=function(Ce,_e){for(var Te=j(Ce),ae;!(ae=Te()).done;){var le=ae.value;_e(le);switch(le.type){case"table":{for(var fe=j(le.tokens.header),me;!(me=fe()).done;){var we=me.value;je.walkTokens(we,_e)}for(var Ue=j(le.tokens.cells),ze;!(ze=Ue()).done;)for(var rt=ze.value,pt=j(rt),ct;!(ct=pt()).done;){var At=ct.value;je.walkTokens(At,_e)}break}case"list":{je.walkTokens(le.items,_e);break}default:le.tokens&&je.walkTokens(le.tokens,_e)}}},je.Parser=Ze,je.parser=Ze.parse,je.Renderer=Oe,je.TextRenderer=Ie,je.Lexer=Pe,je.lexer=Pe.lex,je.Tokenizer=ve,je.Slugger=He,je.parse=je;var We=je;return We})},ELLl:function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=re.Pos;re.defineOption("autoCloseBrackets",!1,function(l,d,o){o&&o!=re.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),d&&(U(Y(d,"pairs")),l.state.closeBrackets=d,l.addKeyMap(j))});function Y(l,d){return d=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[d]!=null?l[d]:$[d]}var j={Backspace:n,Enter:R};function U(l){for(var d=0;d<l.length;d++){var o=l.charAt(d),h="'"+o+"'";j[h]||(j[h]=z(o))}}U($.pairs+"`");function z(l){return function(d){return m(d,l)}}function G(l){var d=l.state.closeBrackets;if(!d||d.override)return d;var o=l.getModeAt(l.getCursor());return o.closeBrackets||d}function n(l){var d=G(l);if(!d||l.getOption("disableInput"))return re.Pass;for(var o=Y(d,"pairs"),h=l.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return re.Pass;var a=p(l,h[s].head);if(!a||o.indexOf(a)%2!=0)return re.Pass}for(var s=h.length-1;s>=0;s--){var A=h[s].head;l.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function R(l){var d=G(l),o=d&&Y(d,"explode");if(!o||l.getOption("disableInput"))return re.Pass;for(var h=l.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return re.Pass;var a=p(l,h[s].head);if(!a||o.indexOf(a)%2!=0)return re.Pass}l.operation(function(){var A=l.lineSeparator()||`
|
|
`;l.replaceSelection(A+A,null),l.execCommand("goCharLeft"),h=l.listSelections();for(var E=0;E<h.length;E++){var T=h[E].head.line;l.indentLine(T,null,!0),l.indentLine(T+1,null,!0)}})}function v(l){var d=re.cmpPos(l.anchor,l.head)>0;return{anchor:new P(l.anchor.line,l.anchor.ch+(d?-1:1)),head:new P(l.head.line,l.head.ch+(d?1:-1))}}function m(l,d){var o=G(l);if(!o||l.getOption("disableInput"))return re.Pass;var h=Y(o,"pairs"),s=h.indexOf(d);if(s==-1)return re.Pass;for(var a=Y(o,"closeBefore"),A=Y(o,"triples"),E=h.charAt(s+1)==d,T=l.listSelections(),D=s%2==0,L,w=0;w<T.length;w++){var O=T[w],S=O.head,f,C=l.getRange(S,P(S.line,S.ch+1));if(D&&!O.empty())f="surround";else if((E||!D)&&C==d)E&&u(l,S)?f="both":A.indexOf(d)>=0&&l.getRange(S,P(S.line,S.ch+3))==d+d+d?f="skipThree":f="skip";else if(E&&S.ch>1&&A.indexOf(d)>=0&&l.getRange(P(S.line,S.ch-2),S)==d+d){if(S.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(S.line,S.ch-2))))return re.Pass;f="addFour"}else if(E){var y=S.ch==0?" ":l.getRange(P(S.line,S.ch-1),S);if(!re.isWordChar(C)&&y!=d&&!re.isWordChar(y))f="both";else return re.Pass}else if(D&&(C.length===0||/\s/.test(C)||a.indexOf(C)>-1))f="both";else return re.Pass;if(!L)L=f;else if(L!=f)return re.Pass}var b=s%2?h.charAt(s-1):d,B=s%2?d:h.charAt(s+1);l.operation(function(){if(L=="skip")l.execCommand("goCharRight");else if(L=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(L=="surround"){for(var x=l.getSelections(),F=0;F<x.length;F++)x[F]=b+x[F]+B;l.replaceSelections(x,"around"),x=l.listSelections().slice();for(var F=0;F<x.length;F++)x[F]=v(x[F]);l.setSelections(x)}else L=="both"?(l.replaceSelection(b+B,null),l.triggerElectric(b+B),l.execCommand("goCharLeft")):L=="addFour"&&(l.replaceSelection(b+b+b+b,"before"),l.execCommand("goCharRight"))})}function p(l,d){var o=l.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return o.length==2?o:null}function u(l,d){var o=l.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(o.type)&&o.start==d.ch&&(d.ch==0||!/\bstring/.test(l.getTokenTypeAt(d)))}})},FWmy:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return re});function re($,P){if(!$)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(ot,xe,Z){"use strict";var re=Z("q1tI"),$=Z.n(re),P=Z("TSYQ"),Y=Z.n(P);function j(N,I){var g="cannot "+N.method+" "+N.action+" "+I.status+"'",W=new Error(g);return W.status=I.status,W.method=N.method,W.url=N.action,W}function U(N){var I=N.responseText||N.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function z(N){var I=new XMLHttpRequest;N.onProgress&&I.upload&&(I.upload.onprogress=function(ie){ie.total>0&&(ie.percent=ie.loaded/ie.total*100),N.onProgress(ie)});var g=new FormData;N.data&&Object.keys(N.data).forEach(function(J){var ie=N.data[J];if(Array.isArray(ie)){ie.forEach(function(ue){g.append(J+"[]",ue)});return}g.append(J,N.data[J])}),N.file instanceof Blob?g.append(N.filename,N.file,N.file.name):g.append(N.filename,N.file),I.onerror=function(ie){N.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?N.onError(j(N,I),U(I)):N.onSuccess(U(I),I)},I.open(N.method,N.action,!0),N.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=N.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(J){W[J]!==null&&I.setRequestHeader(J,W[J])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,n=0;function R(){return"rc-upload-"+G+"-"+ ++n}function v(N,I){return N.indexOf(I,N.length-I.length)!==-1}var m=function(N,I){if(N&&I){var g=Array.isArray(I)?I:I.split(","),W=N.name||"",J=N.type||"",ie=J.replace(/\/.*$/,"");return g.some(function(ue){var Re=ue.trim();return Re.charAt(0)==="."?v(W.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?ie===Re.replace(/\/.*$/,""):J===Re})}return!0};function p(N,I){var g=N.createReader(),W=[];function J(){g.readEntries(function(ie){var ue=Array.prototype.slice.apply(ie);W=W.concat(ue);var Re=!ue.length;Re?I(W):J()})}J()}var u=function(I,g,W){var J=function ie(ue,Re){Re=Re||"",ue.isFile?ue.file(function(ve){W(ve)&&(ue.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),g([ve]))}):ue.isDirectory&&p(ue,function(ve){ve.forEach(function(Se){ie(Se,""+Re+ue.name+"/")})})};I.forEach(function(ie){J(ie.webkitGetAsEntry())})},l=u,d=Object.assign||function(N){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(N[W]=g[W])}return N},o=function(){function N(I,g){var W=[],J=!0,ie=!1,ue=void 0;try{for(var Re=I[Symbol.iterator](),ve;!(J=(ve=Re.next()).done)&&!(W.push(ve.value),g&&W.length===g);J=!0);}catch(Se){ie=!0,ue=Se}finally{try{!J&&Re.return&&Re.return()}finally{if(ie)throw ue}}return W}return function(I,g){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return N(I,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function N(I,g){for(var W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(I,J.key,J)}}return function(I,g,W){return g&&N(I.prototype,g),W&&N(I,W),I}}();function s(N,I,g){return I in N?Object.defineProperty(N,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):N[I]=g,N}function a(N,I){var g={};for(var W in N){if(I.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(N,W))continue;g[W]=N[W]}return g}function A(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function E(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function T(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(g[W]=I[W]),g},{})},L=function(N){T(I,N);function I(){var g,W,J,ie;A(this,I);for(var ue=arguments.length,Re=Array(ue),ve=0;ve<ue;ve++)Re[ve]=arguments[ve];return ie=(W=(J=E(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Re))),J),J.state={uid:R()},J.reqs={},J.onChange=function(Se){var Le=Se.target.files;J.uploadFiles(Le),J.reset()},J.onClick=function(Se){var Le=J.fileInput;if(!Le)return;var be=J.props,ce=be.children,he=be.onClick;ce&&ce.type==="button"&&(Le.parentNode.focus(),Le.parentNode.querySelector("button").blur()),Le.click(),he&&he(Se)},J.onKeyDown=function(Se){Se.key==="Enter"&&J.onClick()},J.onFileDrop=function(Se){var Le=J.props.multiple;if(Se.preventDefault(),Se.type==="dragover")return;if(J.props.directory)l(Array.prototype.slice.call(Se.dataTransfer.items),J.uploadFiles,function(ce){return m(ce,J.props.accept)});else{var be=Array.prototype.slice.call(Se.dataTransfer.files).filter(function(ce){return m(ce,J.props.accept)});Le===!1&&(be=be.slice(0,1)),J.uploadFiles(be)}},J.uploadFiles=function(Se){var Le=Array.prototype.slice.call(Se);Le.map(function(be){return be.uid=R(),be}).forEach(function(be){J.upload(be,Le)})},J.saveFileInput=function(Se){J.fileInput=Se},W),E(J,ie)}return h(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,J){var ie=this,ue=this.props;if(!ue.beforeUpload)return setTimeout(function(){return ie.post(W)},0);var Re=ue.beforeUpload(W,J);Re&&Re.then?Re.then(function(ve){var Se=Object.prototype.toString.call(ve);return Se==="[object File]"||Se==="[object Blob]"?ie.post(ve):ie.post(W)}).catch(function(ve){console.log(ve)}):Re!==!1&&setTimeout(function(){return ie.post(W)},0);return}},{key:"post",value:function(W){var J=this;if(!this._isMounted)return;var ie=this.props,ue=ie.onStart,Re=ie.onProgress,ve=ie.transformFile,Se=ve===void 0?function(Le){return Le}:ve;new Promise(function(Le){var be=ie.action;return typeof be=="function"&&(be=be(W)),Le(be)}).then(function(Le){var be=W.uid,ce=ie.customRequest||z,he=Promise.resolve(Se(W)).then(function(ne){var de=ie.data;return typeof de=="function"&&(de=de(ne)),Promise.all([ne,de])}).catch(function(ne){console.error(ne)});he.then(function(ne){var de=o(ne,2),se=de[0],De=de[1],Ne={action:Le,filename:ie.name,data:De,file:se,headers:ie.headers,withCredentials:ie.withCredentials,method:ie.method||"post",onProgress:Re?function(Ae){Re(Ae,W)}:null,onSuccess:function(Pe,Be){delete J.reqs[be],ie.onSuccess(Pe,W,Be)},onError:function(Pe,Be){delete J.reqs[be],ie.onError(Pe,Be,W)}};ue(W),J.reqs[be]=ce(Ne)})})}},{key:"reset",value:function(){this.setState({uid:R()})}},{key:"abort",value:function(W){var J=this.reqs;if(W){var ie=W;W&&W.uid&&(ie=W.uid),J[ie]&&J[ie].abort&&J[ie].abort(),delete J[ie]}else Object.keys(J).forEach(function(ue){J[ue]&&J[ue].abort&&J[ue].abort(),delete J[ue]})}},{key:"render",value:function(){var W,J=this.props,ie=J.component,ue=J.prefixCls,Re=J.className,ve=J.disabled,Se=J.id,Le=J.style,be=J.multiple,ce=J.accept,he=J.children,ne=J.directory,de=J.openFileDialogOnClick,se=J.onMouseEnter,De=J.onMouseLeave,Ne=a(J,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ae=Y()((W={},s(W,ue,!0),s(W,ue+"-disabled",ve),s(W,Re,Re),W)),Pe=ve?{}:{onClick:de?this.onClick:function(){},onKeyDown:de?this.onKeyDown:function(){},onMouseEnter:se,onMouseLeave:De,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return $.a.createElement(ie,d({},Pe,{className:Ae,role:"button",style:Le}),$.a.createElement("input",d({},D(Ne),{id:Se,type:"file",ref:this.saveFileInput,onClick:function(oe){return oe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ce,directory:ne?"directory":null,webkitdirectory:ne?"webkitdirectory":null,multiple:be,onChange:this.onChange})),he)}}]),I}(re.Component),w=L,O=Object.assign||function(N){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(N[W]=g[W])}return N},S=function(){function N(I,g){for(var W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(I,J.key,J)}}return function(I,g,W){return g&&N(I.prototype,g),W&&N(I,W),I}}();function f(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function C(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function y(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}function b(){}var B=function(N){y(I,N);function I(){var g,W,J,ie;f(this,I);for(var ue=arguments.length,Re=Array(ue),ve=0;ve<ue;ve++)Re[ve]=arguments[ve];return ie=(W=(J=C(this,(g=I.__proto__||Object.getPrototypeOf(I)).call.apply(g,[this].concat(Re))),J),J.saveUploader=function(Se){J.uploader=Se},W),C(J,ie)}return S(I,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return $.a.createElement(w,O({},this.props,{ref:this.saveUploader}))}}]),I}(re.Component);B.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=B,x=xe.a=F},HmJG:function(ot,xe,Z){},JYp7:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return re});var re;(function($){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}$.is=P;const Y=Object.freeze([]);function j(){return Y}$.empty=j;function*U(a){yield a}$.single=U;function z(a){return a||Y}$.from=z;function G(a){return!a||a[Symbol.iterator]().next().done===!0}$.isEmpty=G;function n(a){return a[Symbol.iterator]().next().value}$.first=n;function R(a,A){for(const E of a)if(A(E))return!0;return!1}$.some=R;function v(a,A){for(const E of a)if(A(E))return E;return}$.find=v;function*m(a,A){for(const E of a)A(E)&&(yield E)}$.filter=m;function*p(a,A){let E=0;for(const T of a)yield A(T,E++)}$.map=p;function*u(...a){for(const A of a)for(const E of A)yield E}$.concat=u;function*l(a){for(const A of a)for(const E of A)yield E}$.concatNested=l;function d(a,A,E){let T=E;for(const D of a)T=A(T,D);return T}$.reduce=d;function*o(a,A,E=a.length){for(A<0&&(A+=a.length),E<0?E+=a.length:E>a.length&&(E=a.length);A<E;A++)yield a[A]}$.slice=o;function h(a,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,a];const T=a[Symbol.iterator]();for(let D=0;D<A;D++){const L=T.next();if(L.done)return[E,$.empty()];E.push(L.value)}return[E,{[Symbol.iterator](){return T}}]}$.consume=h;function s(a,A,E=(T,D)=>T===D){const T=a[Symbol.iterator](),D=A[Symbol.iterator]();for(;;){const L=T.next(),w=D.next();if(L.done!==w.done)return!1;if(L.done)return!0;if(!E(L.value,w.value))return!1}}$.equals=s})(re||(re={}))},LdHM:function(ot,xe,Z){"use strict";Z.d(xe,"b",function(){return a}),Z.d(xe,"a",function(){return E});var re=Z("1OyB"),$=Z("vuIU"),P=Z("Ji7U"),Y=Z("LK+K"),j=Z("q1tI"),U=Z("rePB"),z=Z("Ff2n"),G=Z("ODXe"),n=Z("4IlW"),R=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),u=Z("+nKL"),l=Z("8OUc"),d=function(W,J){var ie=W.prefixCls,ue=W.id,Re=W.flattenOptions,ve=W.childrenAsData,Se=W.values,Le=W.searchValue,be=W.multiple,ce=W.defaultActiveFirstOption,he=W.height,ne=W.itemHeight,de=W.notFoundContent,se=W.open,De=W.menuItemSelectedIcon,Ne=W.virtual,Ae=W.onSelect,Pe=W.onToggleOpen,Be=W.onActiveValue,oe=W.onScroll,ge=W.onMouseEnter,Oe="".concat(ie,"-item"),Ie=Object(v.a)(function(){return Re},[se,Re],function(We,Ce){return Ce[0]&&We[1]!==Ce[1]}),He=j.useRef(null),Xe=function(Ce){Ce.preventDefault()},qe=function(Ce){He.current&&He.current.scrollTo({index:Ce})},Ze=function(Ce){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=Ie.length,ae=0;ae<Te;ae+=1){var le=(Ce+ae*_e+Te)%Te,fe=Ie[le],me=fe.group,we=fe.data;if(!me&&!we.disabled)return le}return-1},nt=j.useState(function(){return Ze(0)}),$e=Object(G.a)(nt,2),Qe=$e[0],Fe=$e[1],ut=function(Ce){Fe(Ce);var _e=Ie[Ce];if(!_e){Be(null,-1);return}Be(_e.data.value,Ce)};j.useEffect(function(){ut(ce!==!1?Ze(0):-1)},[Ie.length,Le]),j.useEffect(function(){var We=setTimeout(function(){if(!be&&se&&Se.size===1){var Ce=Array.from(Se)[0],_e=Ie.findIndex(function(Te){var ae=Te.data;return ae.value===Ce});ut(_e),qe(_e)}});return function(){return clearTimeout(We)}},[se]);var lt=function(Ce){Ce!==void 0&&Ae(Ce,{selected:!Se.has(Ce)}),be||Pe(!1)};if(j.useImperativeHandle(J,function(){return{onKeyDown:function(Ce){var _e=Ce.which;switch(_e){case n.a.UP:case n.a.DOWN:{var Te=0;if(_e===n.a.UP?Te=-1:_e===n.a.DOWN&&(Te=1),Te!==0){var ae=Ze(Qe+Te,Te);qe(ae),ut(ae)}break}case n.a.ENTER:{var le=Ie[Qe];le&&!le.data.disabled?lt(le.data.value):lt(void 0),se&&Ce.preventDefault();break}case n.a.ESC:Pe(!1)}},onKeyUp:function(){},scrollTo:function(Ce){qe(Ce)}}}),Ie.length===0)return j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(Oe,"-empty"),onMouseDown:Xe},de);function je(We){var Ce=Ie[We];if(!Ce)return null;var _e=Ce.data||{},Te=_e.value,ae=_e.label,le=_e.children,fe=Object(R.a)(_e,!0),me=ve?le:ae;return Ce?j.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},fe,{key:We,role:"option",id:"".concat(ue,"_list_").concat(We),"aria-selected":Se.has(Te)}),Te):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(Qe-1),je(Qe),je(Qe+1)),j.createElement(u.a,{itemKey:"key",ref:He,data:Ie,height:he,itemHeight:ne,fullHeight:!1,onMouseDown:Xe,onScroll:oe,virtual:Ne,onMouseEnter:ge},function(We,Ce){var _e,Te=We.group,ae=We.groupOption,le=We.data,fe=le.label,me=le.key;if(Te)return j.createElement("div",{className:p()(Oe,"".concat(Oe,"-group"))},fe!==void 0?fe:me);var we=le.disabled,Ue=le.value,ze=le.title,rt=le.children,pt=le.style,ct=le.className,At=Object(z.a)(le,["disabled","value","title","children","style","className"]),St=Se.has(Ue),dt="".concat(Oe,"-option"),Ft=p()(Oe,dt,ct,(_e={},Object(U.a)(_e,"".concat(dt,"-grouped"),ae),Object(U.a)(_e,"".concat(dt,"-active"),Qe===Ce&&!we),Object(U.a)(_e,"".concat(dt,"-disabled"),we),Object(U.a)(_e,"".concat(dt,"-selected"),St),_e)),gt=ve?rt:fe,Lt=!De||typeof De=="function"||St;return j.createElement("div",Object.assign({},At,{"aria-selected":St,className:Ft,title:ze,onMouseMove:function(){if(Qe===Ce||we)return;ut(Ce)},onClick:function(){we||lt(Ue)},style:pt}),j.createElement("div",{className:"".concat(dt,"-content")},gt||Ue),j.isValidElement(De)||St,Lt&&j.createElement(l.a,{className:"".concat(Oe,"-option-state"),customizeIcon:De,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=j.forwardRef(d);o.displayName="OptionList";var h=o,s=function(){return null};s.isSelectOption=!0;var a=s,A=function(){return null};A.isSelectOptGroup=!0;var E=A,T=Z("VTBJ"),D=Z("Zm9Q");function L(g){var W=g.key,J=g.props,ie=J.children,ue=J.value,Re=Object(z.a)(J,["children","value"]);return Object(T.a)({key:W,value:ue!==void 0?ue:W,children:ie},Re)}function w(g){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function(J,ie){if(!j.isValidElement(J)||!J.type)return null;var ue=J.type.isSelectOptGroup,Re=J.key,ve=J.props,Se=ve.children,Le=Object(z.a)(ve,["children"]);return W||!ue?L(J):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ie:Re,"__"),label:Re},Le),{},{options:w(Se)})}).filter(function(J){return J})}var O=Z("2Qr1"),S=Z("qNPg"),f=Z("U8pU"),C=Z("Kwbf"),y=Z("WKfj");function b(g){var W=g.mode,J=g.options,ie=g.children,ue=g.backfill,Re=g.allowClear,ve=g.placeholder,Se=g.getInputElement,Le=g.showSearch,be=g.onSearch,ce=g.defaultOpen,he=g.autoFocus,ne=g.labelInValue,de=g.value,se=g.inputValue,De=g.optionLabelProp,Ne=W==="multiple"||W==="tags",Ae=Le!==void 0?Le:Ne||W==="combobox",Pe=J||w(ie);if(Object(C.a)(W!=="tags"||Pe.every(function(Oe){return!Oe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Be=Pe.some(function(Oe){return Oe.options?Oe.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Oe?Oe.value:Oe.key)=="number"});Object(C.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(W!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(W==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(C.a)(W==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(C.b)(W!=="combobox"||!Se||!Re||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),be&&!Ae&&W!=="combobox"&&W!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!ce||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var oe=Object(y.d)(de);Object(C.a)(!ne||oe.every(function(Oe){return Object(f.a)(Oe)==="object"&&("key"in Oe||"value"in Oe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!Ne||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var ge=null;Object(D.a)(ie).some(function(Oe){if(!j.isValidElement(Oe)||!Oe.type)return!1;var Ie=Oe.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var He=Object(D.a)(Oe.props.children).every(function(Xe){return!j.isValidElement(Xe)||!Oe.type||Xe.type.isSelectOption?!0:(ge=Xe.type,!1)});return!He}return ge=Ie,!0}),ge&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(C.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=b,F=Object(S.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:w,flattenOptions:O.d,getLabeledValue:O.e,filterOptions:O.b,isValueDisabled:O.g,findValueOption:O.c,warningProps:B,fillOptionsWithMissingValue:O.a}),x=function(g){Object(P.a)(J,g);var W=Object(Y.a)(J);function J(){var ie;return Object(re.a)(this,J),ie=W.apply(this,arguments),ie.selectRef=j.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object($.a)(J,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),J}(j.Component);x.Option=a,x.OptGroup=E;var N=x,I=xe.c=N},M8RZ:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return n});var re=Z("fWQN"),$=Z("mtLc"),P=Z("yKVA"),Y=Z("879j"),j=Z("q1tI"),U=Z.n(j),z=Z("i8i4"),G=Z.n(z),n=function(R){Object(P.a)(m,R);var v=Object(Y.a)(m);function m(p){var u;Object(re.a)(this,m),u=v.call(this,p);var l=window.document;return u.node=l.createElement("div"),l.body.appendChild(u.node),u}return Object($.a)(m,[{key:"render",value:function(){var u=this.props.children;return Object(z.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(ot,xe,Z){"use strict";Z.d(xe,"c",function(){return j}),Z.d(xe,"b",function(){return n}),Z.d(xe,"e",function(){return R}),Z.d(xe,"a",function(){return v}),Z.d(xe,"d",function(){return m}),Z.d(xe,"f",function(){return p});var re=Z("/cxE"),$=Z("pmY6"),P=Z("24hK"),Y=Z("5Y4S"),j;(function(u){u.None=()=>$.a.None;function l(b){return(B,F=null,x)=>{let N=!1,I;return I=b(g=>N?void 0:(I?I.dispose():N=!0,B.call(F,g)),null,x),N&&I.dispose(),I}}u.once=l;function d(b,B){return E((F,x=null,N)=>b(I=>F.call(x,B(I)),null,N))}u.map=d;function o(b,B){return E((F,x=null,N)=>b(I=>{B(I),F.call(x,I)},null,N))}u.forEach=o;function h(b,B){return E((F,x=null,N)=>b(I=>B(I)&&F.call(x,I),null,N))}u.filter=h;function s(b){return b}u.signal=s;function a(...b){return(B,F=null,x)=>Object($.e)(...b.map(N=>N(I=>B.call(F,I),null,x)))}u.any=a;function A(b,B,F){let x=F;return d(b,N=>(x=B(x,N),x))}u.reduce=A;function E(b){let B;const F=new n({onFirstListenerAdd(){B=b(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function T(b,B,F=100,x=!1,N){let I,g,W,J=0;const ie=new n({leakWarningThreshold:N,onFirstListenerAdd(){I=b(ue=>{J++,g=B(g,ue),x&&!W&&(ie.fire(g),g=void 0),clearTimeout(W),W=setTimeout(()=>{const Re=g;g=void 0,W=void 0,(!x||J>1)&&ie.fire(Re),J=0},F)})},onLastListenerRemove(){I.dispose()}});return ie.event}u.debounce=T;function D(b,B=(F,x)=>F===x){let F=!0,x;return h(b,N=>{const I=F||!B(N,x);return F=!1,x=N,I})}u.latch=D;function L(b,B){return[u.filter(b,B),u.filter(b,F=>!B(F))]}u.split=L;function w(b,B=!1,F=[]){let x=F.slice(),N=b(W=>{x?x.push(W):g.fire(W)});const I=()=>{x&&x.forEach(W=>g.fire(W)),x=null},g=new n({onFirstListenerAdd(){N||(N=b(W=>g.fire(W)))},onFirstListenerDidAdd(){x&&(B?setTimeout(I):I())},onLastListenerRemove(){N&&N.dispose(),N=null}});return g.event}u.buffer=w;class O{constructor(b){this.event=b}map(b){return new O(d(this.event,b))}forEach(b){return new O(o(this.event,b))}filter(b){return new O(h(this.event,b))}reduce(b,B){return new O(A(this.event,b,B))}latch(){return new O(D(this.event))}debounce(b,B=100,F=!1,x){return new O(T(this.event,b,B,F,x))}on(b,B,F){return this.event(b,B,F)}once(b,B,F){return l(this.event)(b,B,F)}}function S(b){return new O(b)}u.chain=S;function f(b,B,F=x=>x){const x=(...W)=>g.fire(F(...W)),N=()=>b.on(B,x),I=()=>b.removeListener(B,x),g=new n({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}u.fromNodeEventEmitter=f;function C(b,B,F=x=>x){const x=(...W)=>g.fire(F(...W)),N=()=>b.addEventListener(B,x),I=()=>b.removeEventListener(B,x),g=new n({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}u.fromDOMEventEmitter=C;function y(b){return new Promise(B=>l(b)(B))}u.toPromise=y})(j||(j={}));class U{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${U._idPool++}`}start(u){this._stopWatch=new Y.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let z=-1;class G{constructor(u,l=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let l=z;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||u<l)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(d)||0;if(this._stacks.set(d,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let h,s=0;for(const[a,A]of this._stacks)(!h||s<A)&&(h=a,s=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${s}):`),console.warn(h)}return()=>{const h=this._stacks.get(d)||0;this._stacks.set(d,h-1)}}}class n{constructor(u){var l;this._disposed=!1,this._options=u,this._leakageMon=z>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(u,l,d)=>{var o;this._listeners||(this._listeners=new P.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[u,l]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,l);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),A=Object($.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return d instanceof $.b?d.add(A):Array.isArray(d)&&d.push(A),A}),this._event}fire(u){var l,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,u]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,h]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,h):o[0].call(o[1],h)}catch(s){Object(re.f)(s)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var u,l,d,o,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||o===void 0||o.call(d),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class R extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class v extends R{constructor(u){var l;super(u);this._delay=(l=u.delay)!==null&&l!==void 0?l:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class m{constructor(){this.buffers=[]}wrapEvent(u){return(l,d,o)=>u(h=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(d,h)):l.call(d,h)},void 0,o)}bufferEvents(u){const l=[];this.buffers.push(l);const d=u();return this.buffers.pop(),l.forEach(o=>o()),d}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=$.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ot,xe,Z){"use strict";(function(re,$){Z.d(xe,"b",function(){return d}),Z.d(xe,"i",function(){return a}),Z.d(xe,"f",function(){return A}),Z.d(xe,"d",function(){return E}),Z.d(xe,"g",function(){return T}),Z.d(xe,"h",function(){return D}),Z.d(xe,"c",function(){return L}),Z.d(xe,"k",function(){return w}),Z.d(xe,"j",function(){return O}),Z.d(xe,"a",function(){return S}),Z.d(xe,"e",function(){return y});var P;const Y="en";let j=!1,U=!1,z=!1,G=!1,n=!1,R=!1,v=!1,m,p=Y,u,l;const d=typeof self=="object"?self:typeof re=="object"?re:{};let o;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?o=d.vscode.process:typeof $!="undefined"&&(o=$);const h=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!h)l=navigator.userAgent,j=l.indexOf("Windows")>=0,U=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z=l.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",U=o.platform==="darwin",z=o.platform==="linux",G=z&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=Y,p=Y;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const B=JSON.parse(b),F=B.availableLanguages["*"];m=B.locale,p=F||Y,u=B._translationsConfigFile}catch(B){}n=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:z&&(s=2);const a=j,A=U,E=z,T=n,D=R,L=v,w=l,O=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let F=[];d.addEventListener("message",N=>{if(N.data&&N.data.vscodeSetImmediateId)for(let I=0,g=F.length;I<g;I++){const W=F[I];if(W.id===N.data.vscodeSetImmediateId){F.splice(I,1),W.callback();return}}});let x=0;return N=>{const I=++x;F.push({id:I,callback:N}),d.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const B=Promise.resolve();return F=>B.then(F)}(),S=U||v?2:j?1:3;let f=!0,C=!1;function y(){if(!C){C=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const B=new Uint16Array(b.buffer);f=B[0]===(2<<8)+1}return f}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(ot,xe,Z){"use strict";Z.d(xe,"C",function(){return re}),Z.d(xe,"v",function(){return P}),Z.d(xe,"s",function(){return Y}),Z.d(xe,"t",function(){return j}),Z.d(xe,"U",function(){return U}),Z.d(xe,"J",function(){return z}),Z.d(xe,"O",function(){return G}),Z.d(xe,"p",function(){return n}),Z.d(xe,"T",function(){return R}),Z.d(xe,"q",function(){return v}),Z.d(xe,"N",function(){return m}),Z.d(xe,"M",function(){return p}),Z.d(xe,"Q",function(){return u}),Z.d(xe,"u",function(){return l}),Z.d(xe,"x",function(){return d}),Z.d(xe,"I",function(){return o}),Z.d(xe,"f",function(){return h}),Z.d(xe,"h",function(){return s}),Z.d(xe,"g",function(){return a}),Z.d(xe,"i",function(){return A}),Z.d(xe,"G",function(){return E}),Z.d(xe,"H",function(){return T}),Z.d(xe,"r",function(){return D}),Z.d(xe,"R",function(){return L}),Z.d(xe,"d",function(){return w}),Z.d(xe,"e",function(){return O}),Z.d(xe,"E",function(){return S}),Z.d(xe,"F",function(){return f}),Z.d(xe,"j",function(){return C}),Z.d(xe,"z",function(){return y}),Z.d(xe,"K",function(){return B}),Z.d(xe,"L",function(){return F}),Z.d(xe,"m",function(){return N}),Z.d(xe,"k",function(){return g}),Z.d(xe,"A",function(){return J}),Z.d(xe,"a",function(){return ie}),Z.d(xe,"n",function(){return ue}),Z.d(xe,"l",function(){return Re}),Z.d(xe,"D",function(){return ve}),Z.d(xe,"B",function(){return Se}),Z.d(xe,"b",function(){return Le}),Z.d(xe,"S",function(){return be}),Z.d(xe,"o",function(){return ce}),Z.d(xe,"P",function(){return he}),Z.d(xe,"w",function(){return ne}),Z.d(xe,"c",function(){return de}),Z.d(xe,"y",function(){return Ne});function re(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const $=/{(\d+)}/g;function P(oe,...ge){return ge.length===0?oe:oe.replace($,function(Oe,Ie){const He=parseInt(Ie,10);return isNaN(He)||He<0||He>=ge.length?Oe:ge[He]})}function Y(oe){return oe.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function j(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(oe,ge=" "){const Oe=z(oe,ge);return G(Oe,ge)}function z(oe,ge){if(!oe||!ge)return oe;const Oe=ge.length;if(Oe===0||oe.length===0)return oe;let Ie=0;for(;oe.indexOf(ge,Ie)===Ie;)Ie=Ie+Oe;return oe.substring(Ie)}function G(oe,ge){if(!oe||!ge)return oe;const Oe=ge.length,Ie=oe.length;if(Oe===0||Ie===0)return oe;let He=Ie,Xe=-1;for(;!(Xe=oe.lastIndexOf(ge,He-1),Xe===-1||Xe+Oe!==He);){if(Xe===0)return"";He=Xe}return oe.substring(0,He)}function n(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(oe){return oe.replace(/\*/g,"")}function v(oe,ge,Oe={}){if(!oe)throw new Error("Cannot create regex from empty string");ge||(oe=j(oe)),Oe.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let Ie="";return Oe.global&&(Ie+="g"),Oe.matchCase||(Ie+="i"),Oe.multiline&&(Ie+="m"),Oe.unicode&&(Ie+="u"),new RegExp(oe,Ie)}function m(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const ge=oe.exec("");return!!(ge&&oe.lastIndex===0)}function p(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function u(oe){return oe.split(/\r\n|\r|\n/)}function l(oe){for(let ge=0,Oe=oe.length;ge<Oe;ge++){const Ie=oe.charCodeAt(ge);if(Ie!==32&&Ie!==9)return ge}return-1}function d(oe,ge=0,Oe=oe.length){for(let Ie=ge;Ie<Oe;Ie++){const He=oe.charCodeAt(Ie);if(He!==32&&He!==9)return oe.substring(ge,Ie)}return oe.substring(ge,Oe)}function o(oe,ge=oe.length-1){for(let Oe=ge;Oe>=0;Oe--){const Ie=oe.charCodeAt(Oe);if(Ie!==32&&Ie!==9)return Oe}return-1}function h(oe,ge){return oe<ge?-1:oe>ge?1:0}function s(oe,ge,Oe=0,Ie=oe.length,He=0,Xe=ge.length){for(;Oe<Ie&&He<Xe;Oe++,He++){let nt=oe.charCodeAt(Oe),$e=ge.charCodeAt(He);if(nt<$e)return-1;if(nt>$e)return 1}const qe=Ie-Oe,Ze=Xe-He;return qe<Ze?-1:qe>Ze?1:0}function a(oe,ge){return A(oe,ge,0,oe.length,0,ge.length)}function A(oe,ge,Oe=0,Ie=oe.length,He=0,Xe=ge.length){for(;Oe<Ie&&He<Xe;Oe++,He++){let nt=oe.charCodeAt(Oe),$e=ge.charCodeAt(He);if(nt===$e)continue;if(nt>=128||$e>=128)return s(oe.toLowerCase(),ge.toLowerCase(),Oe,Ie,He,Xe);E(nt)&&(nt-=32),E($e)&&($e-=32);const Qe=nt-$e;if(Qe===0)continue;return Qe}const qe=Ie-Oe,Ze=Xe-He;return qe<Ze?-1:qe>Ze?1:0}function E(oe){return oe>=97&&oe<=122}function T(oe){return oe>=65&&oe<=90}function D(oe,ge){return oe.length===ge.length&&A(oe,ge)===0}function L(oe,ge){const Oe=ge.length;return ge.length>oe.length?!1:A(oe,ge,0,Oe)===0}function w(oe,ge){let Oe,Ie=Math.min(oe.length,ge.length);for(Oe=0;Oe<Ie;Oe++)if(oe.charCodeAt(Oe)!==ge.charCodeAt(Oe))return Oe;return Ie}function O(oe,ge){let Oe,Ie=Math.min(oe.length,ge.length);const He=oe.length-1,Xe=ge.length-1;for(Oe=0;Oe<Ie;Oe++)if(oe.charCodeAt(He-Oe)!==ge.charCodeAt(Xe-Oe))return Oe;return Ie}function S(oe){return 55296<=oe&&oe<=56319}function f(oe){return 56320<=oe&&oe<=57343}function C(oe,ge){return(oe-55296<<10)+(ge-56320)+65536}function y(oe,ge,Oe){const Ie=oe.charCodeAt(Oe);if(S(Ie)&&Oe+1<ge){const He=oe.charCodeAt(Oe+1);if(f(He))return C(Ie,He)}return Ie}function b(oe,ge){const Oe=oe.charCodeAt(ge-1);if(f(Oe)&&ge>1){const Ie=oe.charCodeAt(ge-2);if(S(Ie))return C(Ie,Oe)}return Oe}function B(oe,ge){const Oe=se.getInstance(),Ie=ge,He=oe.length,Xe=y(oe,He,ge);ge+=Xe>=65536?2:1;let qe=Oe.getGraphemeBreakType(Xe);for(;ge<He;){const Ze=y(oe,He,ge),nt=Oe.getGraphemeBreakType(Ze);if(de(qe,nt))break;ge+=Ze>=65536?2:1,qe=nt}return ge-Ie}function F(oe,ge){const Oe=se.getInstance(),Ie=ge,He=b(oe,ge);ge-=He>=65536?2:1;let Xe=Oe.getGraphemeBreakType(He);for(;ge>0;){const qe=b(oe,ge),Ze=Oe.getGraphemeBreakType(qe);if(de(Ze,Xe))break;ge-=qe>=65536?2:1,Xe=Ze}return Ie-ge}const x=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function N(oe){return x.test(oe)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function g(oe){return I.test(oe)}const W=/^[\t\n\r\x20-\x7E]*$/;function J(oe){return W.test(oe)}const ie=/[\u2028\u2029]/;function ue(oe){return ie.test(oe)}function Re(oe){for(let ge=0,Oe=oe.length;ge<Oe;ge++)if(ve(oe.charCodeAt(ge)))return!0;return!1}function ve(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function Se(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Le=String.fromCharCode(65279);function be(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function ce(oe,ge=!1){return oe?(ge&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function he(oe){const ge=90-65+1;return oe=oe%(2*ge),oe<ge?String.fromCharCode(97+oe):String.fromCharCode(65+oe-ge)}function ne(oe){const ge=se.getInstance();return ge.getGraphemeBreakType(oe)}function de(oe,ge){return oe===0?ge!==5&&ge!==7:oe===2&&ge===3?!1:oe===4||oe===2||oe===3||(ge===4||ge===2||ge===3)?!0:oe===8&&(ge===8||ge===9||ge===11||ge===12)||((oe===11||oe===9)&&(ge===9||ge===10)||((oe===12||oe===10)&&ge===10||(ge===5||ge===13||(ge===7||(oe===1||oe===13&&ge===14)))))?!1:!(oe===6&&ge===6)}class se{constructor(){this._data=De()}static getInstance(){return se._INSTANCE||(se._INSTANCE=new se),se._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const ge=this._data,Oe=ge.length/3;let Ie=1;for(;Ie<=Oe;)if(oe<ge[3*Ie])Ie=2*Ie;else if(oe>ge[3*Ie+1])Ie=2*Ie+1;else return ge[3*Ie+2];return 0}}se._INSTANCE=null;function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(oe,ge){if(oe===0)return 0;const Oe=Ae(oe,ge);if(Oe!==void 0)return Oe;const Ie=b(ge,oe);return oe-=Pe(Ie),oe}function Ae(oe,ge){let Oe=b(ge,oe);for(oe-=Pe(Oe);Be(Oe)||Oe===65039||Oe===8419;){if(oe===0)return;Oe=b(ge,oe),oe-=Pe(Oe)}if(!Se(Oe))return;if(oe>=0){const Ie=b(ge,oe);Ie===8205&&(oe-=Pe(Ie))}return oe}function Pe(oe){return oe>=65536?2:1}function Be(oe){return 127995<=oe&&oe<=127999}},Ot1p:function(ot,xe,Z){"use strict";var re=Z("2qtc"),$=Z("kLXV"),P=Z("rAM+"),Y=Z("miYZ"),j=Z("tsqr"),U=Z("9og8"),z=Z("tJVT"),G=Z("jrin"),n=Z("WmNS"),R=Z.n(n),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),u=Z.n(p),l=Z("bdgK"),d=Z("p77/"),o=Z("Bd2K"),h=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),T=Z("9Bee"),D=function(we){var Ue=we.value,ze=Ue===void 0?"":Ue,rt=we.className,pt=we.showTextOnly,ct=we.showLines,At=we.style,St=At===void 0?{}:At,dt=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},L=Z("0Owb"),w=Z("dejd"),O=Z("C+DQ"),S=Z("1vsH"),f=Z("m3rI"),C=[{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 y(we){var Ue=we.onActionCallback,ze=we.title,rt=we.icon,pt=we.actionName,ct=we.className,At=ct===void 0?"":ct,St=we.children;function dt(){Ue(pt)}return m.a.createElement("a",{title:ze,className:At,onClick:dt},m.a.createElement("i",{className:"md-iconfont ".concat(rt)}),St)}var b=function(we){var Ue=we.watch,ze=we.showNullButton,rt=we.onActionCallback,pt=we.fullScreen,ct=we.insertTemp,At=we.hidetoolBar,St=we.uuid,dt=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(S.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(S.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ft=[].concat(C,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&Ft.map(function(gt,Lt){return m.a.createElement("li",{key:Lt},gt.actionName?m.a.createElement(y,Object(L.a)({},gt,{onActionCallback:rt})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ct&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ct),onActionCallback:rt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(pt?"icon-shrink":"icon-enlarge"),title:pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},B=Z("M8RZ"),F=Z("+L6B"),x=Z("2/Rp"),N=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),W=Z("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},ie=function(we){var Ue=we.callback,ze=we.onCancel;function rt(pt){Ue(pt)}return m.a.createElement(I.a,Object(L.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(W.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},ue=Z("7ahc"),Re=Z("HmJG"),ve=Z("BjJ7"),Se=I.a.useForm,Le={width:280,marginRight:10},be={labelCol:{span:5},wrapperCol:{span:19}},ce=function(we){var Ue=we.callback,ze=we.onCancel,rt=Se(),pt=Object(z.a)(rt,1),ct=pt[0];function At(Ft){Ue(Ft)}function St(Ft,gt){if(Ft.status===-1){j.b.error(Ft.message);return}ct.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:gt.type})}function dt(Ft){var gt=Ft.target.files[0];ne(gt,St)}return m.a.createElement(I.a,Object(L.a)({form:ct},be,{className:"upload-image-panel",onFinish:At}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(W.a,{style:Le})),m.a.createElement(he,{onFileChange:dt}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function he(we){var Ue=we.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ue}))}function ne(we,Ue){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",we),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(pt){Ue(JSON.parse(pt.target.responseText),we)},!1),rt.addEventListener("error",function(pt){console.error(pt)},!1),rt.open("POST","".concat(ve.a,"/api/attachments.json")),rt.send(ze)}var de=Z("giR+"),se=Z("fyUT"),De=Z("7Kak"),Ne=Z("9yH6"),Ae=Ne.a.Group,Pe={margin:"0 8px"},Be=function(we){var Ue=we.callback,ze=we.onCancel;function rt(pt){Ue(pt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Ae,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("ErOA"),ge=Z("7Cbv"),Oe="link",Ie="upload-image",He="code-block",Xe="add-table",qe="------------",Ze={default:qe,left:":".concat(qe),center:":".concat(qe,":"),right:"".concat(qe,":")},nt=Z("9VGf"),$e,Qe;function Fe(){}var ut=0,lt=1e4,je="\u2581",We=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ce(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Te=_e?"Cmd":"Ctrl",ae=["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"],le=($e={},Object(G.a)($e,Te+"-B","bold"),Object(G.a)($e,Te+"-I","italic"),$e),fe=(Qe={},Object(G.a)(Qe,Oe,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(Qe,He,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(Qe,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(Qe,Xe,"\u6DFB\u52A0\u8868\u683C"),Qe),me=xe.a=function(we){var Ue=we.defaultValue,ze=Ue===void 0?"":Ue,rt=we.onChange,pt=we.width,ct=pt===void 0?"100%":pt,At=we.height,St=At===void 0?400:At,dt=we.miniToolbar,Ft=dt===void 0?!1:dt,gt=we.isFocus,Lt=gt===void 0?!1:gt,Dt=we.watch,tt=we.insertTemp,fn=we.mode,En=fn===void 0?"markdown":fn,bt=we.id,Vt=bt===void 0?"markdown-editor-id":bt,_t=we.showResizeBar,xt=_t===void 0?!1:_t,Bt=we.noStorage,$t=Bt===void 0?!1:Bt,pn=we.showNullButton,Ut=pn===void 0?!1:pn,mt=we.hidetoolBar,Hn=mt===void 0?!1:mt,Jt=we.fullScreen,en=Jt===void 0?!1:Jt,It=we.onBlur,hn=we.onCMBeforeChange,kn=we.onFullScreen,$n=we.className,Je=$n===void 0?"":$n,Ot=we.disablePaste,mi=Ot===void 0?!1:Ot,gi=we.placeholder,vi=gi===void 0?"":gi,yi=we.values,X=yi===void 0?"":yi,_=Object(v.useState)(null),k=Object(z.a)(_,2),H=k[0],ee=k[1],V=Object(v.useState)(ze),Ee=Object(z.a)(V,2),Ke=Ee[0],it=Ee[1],vt=Object(v.useState)(Dt),Ve=Object(z.a)(vt,2),Tt=Ve[0],Wt=Ve[1],qt=Object(v.useState)(en),Wn=Object(z.a)(qt,2),Sn=Wn[0],Cn=Wn[1],Zn=Object(v.useState)(""),Di=Object(z.a)(Zn,2),mn=Di[0],Vn=Di[1],ui=Object(v.useState)(0),hi=Object(z.a)(ui,2),Gn=hi[0],ki=hi[1],bi=Object(v.useState)(St),Ki=Object(z.a)(bi,2),Vi=Ki[0],qn=Ki[1],Jn=Object(v.useState)(!1),_i=Object(z.a)(Jn,2),cr=_i[0],Ei=_i[1],an=Object(v.useRef)(Object(ge.a)()),Gt=Object(v.useRef)(!1),xn=Object(v.useRef)(),Pt=Object(v.useRef)(),on=Object(v.useRef)(),Xt=Object(v.useRef)(),ri=Object(v.useRef)(),gn=function(){var yt=Object(U.a)(R.a.mark(function Rt(){var wt,Mt;return R.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:an.current}});case 2:Mt=Qt.sent,Mt!=null&&(wt=Mt.attachments)!==null&&wt!==void 0&&wt.length&&(console.log("cm:",H,Pt),Mt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):jt.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):H.replaceSelection("[".concat(jt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return Qt.stop()}},Rt)}));return function(){return yt.apply(this,arguments)}}();Object(v.useEffect)(function(){it(X),H==null||H.setValue(X)},[X]),Object(v.useEffect)(function(){kn==null||kn(Sn)},[Sn]),Object(v.useEffect)(function(){if(Pt.current){var yt=u.a.fromTextArea(Pt.current,{mode:En,lineNumbers:!Ft,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});Lt&&yt.focus();function Rt(wt,Mt){if(mi){Mt.preventDefault();return}var Ht=Mt.clipboardData;if(Ht){var Qt=Ht.types.toString(),jt=Ht.items;if(Qt==="Files"||Ht.types.indexOf("Files")>-1){if(Mt.preventDefault(),En=="stex")return;try{var cn,Mn=jt[1];((cn=jt[0])===null||cn===void 0?void 0:cn.kind)==="file"&&(Mn=jt[0]);var Nt=Mn.getAsFile(),ci=Nt.name.split(".").pop();ne(Nt,function(zt){if(zt.id){var Pn,An,Qn;(Nt==null||((Pn=Nt.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?yt.replaceSelection(".concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):ae.includes(ci)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):yt.replaceSelection("[".concat(Nt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Rt),yt.on("dragleave",function(wt,Mt){on.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(wt,Mt){on.current.classList.add("mouse-hover-md")}),yt.on("drop",function(wt,Mt){on.current.classList.add("mouse-hover-md");var Ht;if(Ht=Mt.dataTransfer.files,Ht.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Qt=function(Mn){var Nt=Ht[Mn],ci=Nt.name.split(".").pop();ne(Nt,function(zt){if(zt.id){var Pn,An,Qn;(Nt==null||((Pn=Nt.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?yt.replaceSelection(".concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):ae.includes(ci)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):yt.replaceSelection("[".concat(Nt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},jt=0;jt<Ht.length;jt++)Qt(jt)}}),ee(yt),function(){yt.off("paste",Rt)}}},[]);var Ln=Object(v.useCallback)(function(){if(on.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[Vi,on,Sn]);Object(v.useEffect)(function(){function yt(){var wt=new l.default(function(Mt){var Ht=Object(P.a)(Mt),Qt;try{for(Ht.s();!(Qt=Ht.n()).done;){var jt=Qt.value;(jt.target.offsetHeight>0||jt.target.offsetWidth>0)&&(Ln(),H.setSize("100%","100%"),H.refresh())}}catch(cn){Ht.e(cn)}finally{Ht.f()}});return wt.observe(Pt.current.parentElement),wt}if(H){var Rt=yt();return function(){Rt.unobserve(Pt.current.parentElement)}}},[H,Ln]),Object(v.useEffect)(function(){if(H){for(var yt=[],Rt=function(){var jt=Mt[wt];Ht=Object(z.a)(jt,2);var cn=Ht[0],Mn=Ht[1],Nt=Object(G.a)({},cn,function(){Xi(Mn)});yt.push(Nt),H.addKeyMap(Nt)},wt=0,Mt=Object.entries(le);wt<Mt.length;wt++){var Ht;Rt()}return xn.current=setInterval(function(){Gt.current&&gn()},4e3),function(){clearInterval(xn.current);var Qt=Object(P.a)(yt),jt;try{for(Qt.s();!(jt=Qt.n()).done;){var cn=jt.value;H.removeKeyMap(cn)}}catch(Mn){Qt.e(Mn)}finally{Qt.f()}}}},[H]),Object(v.useEffect)(function(){en!==Sn&&Cn(en)},[en]),Object(nt.a)(function(){if(!$t&&Gn>0){var yt=new Date().getTime(),Rt=window.sessionStorage.getItem(Vt);yt>=Gn+lt&&(!Rt||Rt!==Ke)&&(window.sessionStorage.setItem(Vt,Ke),Ei(!0))}},lt),Object(v.useEffect)(function(){Wt(Dt)},[H,Dt]),Object(v.useEffect)(function(){H&&(Lt&&H.focus())},[H,Lt]),Object(v.useEffect)(function(){if(Tt&&H){var yt=H.getScrollerElement();function Rt(wt){var Mt=wt.target;if(ri.current){var Ht=Mt.scrollTop/Mt.scrollHeight;ri.current.scrollTop=ri.current.scrollHeight*Ht}}return yt.addEventListener("scroll",Rt),function(){yt.removeEventListener("scroll",Rt)}}},[H,Tt]),Object(v.useEffect)(function(){if(H&&hn){function yt(Rt,wt){hn(Rt,wt)}return H.on("beforeChange",yt),function(){H.off("beforeChange",yt)}}},[H,hn]),Object(v.useEffect)(function(){if(H&&It){function yt(){It(H.getValue())}return H.on("blur",yt),function(){H.off("blur",yt)}}},[H,It]),Object(v.useEffect)(function(){if(H){function yt(Rt){var wt=Rt.getValue();it(wt),ki(new Date().getTime()),Rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(wt)}return H.on("change",yt),function(){H.off("change",yt)}}},[H,rt]),Object(v.useEffect)(function(){H&&(ze==null?(H.setValue(""),it("")):ze!==H.getValue()&&(H.setValue(ze),it(ze),H.setCursor(H.lineCount(),0)))},[H,ze]);var Xi=Object(v.useCallback)(function(yt){var Rt=H.getCursor(),wt=H.getSelection(),Mt=wt.split(`
|
|
`);switch(yt){case"bold":return H.replaceSelection("**"+wt+"**"),wt===""&&H.setCursor(Rt.line,Rt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+wt+"*"),wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"code":return H.replaceSelection("`"+wt+"`"),wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+wt+"$$`"),wt===""&&H.setCursor(Rt.line,Rt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+wt+"\n```"),H.setCursor(Rt.line+1,wt.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return wt===""?H.replaceSelection("- "+wt):H.replaceSelection(Mt.map(function(Ht){return Ht===""?"":"- ".concat(Ht)}).join(`
|
|
`)),H.focus();case"list-ol":return wt===""?H.replaceSelection("1. "+wt):H.replaceSelection(Mt.map(function(Ht,Qt){return Ht===""?"":"".concat(Qt+1,". ").concat(Ht)}).join(`
|
|
`)),H.focus();case"add-null-ch":return wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.replaceSelection(je),H.focus();case"inster-template-1":return wt===""&&H.setCursor(Rt.line,Rt.ch),H.replaceSelection(We),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return Wt(!Tt),H.focus();case"trigger-full-screen":return Cn(!Sn),H.focus();case Oe:Vn(Oe);return;case He:Vn(He);return;case Ie:Vn(Ie);return;case Xe:Vn(Xe);return;default:throw new Error}},[H,Tt,Sn]),xi=Object(v.useCallback)(function(yt){Vn("");switch(mn){case Oe:var Rt=yt.title,wt=yt.link;return H.replaceSelection("[".concat(Rt,"](").concat(wt,")")),H.focus();case He:var Mt=yt.language,Ht=yt.content;return H.replaceSelection(["```"+Mt,Ht,"```"].join(`
|
|
`)),H.focus();case Ie:var Qt=yt.src,jt=yt.alt;return jt?H.replaceSelection(".concat(Qt,' "').concat(jt,'" )')):H.replaceSelection("")),H.focus();case Xe:for(var cn=yt.row,Mn=yt.col,Nt=yt.align,ci=`
|
|
`,zt=0;zt<cn;zt++){for(var Pn=[],An=[],Qn=0;Qn<Mn;Qn++)zt===1&&An.push(Ze[Nt]),Pn.push(" ");zt===1&&(ci+="| ".concat(An.join(" | "),` |
|
|
`)),ci+="| ".concat(Pn.join(Mn===1?"":" | "),` |
|
|
`)}return H.replaceSelection(ci+`
|
|
`),H.focus();default:throw new Error}},[H,mn]),dr=Object(v.useMemo)(function(){switch(mn){case Oe:return m.a.createElement(ie,{callback:xi,onCancel:Ti});case He:return m.a.createElement(ue.b,{callback:xi,onCancel:Ti});case Ie:return m.a.createElement(ce,{callback:xi,onCancel:Ti});case Xe:return m.a.createElement(Be,{callback:xi,onCancel:Ti});default:return null}},[mn]);function Ti(){Vn("")}Object(v.useEffect)(function(){if(Xt.current){var yt=Xt.current,Rt=!1,wt=0;function Mt(jt){Rt=!0,wt=jt.pageY}function Ht(){Rt=!1}function Qt(jt){if(Rt){var cn=jt.pageY-wt;cn<0&&(cn=0),cn>300&&(cn=300);var Mn=St+cn+"px";qn(Mn)}}return yt.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Ht),function(){yt.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Ht)}}},[H,Xt]),Object(v.useEffect)(function(){qn(St)},[St]);var ai=Ce(ct),fr=Ce(Vi),ei={width:ai,height:fr},pr=Object(v.useMemo)(function(){if(Gn){var yt=new Date(Gn),Rt=yt.getHours(),wt=yt.getMinutes(),Mt=yt.getSeconds();return Rt=Rt<10?"0"+Rt:Rt,wt=wt<10?"0"+wt:wt,Mt=Mt<10?"0"+Mt:Mt,"".concat(Rt,":").concat(wt,":").concat(Mt)}return 0},[Gn]);function jr(){window.sessionStorage.removeItem(Vt),Ei(!1),ki(0)}function Mi(){Ei(!1),ki(0),H.setValue(window.sessionStorage.getItem(Vt))}function ua(yt,Rt){var wt=H.getValue();wt=wt.replace(yt,Rt),it(wt),H==null||H.setValue(wt)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:on},m.a.createElement("div",{className:"markdown-editor-container ".concat(Je," ").concat(Tt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Sn?"full-screen":""),style:ei},m.a.createElement(b,{insertTemp:tt,watch:Tt,fullScreen:Sn,showNullButton:Ut,onActionCallback:Xi,hidetoolBar:Hn,uuid:an.current,setOpenPhones:function(){Gt.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Pt,placeholder:vi})),Tt?m.a.createElement("div",{ref:ri,className:"preview-container"},En==="stex"&&m.a.createElement(D,{value:Ke}),En!=="stex"&&m.a.createElement(T.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Xt,className:"editor-resize"}):null,m.a.createElement(B.a,null,fe[mn]?m.a.createElement($.a,{centered:!0,title:fe[mn],visible:!0,onCancel:Ti,footer:null,className:"markdown-popup-form"},dr):null))}},SJMd:function(ot,xe){/**
|
|
* @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 Z,re,$,P=!1,Y,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,z;(function(){var G=window,n=["break,continue,do,else,for,if,return,while"],R=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="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",d=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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",h=[n,"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"],s=[n,"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"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[m,u,p,d,o,h,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",D="kwd",L="com",w="typ",O="lit",S="pun",f="pln",C="tag",y="dec",b="src",B="atn",F="atv",x="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ae){for(var Pe=0,Be=!1,oe=!1,ge=0,Oe=Ae.length;ge<Oe;++ge){var Ie=Ae[ge];if(Ie.ignoreCase)oe=!0;else if(/[a-z]/i.test(Ie.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Be=!0,oe=!1;break}}var He={b:8,t:9,n:10,v:11,f:12,r:13};function Xe(Qe){var Fe=Qe.charCodeAt(0);if(Fe!==92)return Fe;var ut=Qe.charAt(1);return Fe=He[ut],Fe||("0"<=ut&&ut<="7"?parseInt(Qe.substring(1),8):ut==="u"||ut==="x"?parseInt(Qe.substring(2),16):Qe.charCodeAt(1))}function qe(Qe){if(Qe<32)return(Qe<16?"\\x0":"\\x")+Qe.toString(16);var Fe=String.fromCharCode(Qe);return Fe==="\\"||Fe==="-"||Fe==="]"||Fe==="^"?"\\"+Fe:Fe}function Ze(Qe){var Fe=Qe.substring(1,Qe.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ut=[],lt=Fe[0]==="^",je=["["];lt&&je.push("^");for(var We=lt?1:0,Ce=Fe.length;We<Ce;++We){var _e=Fe[We];if(/\\[bdsw]/i.test(_e))je.push(_e);else{var Te=Xe(_e),ae;We+2<Ce&&Fe[We+1]==="-"?(ae=Xe(Fe[We+2]),We+=2):ae=Te,ut.push([Te,ae]),ae<65||Te>122||(ae<65||Te>90||ut.push([Math.max(65,Te)|32,Math.min(ae,90)|32]),ae<97||Te>122||ut.push([Math.max(97,Te)&~32,Math.min(ae,122)&~32]))}}ut.sort(function(we,Ue){return we[0]-Ue[0]||Ue[1]-we[1]});for(var le=[],fe=[],We=0;We<ut.length;++We){var me=ut[We];me[0]<=fe[1]+1?fe[1]=Math.max(fe[1],me[1]):le.push(fe=me)}for(var We=0;We<le.length;++We){var me=le[We];je.push(qe(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&je.push("-"),je.push(qe(me[1])))}return je.push("]"),je.join("")}function nt(Qe){for(var Fe=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=Fe.length,lt=[],je=0,We=0;je<ut;++je){var Ce=Fe[je];if(Ce==="(")++We;else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&(_e<=We?lt[_e]=-1:Fe[je]=qe(_e))}}for(var je=1;je<lt.length;++je)lt[je]===-1&&(lt[je]=++Pe);for(var je=0,We=0;je<ut;++je){var Ce=Fe[je];if(Ce==="(")++We,lt[We]||(Fe[je]="(?:");else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&_e<=We&&(Fe[je]="\\"+lt[_e])}}for(var je=0;je<ut;++je)Fe[je]==="^"&&Fe[je+1]!=="^"&&(Fe[je]="");if(Qe.ignoreCase&&Be)for(var je=0;je<ut;++je){var Ce=Fe[je],Te=Ce.charAt(0);Ce.length>=2&&Te==="["?Fe[je]=Ze(Ce):Te!=="\\"&&(Fe[je]=Ce.replace(/[a-zA-Z]/g,function(fe){var me=fe.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Fe.join("")}for(var $e=[],ge=0,Oe=Ae.length;ge<Oe;++ge){var Ie=Ae[ge];if(Ie.global||Ie.multiline)throw new Error(""+Ie);$e.push("(?:"+nt(Ie)+")")}return new RegExp($e.join("|"),oe?"gi":"g")}function g(Ae,Pe){var Be=/(?:^|\s)nocode(?:\s|$)/,oe=[],ge=0,Oe=[],Ie=0;function He(Xe){var qe=Xe.nodeType;if(qe==1){if(Be.test(Xe.className))return;for(var Ze=Xe.firstChild;Ze;Ze=Ze.nextSibling)He(Ze);var nt=Xe.nodeName.toLowerCase();(nt==="br"||nt==="li")&&(oe[Ie]=`
|
|
`,Oe[Ie<<1]=ge++,Oe[Ie++<<1|1]=Xe)}else if(qe==3||qe==4){var $e=Xe.nodeValue;$e.length&&(Pe?$e=$e.replace(/\r\n?/g,`
|
|
`):$e=$e.replace(/[ \t\r\n]+/g," "),oe[Ie]=$e,Oe[Ie<<1]=ge,ge+=$e.length,Oe[Ie++<<1|1]=Xe)}}return He(Ae),{sourceCode:oe.join("").replace(/\n$/,""),spans:Oe}}function W(Ae,Pe,Be,oe,ge){if(!Be)return;var Oe={sourceNode:Ae,pre:1,langExtension:null,numberLines:null,sourceCode:Be,spans:null,basePos:Pe,decorations:null};oe(Oe),ge.push.apply(ge,Oe.decorations)}var J=/\S/;function ie(Ae){for(var Pe=void 0,Be=Ae.firstChild;Be;Be=Be.nextSibling){var oe=Be.nodeType;Pe=oe===1?Pe?Ae:Be:oe===3&&J.test(Be.nodeValue)?Ae:Pe}return Pe===Ae?void 0:Pe}function ue(Ae,Pe){var Be={},oe;(function(){for(var Ie=Ae.concat(Pe),He=[],Xe={},qe=0,Ze=Ie.length;qe<Ze;++qe){var nt=Ie[qe],$e=nt[3];if($e)for(var Qe=$e.length;--Qe>=0;)Be[$e.charAt(Qe)]=nt;var Fe=nt[1],ut=""+Fe;Xe.hasOwnProperty(ut)||(He.push(Fe),Xe[ut]=null)}He.push(/[\0-\uffff]/),oe=I(He)})();var ge=Pe.length,Oe=function(Ie){for(var He=Ie.sourceCode,Xe=Ie.basePos,qe=Ie.sourceNode,Ze=[Xe,f],nt=0,$e=He.match(oe)||[],Qe={},Fe=0,ut=$e.length;Fe<ut;++Fe){var lt=$e[Fe],je=Qe[lt],We=void 0,Ce;if(typeof je=="string")Ce=!1;else{var _e=Be[lt.charAt(0)];if(_e)We=lt.match(_e[1]),je=_e[0];else{for(var Te=0;Te<ge;++Te)if(_e=Pe[Te],We=lt.match(_e[1]),We){je=_e[0];break}We||(je=f)}Ce=je.length>=5&&je.substring(0,5)==="lang-",Ce&&!(We&&typeof We[1]=="string")&&(Ce=!1,je=b),Ce||(Qe[lt]=je)}var ae=nt;if(nt+=lt.length,!Ce)Ze.push(Xe+ae,je);else{var le=We[1],fe=lt.indexOf(le),me=fe+le.length;We[2]&&(me=lt.length-We[2].length,fe=me-le.length);var we=je.substring(5);W(qe,Xe+ae,lt.substring(0,fe),Oe,Ze),W(qe,Xe+ae+fe,le,he(we,le),Ze),W(qe,Xe+ae+me,lt.substring(me),Oe,Ze)}}Ie.decorations=Ze};return Oe}function Re(Ae){var Pe=[],Be=[];Ae.tripleQuotedStrings?Pe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?Pe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Be.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=Ae.hashComments;oe&&(Ae.cStyleComments?(oe>1?Pe.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([L,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Be.push([L,/^\/\/[^\r\n]*/,null]),Be.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=Ae.regexLiterals;if(ge){var Oe=ge>1?"":`
|
|
\r`,Ie=Oe?".":"[\\S\\s]",He="/(?=[^/*"+Oe+"])(?:[^/\\x5B\\x5C"+Oe+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Oe+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+N+"("+He+")")])}var Xe=Ae.types;Xe&&Be.push([w,Xe]);var qe=(""+Ae.keywords).replace(/^ | $/g,"");qe.length&&Be.push([D,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Ze="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(Ze+="(?!s*/)"),Be.push([O,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[O,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[S,new RegExp(Ze),null]),ue(Pe,Be)}var ve=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Ae,Pe,Be){for(var oe=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,Oe=Ae.ownerDocument,Ie=Oe.createElement("li");Ae.firstChild;)Ie.appendChild(Ae.firstChild);var He=[Ie];function Xe(Fe){var ut=Fe.nodeType;if(ut==1&&!oe.test(Fe.className))if(Fe.nodeName==="br")qe(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var lt=Fe.firstChild;lt;lt=lt.nextSibling)Xe(lt);else if((ut==3||ut==4)&&Be){var je=Fe.nodeValue,We=je.match(ge);if(We){var Ce=je.substring(0,We.index);Fe.nodeValue=Ce;var _e=je.substring(We.index+We[0].length);if(_e){var Te=Fe.parentNode;Te.insertBefore(Oe.createTextNode(_e),Fe.nextSibling)}qe(Fe),Ce||Fe.parentNode.removeChild(Fe)}}}function qe(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function ut(We,Ce){var _e=Ce?We.cloneNode(!1):We,Te=We.parentNode;if(Te){var ae=ut(Te,1),le=We.nextSibling;ae.appendChild(_e);for(var fe=le;fe;fe=le)le=fe.nextSibling,ae.appendChild(fe)}return _e}for(var lt=ut(Fe.nextSibling,0),je;(je=lt.parentNode)&&je.nodeType===1;)lt=je;He.push(lt)}for(var Ze=0;Ze<He.length;++Ze)Xe(He[Ze]);Pe===(Pe|0)&&He[0].setAttribute("value",Pe);var nt=Oe.createElement("ol");nt.className="linenums";for(var $e=Math.max(0,Pe-1|0)||0,Ze=0,Qe=He.length;Ze<Qe;++Ze)Ie=He[Ze],Ie.className="L"+(Ze+$e)%10,Ie.firstChild||Ie.appendChild(Oe.createTextNode("\xA0")),nt.appendChild(Ie);Ae.appendChild(nt)}function Le(Ae){var Pe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Pe=Pe&&+Pe[1]<=8;var Be=/\n/g,oe=Ae.sourceCode,ge=oe.length,Oe=0,Ie=Ae.spans,He=Ie.length,Xe=0,qe=Ae.decorations,Ze=qe.length,nt=0;qe[Ze]=ge;var $e,Qe;for(Qe=$e=0;Qe<Ze;)qe[Qe]!==qe[Qe+2]?(qe[$e++]=qe[Qe++],qe[$e++]=qe[Qe++]):Qe+=2;for(Ze=$e,Qe=$e=0;Qe<Ze;){for(var Fe=qe[Qe],ut=qe[Qe+1],lt=Qe+2;lt+2<=Ze&&qe[lt+1]===ut;)lt+=2;qe[$e++]=Fe,qe[$e++]=ut,Qe=lt}Ze=qe.length=$e;var je=Ae.sourceNode,We="";je&&(We=je.style.display,je.style.display="none");try{for(var Ce=null;Xe<He;){var _e=Ie[Xe],Te=Ie[Xe+2]||ge,ae=qe[nt+2]||ge,lt=Math.min(Te,ae),le=Ie[Xe+1],fe;if(le.nodeType!==1&&(fe=oe.substring(Oe,lt))){Pe&&(fe=fe.replace(Be,"\r")),le.nodeValue=fe;var me=le.ownerDocument,we=me.createElement("span");we.className=qe[nt+1];var Ue=le.parentNode;Ue.replaceChild(we,le),we.appendChild(le),Oe<Te&&(Ie[Xe+1]=le=me.createTextNode(oe.substring(lt,Te)),Ue.insertBefore(le,we.nextSibling))}Oe=lt,Oe>=Te&&(Xe+=2),Oe>=ae&&(nt+=2)}}finally{je&&(je.style.display=We)}}var be={};function ce(Ae,Pe){for(var Be=Pe.length;--Be>=0;){var oe=Pe[Be];be.hasOwnProperty(oe)?G.console&&console.warn("cannot override language handler %s",oe):be[oe]=Ae}}function he(Ae,Pe){return Ae&&be.hasOwnProperty(Ae)||(Ae=/^\s*</.test(Pe)?"default-markup":"default-code"),be[Ae]}ce(ve,["default-code"]),ce(ue([],[[f,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[S,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ce(ue([[f,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[S,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ce(ue([],[[F,/^[\s\S]+/]]),["uq.val"]),ce(Re({keywords:m,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),ce(Re({keywords:"null,true,false"}),["json"]),ce(Re({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),ce(Re({keywords:p,cStyleComments:!0}),["java"]),ce(Re({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(Re({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(Re({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(Re({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(Re({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(Re({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(ue([],[[T,/^[\s\S]+/]]),["regex"]);function ne(Ae){var Pe=Ae.langExtension;try{var Be=g(Ae.sourceNode,Ae.pre),oe=Be.sourceCode;Ae.sourceCode=oe,Ae.spans=Be.spans,Ae.basePos=0,he(Pe,oe)(Ae),Le(Ae)}catch(ge){G.console&&console.log(ge&&ge.stack||ge)}}function de(Ae,Pe,Be){var oe=Be||!1,ge=Pe||null,Oe=document.createElement("div");Oe.innerHTML="<pre>"+Ae+"</pre>",Oe=Oe.firstChild,oe&&Se(Oe,oe,!0);var Ie={langExtension:ge,numberLines:oe,sourceNode:Oe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Ie),Oe.innerHTML}function se(Ae,Pe){var Be=Pe||document.body,oe=Be.ownerDocument||document;function ge(_e){return Be.getElementsByTagName(_e)}for(var Oe=[ge("pre"),ge("code"),ge("xmp")],Ie=[],He=0;He<Oe.length;++He)for(var Xe=0,qe=Oe[He].length;Xe<qe;++Xe)Ie.push(Oe[He][Xe]);Oe=null;var Ze=Date;Ze.now||(Ze={now:function(){return+new Date}});var nt=0,$e=/\blang(?:uage)?-([\w.]+)(?!\S)/,Qe=/\bprettyprint\b/,Fe=/\bprettyprinted\b/,ut=/pre|xmp/i,lt=/^code$/i,je=/^(?:pre|code|xmp)$/i,We={};function Ce(){for(var _e=G.PR_SHOULD_USE_CONTINUATION?Ze.now()+250:Infinity;nt<Ie.length&&Ze.now()<_e;nt++){for(var Te=Ie[nt],ae=We,le=Te;le=le.previousSibling;){var fe=le.nodeType,me=(fe===7||fe===8)&&le.nodeValue;if(me?!/^\??prettify\b/.test(me):fe!==3||/\S/.test(le.nodeValue))break;if(me){ae={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Dt,tt,fn){ae[tt]=fn});break}}var we=Te.className;if((ae!==We||Qe.test(we))&&!Fe.test(we)){for(var Ue=!1,ze=Te.parentNode;ze;ze=ze.parentNode){var rt=ze.tagName;if(je.test(rt)&&ze.className&&Qe.test(ze.className)){Ue=!0;break}}if(!Ue){Te.className+=" prettyprinted";var pt=ae.lang;if(!pt){pt=we.match($e);var ct;!pt&&(ct=ie(Te))&<.test(ct.tagName)&&(pt=ct.className.match($e)),pt&&(pt=pt[1])}var At;if(ut.test(Te.tagName))At=1;else{var St=Te.currentStyle,dt=oe.defaultView,Ft=St?St.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(Te,null).getPropertyValue("white-space"):0;At=Ft&&Ft.substring(0,3)==="pre"}var gt=ae.linenums;(gt=gt==="true"||+gt)||(gt=we.match(/\blinenums\b(?::(\d+))?/),gt=gt?gt[1]&>[1].length?+gt[1]:!0:!1),gt&&Se(Te,gt,At);var Lt={langExtension:pt,sourceNode:Te,numberLines:gt,pre:At,sourceCode:null,basePos:null,spans:null,decorations:null};ne(Lt)}}}nt<Ie.length?G.setTimeout(Ce,250):typeof Ae=="function"&&Ae()}Ce()}var De=G.PR={createSimpleLexer:ue,registerLangHandler:ce,sourceDecorator:Re,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:F,PR_COMMENT:L,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:O,PR_NOCODE:x,PR_PLAIN:f,PR_PUNCTUATION:S,PR_SOURCE:b,PR_STRING:T,PR_TAG:C,PR_TYPE:w,prettyPrintOne:P?G.prettyPrintOne=de:U=de,prettyPrint:z=P?G.prettyPrint=se:z=se},Ne=G.define;typeof Ne=="function"&&Ne.amd&&Ne("google-code-prettify",[],function(){return De})})()},"T+//":function(ot,xe,Z){"use strict";Z.r(xe);var re=Z("Q9mQ"),$=Z("diRs"),P=Z("2qtc"),Y=Z("kLXV"),j=Z("miYZ"),U=Z("tsqr"),z=Z("9og8"),G=Z("tJVT"),n=Z("B9cy"),R=Z("Ol7k"),v=Z("lUTK"),m=Z("BvKs"),p=Z("WmNS"),u=Z.n(p),l=Z("q1tI"),d=Z.n(l),o=Z("m3rI"),h=Z("p0QG"),s=Z.n(h),a=Z("ErOA"),A=Z("9kvl"),E=Z("RCxd"),T=Z("xGfz"),D=Z("xKgJ"),L=Z("5NDa"),w=Z("5rEg");function O(be){var ce=be.user,he=be.CategoryId,ne=be.IsShow,de=be.setIsShow,se=be.dispatch,De=be.init,Ne=Object(l.useState)(),Ae=Object(G.a)(Ne,2),Pe=Ae[0],Be=Ae[1];return d.a.createElement(Y.a,{title:he?"\u65B0\u5EFA\u4E09\u7EA7\u7C7B\u76EE":"\u65B0\u5EFA\u4E8C\u7EA7\u7C7B\u76EE",width:424,onCancel:function(){de(!1)},onOk:Object(z.a)(u.a.mark(function oe(){var ge;return u.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(Pe){Ie.next=3;break}return U.b.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A"),Ie.abrupt("return");case 3:return Ie.next=5,Object(a.a)("/api/programas.json",{method:"post",body:{name:Pe,parent_id:he}});case 5:ge=Ie.sent,ge.status===0&&(U.b.info("\u521B\u5EFA\u6210\u529F"),de(!1),Be(""),De());case 7:case"end":return Ie.stop()}},oe)})),visible:ne},d.a.createElement(w.a,{value:Pe,onChange:function(ge){return Be(ge.target.value)},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var S=Object(A.a)(function(be){var ce=be.user;return{user:ce}})(O);function f(be){var ce=be.user,he=be.CategoryId,ne=be.name,de=be.IsShow,se=be.setIsShow,De=be.dispatch,Ne=be.init,Ae=Object(l.useState)(),Pe=Object(G.a)(Ae,2),Be=Pe[0],oe=Pe[1];return Object(l.useEffect)(function(){oe(ne)},[ne]),d.a.createElement(Y.a,{title:"\u76EE\u5F55\u91CD\u547D\u540D",width:424,onCancel:function(){se(!1)},onOk:Object(z.a)(u.a.mark(function ge(){var Oe;return u.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(Be){He.next=3;break}return U.b.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A"),He.abrupt("return");case 3:return He.next=5,Object(a.a)("/api/programas/".concat(he,"/rename.json"),{method:"put",body:{name:Be,id:he}});case 5:Oe=He.sent,Oe.status===0&&(U.b.info("\u4FEE\u6539\u6210\u529F"),se(!1),oe(""),Ne());case 7:case"end":return He.stop()}},ge)})),visible:de},d.a.createElement(w.a,{value:Be,onChange:function(Oe){return oe(Oe.target.value)},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var C=Object(A.a)(function(be){var ce=be.user;return{user:ce}})(f),y=Z("+L6B"),b=Z("2/Rp"),B=Z("9Bee");function F(be){var ce,he,ne,de,se=be.user,De=be.ItemData,Ne=be.setIssee,Ae=be.dispatch,Pe=be.init;return d.a.createElement("div",null,d.a.createElement("div",{style:{textAlign:"right"}},Object(D.v)()&&d.a.createElement(b.a,{onClick:function(){return Ne(!1)}},"\u7F16\u8F91")),d.a.createElement(B.a,{value:De.content}),(De==null||((ce=De.attachment)===null||ce===void 0)?void 0:ce.id)&&d.a.createElement("div",null,d.a.createElement("a",{href:De==null||((he=De.attachment)===null||he===void 0)?void 0:he.url,target:"_self",download:De==null||((ne=De.attachment)===null||ne===void 0)?void 0:ne.title},d.a.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),d.a.createElement("span",{style:{color:"#000000"}},De==null||((de=De.attachment)===null||de===void 0)?void 0:de.title))))}var x=Object(A.a)(function(be){var ce=be.user;return{user:ce}})(F),N=Z("DZo9"),I=Z("8z0m"),g=Z("Ot1p"),W=Z("hJwl");function J(be){var ce=be.user,he=be.ItemData,ne=be.setIssee,de=be.CategoryId,se=be.dispatch,De=be.init,Ne=Object(l.useState)([]),Ae=Object(G.a)(Ne,2),Pe=Ae[0],Be=Ae[1],oe=Object(l.useState)(he.content),ge=Object(G.a)(oe,2),Oe=ge[0],Ie=ge[1];function He(){var $e,Qe=[];return he==null||(($e=he.attachments)===null||$e===void 0)||$e.map(function(Fe){var ut={uid:Fe==null?void 0:Fe.id,name:Fe.title,response:{id:Fe.id}};Qe.push(ut)}),Qe}var Xe={name:"file",multiple:!0,action:o.a.API_SERVER+"/api/attachments.json",defaultFileList:He(),onRemove:function(Qe){Object(W.t)({id:Qe.uid})},onChange:function(Qe){console.log("info",Qe);var Fe=Qe.file.status;Fe!=="uploading",Fe==="removed"&&Be(Qe.fileList),Fe==="done"?(Be(Qe.fileList),U.b.success("".concat(Qe.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F"))):Fe==="error"&&U.b.error("".concat(Qe.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(Qe){var Fe=Qe.size/1024/1024<150;return Fe||U.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Fe}};function qe(){return Ze.apply(this,arguments)}function Ze(){return Ze=Object(z.a)(u.a.mark(function $e(){var Qe;return u.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(a.a)("/api/programas/".concat(de,"/update_content.json"),{method:"put",body:{id:de,content:Oe,attachment_id:nt(Pe)}});case 2:Qe=ut.sent,Qe&&(U.b.info("\u63D0\u4EA4\u6210\u529F"),ne(!0));case 4:case"end":return ut.stop()}},$e)})),Ze.apply(this,arguments)}function nt($e){var Qe;return $e&&$e.map(function(Fe){Qe=Fe.response.id}),Qe}return d.a.createElement("div",null,d.a.createElement(g.a,{defaultValue:Oe,onChange:function(Qe){return Ie(Qe)}}),d.a.createElement(I.a,Xe,d.a.createElement(b.a,{className:"uploadBtn"},"\u4E0A\u4F20\u9644\u4EF6"),"(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"),d.a.createElement("p",{style:{marginTop:"10px"}},d.a.createElement(b.a,{style:{width:"90px"},onClick:function(){return qe()}},"\u63D0\u4EA4"),d.a.createElement(b.a,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:function(){return ne(!0)}},"\u53D6\u6D88")))}var ie=Object(A.a)(function(be){var ce=be.user;return{user:ce}})(J),ue=m.a.SubMenu,Re=R.a.Content,ve=R.a.Sider;function Se(be){var ce,he=be.user,ne=be.dispatch,de=be.globalSetting,se=Object(l.useState)(),De=Object(G.a)(se,2),Ne=De[0],Ae=De[1],Pe=Object(l.useState)(!1),Be=Object(G.a)(Pe,2),oe=Be[0],ge=Be[1],Oe=Object(l.useState)(),Ie=Object(G.a)(Oe,2),He=Ie[0],Xe=Ie[1],qe=Object(l.useState)(),Ze=Object(G.a)(qe,2),nt=Ze[0],$e=Ze[1],Qe=Object(l.useState)(!1),Fe=Object(G.a)(Qe,2),ut=Fe[0],lt=Fe[1],je=Object(l.useState)(""),We=Object(G.a)(je,2),Ce=We[0],_e=We[1],Te=Object(l.useState)(""),ae=Object(G.a)(Te,2),le=ae[0],fe=ae[1],me=Object(l.useState)(!0),we=Object(G.a)(me,2),Ue=we[0],ze=we[1];Object(l.useEffect)(function(){rt()},[]),console.log("globalSetting",de);function rt(){return pt.apply(this,arguments)}function pt(){return pt=Object(z.a)(u.a.mark(function gt(){var Lt;return u.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Object(a.a)("/api/programas.json",{method:"get"});case 2:Lt=tt.sent,Lt&&Xe(Lt==null?void 0:Lt.programas);case 4:case"end":return tt.stop()}},gt)})),pt.apply(this,arguments)}var ct=function(){var gt=Object(z.a)(u.a.mark(function Lt(Dt,tt,fn){var En;return u.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:Vt.t0=Dt,Vt.next=Vt.t0===1?3:Vt.t0===2?6:Vt.t0===3?10:Vt.t0===4?15:17;break;case 3:return $e(tt==null?void 0:tt.id),ge(!0),Vt.abrupt("break",17);case 6:return $e(tt==null?void 0:tt.id),lt(!0),_e(tt==null?void 0:tt.name),Vt.abrupt("break",17);case 10:return Vt.next=12,Object(a.a)("/api/programas/".concat(tt==null?void 0:tt.id,"/top.json"),{method:"post",body:{id:tt==null?void 0:tt.id}});case 12:return En=Vt.sent,En.status===0&&rt(),Vt.abrupt("break",17);case 15:return At(d.a.createElement("p",null,"\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u6062\u590D,",d.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),Object(z.a)(u.a.mark(function _t(){var xt;return u.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(a.a)("/api/programas/".concat(tt==null?void 0:tt.id,".json"),{method:"delete",body:{id:tt==null?void 0:tt.id}});case 2:xt=$t.sent,xt.status===0&&(U.b.info("\u5220\u9664\u6210\u529F"),rt());case 4:case"end":return $t.stop()}},_t)}))),Vt.abrupt("break",17);case 17:case"end":return Vt.stop()}},Lt)}));return function(Dt,tt,fn){return gt.apply(this,arguments)}}(),At=function(Lt,Dt){Y.a.confirm({centered:!0,title:"\u63D0\u793A",icon:d.a.createElement(E.a,null),content:Lt,okText:"\u786E\u8BA4",onOk:function(){return Dt()},cancelText:"\u53D6\u6D88"})},St=function(Lt,Dt){return d.a.createElement("div",{className:s.a.leftMenuActions},Dt===1&&d.a.createElement("p",{className:"current",onClick:function(){return ct(1,Lt,Dt)}},"\u65B0\u5EFA"),d.a.createElement("p",{className:"current",onClick:function(){return ct(2,Lt,Dt)}},"\u91CD\u547D\u540D"),d.a.createElement("p",{className:"current",onClick:function(){return ct(3,Lt,Dt)}},"\u7F6E\u9876"),d.a.createElement("p",{className:"current",onClick:function(){return ct(4,Lt,Dt)}},"\u5220\u9664"))};function dt(){return Ft.apply(this,arguments)}function Ft(){return Ft=Object(z.a)(u.a.mark(function gt(){var Lt;return u.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Object(a.a)("/api/programas/".concat(nt,"/content.json"),{method:"get",params:{id:nt}});case 2:Lt=tt.sent,Lt&&fe(Lt);case 4:case"end":return tt.stop()}},gt)})),Ft.apply(this,arguments)}return d.a.createElement("div",{style:{marginBottom:"40px"}},d.a.createElement("img",{style:{width:"100%"},src:o.a.IMG_SERVER+"/".concat(de==null||((ce=de.setting)===null||ce===void 0)?void 0:ce.shixun_banner_url)}),d.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},d.a.createElement(ve,{width:244,className:s.a.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},d.a.createElement(m.a,{mode:"inline"},He==null?void 0:He.map(function(gt,Lt){if((gt==null?void 0:gt.children.length)>0){var Dt;return d.a.createElement(ue,{title:d.a.createElement("span",{className:"font16"},d.a.createElement("span",null,gt.name),!Object(D.v)()&&d.a.createElement("span",null),Object(D.v)()&&d.a.createElement($.a,{placement:"right",content:function(){return St(gt,1)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))},gt==null||((Dt=gt.children)===null||Dt===void 0)?void 0:Dt.map(function(tt,fn){return d.a.createElement(m.a.Item,{className:s.a===null||s.a===void 0?void 0:s.a.SubMentItem,onClick:function(){$e(tt==null?void 0:tt.id),nt=tt==null?void 0:tt.id,dt()}},d.a.createElement("span",{style:{flex:"1"}},tt==null?void 0:tt.name),Object(D.v)()&&d.a.createElement($.a,{placement:"right",content:function(){return St(tt,2)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))}))}else return d.a.createElement(m.a.Item,{className:s.a===null||s.a===void 0?void 0:s.a.SubMentItem,onClick:function(){$e(gt==null?void 0:gt.id),nt=gt==null?void 0:gt.id,dt()}},d.a.createElement("span",{style:{flex:"1"}},gt==null?void 0:gt.name),Object(D.v)()&&d.a.createElement($.a,{placement:"right",content:function(){return St(gt,1)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))}),d.a.createElement(m.a.Item,{onClick:function(){$e(""),nt="",ge(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:d.a.createElement(T.a,{style:{color:"#0152d9",fontSize:"16px"}})},"\u65B0\u589E\u4E8C\u7EA7\u7C7B\u76EE"))),d.a.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},Ue&&d.a.createElement(x,{ItemData:le,setIssee:ze}),Ue===!1&&d.a.createElement(ie,{ItemData:le,setIssee:ze,CategoryId:nt}))),d.a.createElement(S,{CategoryId:nt,IsShow:oe,setIsShow:ge,init:rt}),d.a.createElement(C,{CategoryId:nt,name:Ce,IsShow:ut,setIsShow:lt,init:rt}))}var Le=xe.default=Object(A.a)(function(be){var ce=be.user,he=be.globalSetting;return{user:ce,globalSetting:he}})(Se)},T8No:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return z}),Z.d(xe,"e",function(){return G}),Z.d(xe,"c",function(){return S}),Z.d(xe,"b",function(){return f}),Z.d(xe,"d",function(){return C}),Z.d(xe,"f",function(){return B});var re=Z("MNsG"),$=Z("N0LK"),P=Z("Cg/j");let Y=re.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",re.f),j.set("isLinux",re.d),j.set("isWindows",re.i),j.set("isWeb",re.h),j.set("isMacNative",re.f&&!re.h),j.set("isEdge",Y.indexOf("Edg/")>=0),j.set("isFirefox",Y.indexOf("Firefox")>=0),j.set("isChrome",Y.indexOf("Chrome")>=0),j.set("isSafari",Y.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class z{static has(x){return m.create(x)}static equals(x,N){return p.create(x,N)}static regex(x,N){return T.create(x,N)}static not(x){return o.create(x)}static and(...x){return w.create(x,null)}static or(...x){return O.create(x,null,!0)}static deserialize(x,N=!1){return x?this._deserializeOrExpression(x,N):void 0}static _deserializeOrExpression(x,N){let I=x.split("||");return O.create(I.map(g=>this._deserializeAndExpression(g,N)),null,!0)}static _deserializeAndExpression(x,N){let I=x.split("&&");return w.create(I.map(g=>this._deserializeOne(g,N)),null)}static _deserializeOne(x,N){if(x=x.trim(),x.indexOf("!=")>=0){let I=x.split("!=");return d.create(I[0].trim(),this._deserializeValue(I[1],N))}if(x.indexOf("==")>=0){let I=x.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],N))}if(x.indexOf("=~")>=0){let I=x.split("=~");return T.create(I[0].trim(),this._deserializeRegexValue(I[1],N))}if(x.indexOf(" in ")>=0){let I=x.split(" in ");return u.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const I=x.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const I=x.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const I=x.split("<=");return E.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const I=x.split("<");return A.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(x)?o.create(x.substr(1).trim()):m.create(x)}static _deserializeValue(x,N){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let I=/^'([^']*)'$/.exec(x);return I?I[1].trim():x}static _deserializeRegexValue(x,N){if(Object($.C)(x)){if(N)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=x.indexOf("/"),g=x.lastIndexOf("/");if(I===g||I<0){if(N)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let W=x.slice(I+1,g),J=x[g+1]==="i"?"i":"";try{return new RegExp(W,J)}catch(ie){if(N)throw new Error(`bad regexp-value '${x}', parse error: ${ie}`);return console.warn(`bad regexp-value '${x}', parse error: ${ie}`),null}}}function G(x,N){const I=x?x.substituteConstants():void 0,g=N?N.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function n(x,N){return x.cmp(N)}class R{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}R.INSTANCE=new R;class v{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return R.INSTANCE}}v.INSTANCE=new v;class m{constructor(x,N){this.key=x,this.negated=N,this.type=2}static create(x,N=null){const I=j.get(x);return typeof I=="boolean"?I?v.INSTANCE:R.INSTANCE:new m(x,N)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=j.get(this.key);return typeof x=="boolean"?x?v.INSTANCE:R.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class p{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=4}static create(x,N,I=null){if(typeof N=="boolean")return N?m.create(x,I):o.create(x,I);const g=j.get(x);if(typeof g=="boolean"){const W=g?"true":"false";return N===W?v.INSTANCE:R.INSTANCE}return new p(x,N,I)}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=j.get(this.key);if(typeof x=="boolean"){const N=x?"true":"false";return this.value===N?v.INSTANCE:R.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class u{constructor(x,N){this.key=x,this.valueKey=N,this.type=10,this.negated=null}static create(x,N){return new u(x,N)}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const N=x.getValue(this.valueKey),I=x.getValue(this.key);return Array.isArray(N)?N.indexOf(I)>=0:typeof I=="string"&&typeof N=="object"&&N!==null?U.call(N,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(x){this._actual=x,this.type=11}static create(x){return new l(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=5}static create(x,N,I=null){if(typeof N=="boolean")return N?o.create(x,I):m.create(x,I);const g=j.get(x);if(typeof g=="boolean"){const W=g?"true":"false";return N===W?R.INSTANCE:v.INSTANCE}return new d(x,N,I)}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=j.get(this.key);if(typeof x=="boolean"){const N=x?"true":"false";return this.value===N?R.INSTANCE:v.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class o{constructor(x,N){this.key=x,this.negated=N,this.type=3}static create(x,N=null){const I=j.get(x);return typeof I=="boolean"?I?R.INSTANCE:v.INSTANCE:new o(x,N)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=j.get(this.key);return typeof x=="boolean"?x?R.INSTANCE:v.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function h(x,N){if(typeof x=="string"){const I=parseFloat(x);isNaN(I)||(x=I)}return typeof x=="string"||typeof x=="number"?N(x):R.INSTANCE}class s{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=12}static create(x,N,I=null){return h(N,g=>new s(x,g,I))}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=13}static create(x,N,I=null){return h(N,g=>new a(x,g,I))}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=14}static create(x,N,I=null){return h(N,g=>new A(x,g,I))}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class E{constructor(x,N,I){this.key=x,this.value=N,this.negated=I,this.type=15}static create(x,N,I=null){return h(N,g=>new E(x,g,I))}cmp(x){return x.type!==this.type?this.type-x.type:b(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class T{constructor(x,N){this.key=x,this.regexp=N,this.type=7,this.negated=null}static create(x,N){return new T(x,N)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const N=this.regexp?this.regexp.source:"",I=x.regexp?x.regexp.source:"";return N<I?-1:N>I?1:0}equals(x){if(x.type===this.type){const N=this.regexp?this.regexp.source:"",I=x.regexp?x.regexp.source:"";return this.key===x.key&&N===I}return!1}substituteConstants(){return this}evaluate(x){let N=x.getValue(this.key);return this.regexp?this.regexp.test(N):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(x){this._actual=x,this.type=8}static create(x){return new D(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function L(x){let N=null;for(let I=0,g=x.length;I<g;I++){const W=x[I].substituteConstants();if(x[I]!==W&&N===null){N=[];for(let J=0;J<I;J++)N[J]=x[J]}N!==null&&(N[I]=W)}return N===null?x:N}class w{constructor(x,N){this.expr=x,this.negated=N,this.type=6}static create(x,N){return w._normalizeArr(x,N)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let N=0,I=this.expr.length;N<I;N++){const g=n(this.expr[N],x.expr[N]);if(g!==0)return g}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].equals(x.expr[N]))return!1;return!0}return!1}substituteConstants(){const x=L(this.expr);return x===this.expr?this:w.create(x,this.negated)}evaluate(x){for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].evaluate(x))return!1;return!0}static _normalizeArr(x,N){const I=[];let g=!1;for(const W of x){if(!W)continue;if(W.type===1){g=!0;continue}if(W.type===0)return R.INSTANCE;if(W.type===6){I.push(...W.expr);continue}I.push(W)}if(I.length===0&&g)return v.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(n);for(let W=1;W<I.length;W++)I[W-1].equals(I[W])&&(I.splice(W,1),W--);if(I.length===1)return I[0];for(;I.length>1;){const W=I[I.length-1];if(W.type!==9)break;I.pop();const J=I.pop(),ie=I.length===0,ue=O.create(W.expr.map(Re=>w.create([Re,J],null)),null,ie);ue&&(I.push(ue),I.sort(n))}return I.length===1?I[0]:new w(I,N)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let N of this.expr)x.push(...N.keys());return x}negate(){if(!this.negated){const x=[];for(let N of this.expr)x.push(N.negate());this.negated=O.create(x,this,!0)}return this.negated}}class O{constructor(x,N){this.expr=x,this.negated=N,this.type=9}static create(x,N,I){return O._normalizeArr(x,N,I)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let N=0,I=this.expr.length;N<I;N++){const g=n(this.expr[N],x.expr[N]);if(g!==0)return g}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let N=0,I=this.expr.length;N<I;N++)if(!this.expr[N].equals(x.expr[N]))return!1;return!0}return!1}substituteConstants(){const x=L(this.expr);return x===this.expr?this:O.create(x,this.negated,!1)}evaluate(x){for(let N=0,I=this.expr.length;N<I;N++)if(this.expr[N].evaluate(x))return!0;return!1}static _normalizeArr(x,N,I){let g=[],W=!1;if(x){for(let J=0,ie=x.length;J<ie;J++){const ue=x[J];if(!ue)continue;if(ue.type===0){W=!0;continue}if(ue.type===1)return v.INSTANCE;if(ue.type===9){g=g.concat(ue.expr);continue}g.push(ue)}if(g.length===0&&W)return R.INSTANCE;g.sort(n)}if(g.length===0)return;if(g.length===1)return g[0];for(let J=1;J<g.length;J++)g[J-1].equals(g[J])&&(g.splice(J,1),J--);if(g.length===1)return g[0];if(I){for(let J=0;J<g.length;J++)for(let ie=J+1;ie<g.length;ie++)B(g[J],g[ie])&&(g.splice(ie,1),ie--);if(g.length===1)return g[0]}return new O(g,N)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let N of this.expr)x.push(...N.keys());return x}negate(){if(!this.negated){let x=[];for(let N of this.expr)x.push(N.negate());for(;x.length>1;){const N=x.shift(),I=x.shift(),g=[];for(const J of F(N))for(const ie of F(I))g.push(w.create([J,ie],null));const W=x.length===0;x.unshift(O.create(g,null,W))}this.negated=x[0]}return this.negated}}class S extends m{constructor(x,N,I){super(x,null);this._defaultValue=N,typeof I=="object"?S._info.push(Object.assign(Object.assign({},I),{key:x})):I!==!0&&S._info.push({key:x,description:I,type:N!=null?typeof N:void 0})}static all(){return S._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return p.create(this.key,x)}}S._info=[];const f=Object(P.c)("contextKeyService"),C="setContext";function y(x,N){return x<N?-1:x>N?1:0}function b(x,N,I,g){return x<I?-1:x>I?1:N<g?-1:N>g?1:0}function B(x,N){if(N.type===6&&x.type!==9&&x.type!==6){for(const W of N.expr)if(x.equals(W))return!0}const I=x.negate(),g=F(I).concat(F(N));g.sort(n);for(let W=0;W<g.length;W++){const J=g[W],ie=J.negate();for(let ue=W+1;ue<g.length;ue++){const Re=g[ue];if(ie.equals(Re))return!0}}return!1}function F(x){return x.type===9?x.expr:[x]}},TXwP:function(ot,xe,Z){var re,$;(function(){var P;(function(){"use strict";var j=[,,function(n){function R(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(p))return!0;return!1},R.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,u){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var l=this.__base_string_length;return u=u||0,p<0&&(l=0),l+=p*this.__indent_size,l+=u,l},v.prototype.get_indent_string=function(p,u){var l=this.__base_string;return u=u||0,p<0&&(p=0,l=""),u+=p*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,u=0,l="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,u){this.__indent_cache=new v(p,u),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},m.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var u=0;u<p.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var u=this.__lines.length;p<u;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,u){for(var l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(p)!==0&&d.item(-1)!==u){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=m},,,,function(n){function R(p,u){this.raw_options=v(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}R.prototype._get_array=function(p,u){var l=this.raw_options[p],d=u||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},R.prototype._get_boolean=function(p,u){var l=this.raw_options[p],d=l===void 0?!!u:!!l;return d},R.prototype._get_characters=function(p,u){var l=this.raw_options[p],d=u||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},R.prototype._get_number=function(p,u){var l=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(l,10);return isNaN(d)&&(d=u),d},R.prototype._get_selection=function(p,u,l){var d=this._get_selection_list(p,u,l);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return d[0]},R.prototype._get_selection_list=function(p,u,l){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[u[0]],!this._is_valid_selection(l,u))throw new Error("Invalid Default Value!");var d=this._get_array(p,l);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[p]+"'");return d},R.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(l){return u.indexOf(l)===-1})};function v(p,u){var l={};p=m(p);var d;for(d in p)d!==u&&(l[d]=p[d]);if(u&&p[u])for(d in p[u])l[d]=p[u][d];return l}function m(p){var u={},l;for(l in p){var d=l.replace(/-/g,"_");u[d]=p[l]}return u}n.exports.Options=R,n.exports.normalizeOpts=m,n.exports.mergeOpts=v},,function(n){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var u=m.exec(this.__input);return u&&!(R&&m.sticky)&&(u.index!==p&&(u=null)),u},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var u=this.peek(p);return m.lastIndex=0,u!==null&&m.test(u)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,u){var l="",d;return m&&(d=this.match(m),d&&(l+=d[0])),p&&(d||!m)&&(l+=this.readUntil(p,u)),l},v.prototype.readUntil=function(m,p){var u="",l=this.__position;m.lastIndex=this.__position;var d=m.exec(this.__input);return d?(l=d.index,p&&(l+=d[0].length)):l=this.__input_length,u=this.__input.substring(this.__position,l),this.__position=l,u},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var u=null,l="g";return p&&R&&(l="y"),typeof m=="string"&&m!==""?u=new RegExp(m,l):m&&(u=new RegExp(m.source,l)),u},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,u=this.readUntilAfter(m);return this.__position=p,u},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},n.exports.InputScanner=v},,,,,function(n){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=R},,function(n,R,v){var m=v(16).Beautifier,p=v(17).Options;function u(l,d){var o=new m(l,d);return o.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new p}},function(n,R,v){var m=v(17).Options,p=v(2).Output,u=v(8).InputScanner,l=v(13).Directives,d=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(D,L){this._source_text=D||"",this._options=new m(L),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(D){var L="";for(this._ch=this._input.next();this._ch;){if(L+=this._ch,this._ch==="\\")L+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return L},T.prototype.eatWhitespace=function(D){for(var L=s.test(this._input.peek()),w=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
|
|
`&&((w===0||w<this._options.max_preserve_newlines)&&(w++,this._output.add_new_line(!0)));return L},T.prototype.foundNestedPseudoClass=function(){for(var D=0,L=1,w=this._input.peek(L);w;){if(w==="{")return!0;if(w==="(")D+=1;else if(w===")"){if(D===0)return!1;D-=1}else if(w===";"||w==="}")return!1;L++,w=this._input.peek(L)}return!1},T.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},T.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,L=this._options.eol;L==="auto"&&(L=`
|
|
`,D&&o.test(D||"")&&(L=D.match(o)[0])),D=D.replace(h,`
|
|
`);var w=D.match(/^[\t ]*/)[0];this._output=new p(this._options,w),this._input=new u(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var O=0,S=!1,f=!1,C=!1,y=!1,b=!1,B=!1,F=this._ch,x=!1,N,I,g;N=this._input.read(a),I=N!=="",g=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(A),J=d.get_directives(W);J&&J.ignore==="start"&&(W+=d.readIgnored(this._input)),this.print_string(W),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?y=!0:ie==="import"&&(b=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!S&&O===0&&ie.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,S=this._indentLevel>=this._nestedLevel):S=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&S&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(g==="("?this._output.space_before_token=!1:g!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),g==="{"&&this._output.trim(!0),b=!1,y=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),S=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ue=0;ue<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ue++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ue])){x=!0;break}(S||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&O===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Re=g==='"'||g==="'";this.preserveSingleSpace(Re||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,O===0?(f&&(this.outdent(),f=!1),y=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),O++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),O&&(O--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(I||ve),this.print_string(this._ch),f&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),B=!0):(this.eatWhitespace(),O++,this.indent())}else if(this._ch===")")O&&(O--,this.outdent()),B&&this._input.peek()===";"&&this._options.selector_separator_newline&&(B=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||B)&&O===0&&!b&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&O===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Se=g==='"'||g==="'";this.preserveSingleSpace(Se||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&x&&this._output.add_new_line()}var Le=this._output.get_code(L);return Le},n.exports.Beautifier=T},function(n,R,v){var m=v(6).Options;function p(u){m.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<d.length;o++)d[o]!=="expand"?this.brace_style="collapse":this.brace_style=d[o]}p.prototype=new m,n.exports.Options=p}],U={};function z(n){var R=U[n];if(R!==void 0)return R.exports;var v=U[n]={exports:{}};return j[n](v,v.exports,z),v.exports}var G=z(15);P=G})();var Y=P;!(re=[],$=function(){return{css_beautify:Y}}.apply(xe,re),$!==void 0&&(ot.exports=$))})()},Vhoy:function(ot,xe,Z){"use strict";Z.d(xe,"d",function(){return Y}),Z.d(xe,"e",function(){return j}),Z.d(xe,"c",function(){return U}),Z.d(xe,"b",function(){return z}),Z.d(xe,"a",function(){return G});var re=Z("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new re.b}add(n){const R=this._icons.get(n.id);R?n.description?R.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new $,Y=P;function j(n,R){return new z(n,R)}function U(n){return n?n.replace(/\$\((.*?)\)/g,(R,v)=>` ${v} `).trim():""}class z{constructor(n,R,v){this.id=n,this.definition=R,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const R=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function v(u){if(u instanceof z)return["codicon","codicon-"+u.id];const l=R.exec(u.id);if(!l)return v(z.error);let[,d,o]=l;const h=["codicon","codicon-"+d];return o&&h.push("codicon-modifier-"+o.substr(1)),h}n.asClassNameArray=v;function m(u){return v(u).join(" ")}n.asClassName=m;function p(u){return"."+v(u).join(".")}n.asCSSSelector=p})(G||(G={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(z||(z={}))},"VrN/":function(ot,xe,Z){(function(re,$){ot.exports=$()})(this,function(){"use strict";var re=navigator.userAgent,$=navigator.platform,P=/gecko\/\d/i.test(re),Y=/MSIE \d/.test(re),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),U=/Edge\/(\d+)/.exec(re),z=Y||j||U,G=z&&(Y?document.documentMode||6:+(U||j)[1]),n=!U&&/WebKit\//.test(re),R=n&&/Qt\/\d+\.\d+/.test(re),v=!U&&/Chrome\//.test(re),m=/Opera\//.test(re),p=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),l=/PhantomJS/.test(re),d=!U&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),o=/Android/.test(re),h=d||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),s=d||/Mac/.test($),a=/\bCrOS\b/.test(re),A=/win/i.test($),E=m&&re.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(m=!1,n=!0);var T=s&&(R||m&&(E==null||E<12.11)),D=P||z&&G>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,t){var r=e.className,i=L(t).exec(r);if(i){var c=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(c?i[1]+c:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function S(e,t){return O(e).appendChild(t)}function f(e,t,r,i){var c=document.createElement(e);if(r&&(c.className=r),i&&(c.style.cssText=i),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)c.appendChild(t[M]);return c}function C(e,t,r,i){var c=f(e,t,r,i);return c.setAttribute("role","presentation"),c}var y;document.createRange?y=function(e,t,r,i){var c=document.createRange();return c.setEnd(i||e,r),c.setStart(e,t),c}:y=function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(c){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var r=e.className;L(t).test(r)||(e.className+=(r?" ":"")+t)}function x(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!L(r[i]).test(t)&&(t+=" "+r[i]);return t}var N=function(e){e.select()};d?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(N=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,r){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(r!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function W(e,t,r,i,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=i||0,K=c||0;;){var Q=e.indexOf(" ",M);if(Q<0||Q>=t)return K+(t-M);K+=Q-M,K+=r-K%r,M=Q+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ie(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var ue=50,Re={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},Se={origin:"*mouse"},Le={origin:"+move"};function be(e,t,r){for(var i=0,c=0;;){var M=e.indexOf(" ",i);M==-1&&(M=e.length);var K=M-i;if(M==e.length||c+K>=t)return i+Math.min(K,t-c);if(c+=M-i,c+=r-c%r,i=M+1,c>=t)return i}}var ce=[""];function he(e){for(;ce.length<=e;)ce.push(ne(ce)+" ");return ce[e]}function ne(e){return e[e.length-1]}function de(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function se(e,t,r){for(var i=0,c=r(t);i<e.length&&r(e[i])<=c;)i++;e.splice(i,0,t)}function De(){}function Ne(e,t){var r;return Object.create?r=Object.create(e):(De.prototype=e,r=new De),t&&g(t,r),r}var Ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ae.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&Pe(e)?!0:t.test(e):Pe(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ge=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Oe(e){return e.charCodeAt(0)>=768&&ge.test(e)}function Ie(e,t,r){for(;(r<0?t>0:t<e.length)&&Oe(e.charAt(t));)t+=r;return t}function He(e,t,r){for(var i=t>r?-1:1;;){if(t==r)return t;var c=(t+r)/2,M=i<0?Math.ceil(c):Math.floor(c);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+i}}function Xe(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var c=!1,M=0;M<e.length;++M){var K=e[M];(K.from<r&&K.to>t||t==r&&K.to==t)&&(i(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",M),c=!0)}c||i(t,r,"ltr")}var qe=null;function Ze(e,t,r){var i;qe=null;for(var c=0;c<e.length;++c){var M=e[c];if(M.from<t&&M.to>t)return c;M.to==t&&(M.from!=M.to&&r=="before"?i=c:qe=c),M.from==t&&(M.from!=M.to&&r!="before"?i=c:qe=c)}return i!=null?i:qe}var nt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,M=/[LRr]/,K=/[Lb1n]/,Q=/[1n]/;function q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!i.test(te))return!1;for(var Me=te.length,ke=[],Ge=0;Ge<Me;++Ge)ke.push(r(te.charCodeAt(Ge)));for(var Ye=0,et=ye;Ye<Me;++Ye){var at=ke[Ye];at=="m"?ke[Ye]=et:et=at}for(var ht=0,st=ye;ht<Me;++ht){var ft=ke[ht];ft=="1"&&st=="r"?ke[ht]="n":M.test(ft)&&(st=ft,ft=="r"&&(ke[ht]="R"))}for(var Ct=1,Et=ke[0];Ct<Me-1;++Ct){var kt=ke[Ct];kt=="+"&&Et=="1"&&ke[Ct+1]=="1"?ke[Ct]="1":kt==","&&Et==ke[Ct+1]&&(Et=="1"||Et=="n")&&(ke[Ct]=Et),Et=kt}for(var Zt=0;Zt<Me;++Zt){var bn=ke[Zt];if(bn==",")ke[Zt]="N";else if(bn=="%"){var nn=void 0;for(nn=Zt+1;nn<Me&&ke[nn]=="%";++nn);for(var Kn=Zt&&ke[Zt-1]=="!"||nn<Me&&ke[nn]=="1"?"1":"N",Un=Zt;Un<nn;++Un)ke[Un]=Kn;Zt=nn-1}}for(var ln=0,Bn=ye;ln<Me;++ln){var wn=ke[ln];Bn=="L"&&wn=="1"?ke[ln]="L":M.test(wn)&&(Bn=wn)}for(var dn=0;dn<Me;++dn)if(c.test(ke[dn])){var un=void 0;for(un=dn+1;un<Me&&c.test(ke[un]);++un);for(var rn=(dn?ke[dn-1]:ye)=="L",jn=(un<Me?ke[un]:ye)=="L",ur=rn==jn?rn?"L":"R":ye,Ii=dn;Ii<un;++Ii)ke[Ii]=ur;dn=un-1}for(var Rn=[],li,_n=0;_n<Me;)if(K.test(ke[_n])){var Va=_n;for(++_n;_n<Me&&K.test(ke[_n]);++_n);Rn.push(new q(0,Va,_n))}else{var pi=_n,Gi=Rn.length,zi=pe=="rtl"?1:0;for(++_n;_n<Me&&ke[_n]!="L";++_n);for(var Dn=pi;Dn<_n;)if(Q.test(ke[Dn])){pi<Dn&&(Rn.splice(Gi,0,new q(1,pi,Dn)),Gi+=zi);var hr=Dn;for(++Dn;Dn<_n&&Q.test(ke[Dn]);++Dn);Rn.splice(Gi,0,new q(2,hr,Dn)),Gi+=zi,pi=Dn}else++Dn;pi<_n&&Rn.splice(Gi,0,new q(1,pi,_n))}return pe=="ltr"&&(Rn[0].level==1&&(li=te.match(/^\s+/))&&(Rn[0].from=li[0].length,Rn.unshift(new q(0,0,li[0].length))),ne(Rn).level==1&&(li=te.match(/\s+$/))&&(ne(Rn).to-=li[0].length,Rn.push(new q(0,Me-li[0].length,Me)))),pe=="rtl"?Rn.reverse():Rn}}();function $e(e,t){var r=e.order;return r==null&&(r=e.order=nt(e.text,t)),r}var Qe=[],Fe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||Qe).concat(r)}};function ut(e,t){return e._handlers&&e._handlers[t]||Qe}function lt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers,c=i&&i[t];if(c){var M=ie(c,r);M>-1&&(i[t]=c.slice(0,M).concat(c.slice(M+1)))}}}function je(e,t){var r=ut(e,t);if(!r.length)return;for(var i=Array.prototype.slice.call(arguments,2),c=0;c<r.length;++c)r[c].apply(null,i)}function We(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,r||t.type,e,t),fe(t)||t.codemirrorIgnore}function Ce(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ie(r,t[i])==-1&&r.push(t[i])}function _e(e,t){return ut(e,t).length>0}function Te(e){e.prototype.on=function(t,r){Fe(this,t,r)},e.prototype.off=function(t,r){lt(this,t,r)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function fe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ae(e),le(e)}function we(e){return e.target||e.srcElement}function Ue(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(z&&G<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),rt;function pt(e){if(rt==null){var t=f("span","\u200B");S(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(rt=t.offsetWidth<=1&&t.offsetHeight>2&&!(z&&G<8))}var r=rt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var ct;function At(e){if(ct!=null)return ct;var t=S(e,document.createTextNode("A\u062EA")),r=y(t,0,1).getBoundingClientRect(),i=y(t,1,2).getBoundingClientRect();return O(e),!r||r.left==r.right?!1:ct=i.right-r.right<3}var St=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],i=e.length;t<=i;){var c=e.indexOf(`
|
|
`,t);c==-1&&(c=e.length);var M=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),K=M.indexOf("\r");K!=-1?(r.push(M.slice(0,K)),t+=K+1):(r.push(M),t=c+1)}return r}:function(e){return e.split(/\r\n?|\n/)},dt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),gt=null;function Lt(e){if(gt!=null)return gt;var t=S(e,f("span","x")),r=t.getBoundingClientRect(),i=y(t,0,1).getBoundingClientRect();return gt=Math.abs(r.left-i.left)>1}var Dt={},tt={};function fn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Dt[e]=t}function En(e,t){tt[e]=t}function bt(e){if(typeof e=="string"&&tt.hasOwnProperty(e))e=tt[e];else if(e&&typeof e.name=="string"&&tt.hasOwnProperty(e.name)){var t=tt[e.name];typeof t=="string"&&(t={name:t}),e=Ne(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vt(e,t){t=bt(t);var r=Dt[t.name];if(!r)return Vt(e,"text/plain");var i=r(e,t);if(_t.hasOwnProperty(t.name)){var c=_t[t.name];for(var M in c){if(!c.hasOwnProperty(M))continue;i.hasOwnProperty(M)&&(i["_"+M]=i[M]),i[M]=c[M]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)i[K]=t.modeProps[K];return i}var _t={};function xt(e,t){var r=_t.hasOwnProperty(e)?_t[e]:_t[e]={};g(t,r)}function Bt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var c=t[i];c instanceof Array&&(c=c.concat([])),r[i]=c}return r}function $t(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function pn(e,t,r){return e.startState?e.startState(t,r):!0}var Ut=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Ut.prototype.eol=function(){return this.pos>=this.string.length},Ut.prototype.sol=function(){return this.pos==this.lineStart},Ut.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ut.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ut.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Ut.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ut.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ut.prototype.skipToEnd=function(){this.pos=this.string.length},Ut.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ut.prototype.backUp=function(e){this.pos-=e},Ut.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ut.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ut.prototype.match=function(e,t,r){if(typeof e=="string"){var i=function(K){return r?K.toLowerCase():K},c=this.string.substr(this.pos,e.length);if(i(c)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Ut.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ut.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ut.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ut.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function mt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var i=0;;++i){var c=r.children[i],M=c.chunkSize();if(t<M){r=c;break}t-=M}return r.lines[t]}function Hn(e,t,r){var i=[],c=t.line;return e.iter(t.line,r.line+1,function(M){var K=M.text;c==r.line&&(K=K.slice(0,r.ch)),c==t.line&&(K=K.slice(t.ch)),i.push(K),++c}),i}function Jt(e,t,r){var i=[];return e.iter(t,r,function(c){i.push(c.text)}),i}function en(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function It(e){if(e.parent==null)return null;for(var t=e.parent,r=ie(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var c=0;!(i.children[c]==t);++c)r+=i.children[c].chunkSize();return r+t.first}function hn(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var c=e.children[i],M=c.height;if(t<M){e=c;continue e}t-=M,r+=c.chunkSize()}return r}while(!e.lines);for(var K=0;K<e.lines.length;++K){var Q=e.lines[K],q=Q.height;if(t<q)break;t-=q}return r+K}function kn(e,t){return t>=e.first&&t<e.first+e.size}function $n(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Je(e,t,r){if(r===void 0&&(r=null),!(this instanceof Je))return new Je(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Ot(e,t){return e.line-t.line||e.ch-t.ch}function mi(e,t){return e.sticky==t.sticky&&Ot(e,t)==0}function gi(e){return Je(e.line,e.ch)}function vi(e,t){return Ot(e,t)<0?t:e}function yi(e,t){return Ot(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function _(e,t){if(t.line<e.first)return Je(e.first,0);var r=e.first+e.size-1;return t.line>r?Je(r,mt(e,r).text.length):k(t,mt(e,t.line).text.length)}function k(e,t){var r=e.ch;return r==null||r>t?Je(e.line,t):r<0?Je(e.line,0):e}function H(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=_(e,t[i]);return r}var ee=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,r){return t instanceof ee?new V(e,Bt(e.mode,t.state),r,t.lookAhead):new V(e,Bt(e.mode,t),r)},V.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ee(e,t,r,i){var c=[e.state.modeGen],M={};Sn(e,t.text,e.doc.mode,r,function(te,pe){return c.push(te,pe)},M,i);for(var K=r.state,Q=function(te){r.baseTokens=c;var pe=e.state.overlays[te],ye=1,Me=0;r.state=!0,Sn(e,t.text,pe.mode,r,function(ke,Ge){for(var Ye=ye;Me<ke;){var et=c[ye];et>ke&&c.splice(ye,1,ke,c[ye+1],et),ye+=2,Me=Math.min(ke,et)}if(!Ge)return;if(pe.opaque)c.splice(Ye,ye-Ye,ke,"overlay "+Ge),ye=Ye+2;else for(;Ye<ye;Ye+=2){var at=c[Ye+1];c[Ye+1]=(at?at+" ":"")+"overlay "+Ge}},M),r.state=K,r.baseTokens=null,r.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:c,classes:M.bgClass||M.textClass?M:null}}function Ke(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=it(e,It(t)),c=t.text.length>e.options.maxHighlightLength&&Bt(e.doc.mode,i.state),M=Ee(e,t,i);c&&(i.state=c),t.stateAfter=i.save(!c),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function it(e,t,r){var i=e.doc,c=e.display;if(!i.mode.startState)return new V(i,!0,t);var M=Cn(e,t,r),K=M>i.first&&mt(i,M-1).stateAfter,Q=K?V.fromSaved(i,K,M):new V(i,pn(i.mode),M);return i.iter(M,t,function(q){vt(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?Q.save():null,Q.nextLine()}),r&&(i.modeFrontier=Q.line),Q}function vt(e,t,r,i){var c=e.doc.mode,M=new Ut(t,e.options.tabSize,r);for(M.start=M.pos=i||0,t==""&&Ve(c,r.state);!M.eol();)Tt(c,M,r.state),M.start=M.pos}function Ve(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=$t(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Tt(e,t,r,i){for(var c=0;c<10;c++){i&&(i[0]=$t(e,r).mode);var M=e.token(t,r);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Wt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function qt(e,t,r,i){var c=e.doc,M=c.mode,K;t=_(c,t);var Q=mt(c,t.line),q=it(e,t.line,r),te=new Ut(Q.text,e.options.tabSize,q),pe;for(i&&(pe=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=Tt(M,te,q.state),i&&pe.push(new Wt(te,K,Bt(c.mode,q.state)));return i?pe:new Wt(te,K,q.state)}function Wn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";t[i]==null?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function Sn(e,t,r,i,c,M,K){var Q=r.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,te=null,pe=new Ut(t,e.options.tabSize,i),ye,Me=e.options.addModeClass&&[null];for(t==""&&Wn(Ve(r,i.state),M);!pe.eol();){if(pe.pos>e.options.maxHighlightLength?(Q=!1,K&&vt(e,t,i,pe.pos),pe.pos=t.length,ye=null):ye=Wn(Tt(r,pe,i.state,Me),M),Me){var ke=Me[0].name;ke&&(ye="m-"+(ye?ke+" "+ye:ke))}if(!Q||te!=ye){for(;q<pe.start;)q=Math.min(pe.start,q+5e3),c(q,te);te=ye}pe.start=pe.pos}for(;q<pe.pos;){var Ge=Math.min(pe.pos,q+5e3);c(Ge,te),q=Ge}}function Cn(e,t,r){for(var i,c,M=e.doc,K=r?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>K;--Q){if(Q<=M.first)return M.first;var q=mt(M,Q-1),te=q.stateAfter;if(te&&(!r||Q+(te instanceof ee?te.lookAhead:0)<=M.modeFrontier))return Q;var pe=W(q.text,null,e.options.tabSize);(c==null||i>pe)&&(c=Q-1,i=pe)}return c}function Zn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,i=t-1;i>r;i--){var c=mt(e,i).stateAfter;if(c&&(!(c instanceof ee)||i+c.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Di=!1,mn=!1;function Vn(){Di=!0}function ui(){mn=!0}function hi(e,t,r){this.marker=e,this.from=t,this.to=r}function Gn(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function ki(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function bi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ki(e,t,r){var i;if(e)for(var c=0;c<e.length;++c){var M=e[c],K=M.marker,Q=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);if(Q||M.from==t&&K.type=="bookmark"&&(!r||!M.marker.insertLeft)){var q=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);(i||(i=[])).push(new hi(K,M.from,q?null:M.to))}}return i}function Vi(e,t,r){var i;if(e)for(var c=0;c<e.length;++c){var M=e[c],K=M.marker,Q=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);if(Q||M.from==t&&K.type=="bookmark"&&(!r||M.marker.insertLeft)){var q=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);(i||(i=[])).push(new hi(K,q?null:M.from-t,M.to==null?null:M.to-t))}}return i}function qn(e,t){if(t.full)return null;var r=kn(e,t.from.line)&&mt(e,t.from.line).markedSpans,i=kn(e,t.to.line)&&mt(e,t.to.line).markedSpans;if(!r&&!i)return null;var c=t.from.ch,M=t.to.ch,K=Ot(t.from,t.to)==0,Q=Ki(r,c,K),q=Vi(i,M,K),te=t.text.length==1,pe=ne(t.text).length+(te?c:0);if(Q)for(var ye=0;ye<Q.length;++ye){var Me=Q[ye];if(Me.to==null){var ke=Gn(q,Me.marker);ke?te&&(Me.to=ke.to==null?null:ke.to+pe):Me.to=c}}if(q)for(var Ge=0;Ge<q.length;++Ge){var Ye=q[Ge];if(Ye.to!=null&&(Ye.to+=pe),Ye.from==null){var et=Gn(Q,Ye.marker);et||(Ye.from=pe,te&&(Q||(Q=[])).push(Ye))}else Ye.from+=pe,te&&(Q||(Q=[])).push(Ye)}Q&&(Q=Jn(Q)),q&&q!=Q&&(q=Jn(q));var at=[Q];if(!te){var ht=t.text.length-2,st;if(ht>0&&Q)for(var ft=0;ft<Q.length;++ft)Q[ft].to==null&&(st||(st=[])).push(new hi(Q[ft].marker,null,null));for(var Ct=0;Ct<ht;++Ct)at.push(st);at.push(q)}return at}function Jn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _i(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(ke){if(ke.markedSpans)for(var Ge=0;Ge<ke.markedSpans.length;++Ge){var Ye=ke.markedSpans[Ge].marker;Ye.readOnly&&(!i||ie(i,Ye)==-1)&&(i||(i=[])).push(Ye)}}),!i)return null;for(var c=[{from:t,to:r}],M=0;M<i.length;++M)for(var K=i[M],Q=K.find(0),q=0;q<c.length;++q){var te=c[q];if(Ot(te.to,Q.from)<0||Ot(te.from,Q.to)>0)continue;var pe=[q,1],ye=Ot(te.from,Q.from),Me=Ot(te.to,Q.to);(ye<0||!K.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Q.from}),(Me>0||!K.inclusiveRight&&!Me)&&pe.push({from:Q.to,to:te.to}),c.splice.apply(c,pe),q+=pe.length-3}return c}function cr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Ei(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function an(e){return e.inclusiveLeft?-1:0}function Gt(e){return e.inclusiveRight?1:0}function xn(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var i=e.find(),c=t.find(),M=Ot(i.from,c.from)||an(e)-an(t);if(M)return-M;var K=Ot(i.to,c.to)||Gt(e)-Gt(t);return K||t.id-e.id}function Pt(e,t){var r=mn&&e.markedSpans,i;if(r)for(var c=void 0,M=0;M<r.length;++M)c=r[M],c.marker.collapsed&&(t?c.from:c.to)==null&&(!i||xn(i,c.marker)<0)&&(i=c.marker);return i}function on(e){return Pt(e,!0)}function Xt(e){return Pt(e,!1)}function ri(e,t){var r=mn&&e.markedSpans,i;if(r)for(var c=0;c<r.length;++c){var M=r[c];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!i||xn(i,M.marker)<0)&&(i=M.marker)}return i}function gn(e,t,r,i,c){var M=mt(e,t),K=mn&&M.markedSpans;if(K)for(var Q=0;Q<K.length;++Q){var q=K[Q];if(!q.marker.collapsed)continue;var te=q.marker.find(0),pe=Ot(te.from,r)||an(q.marker)-an(c),ye=Ot(te.to,i)||Gt(q.marker)-Gt(c);if(pe>=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ot(te.to,r)>=0:Ot(te.to,r)>0)||pe>=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ot(te.from,i)<=0:Ot(te.from,i)<0))return!0}}function Ln(e){for(var t;t=on(e);)e=t.find(-1,!0).line;return e}function Xi(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,r;t=Xt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function dr(e,t){var r=mt(e,t),i=Ln(r);return r==i?t:It(i)}function Ti(e,t){if(t>e.lastLine())return t;var r=mt(e,t),i;if(!ai(e,r))return t;for(;i=Xt(r);)r=i.find(1,!0).line;return It(r)+1}function ai(e,t){var r=mn&&t.markedSpans;if(r)for(var i=void 0,c=0;c<r.length;++c){if(i=r[c],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&fr(e,t,i))return!0}}function fr(e,t,r){if(r.to==null){var i=r.marker.find(1,!0);return fr(e,i.line,Gn(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var c=void 0,M=0;M<t.markedSpans.length;++M)if(c=t.markedSpans[M],c.marker.collapsed&&!c.marker.widgetNode&&c.from==r.to&&(c.to==null||c.to!=r.from)&&(c.marker.inclusiveLeft||r.marker.inclusiveRight)&&fr(e,t,c))return!0}function ei(e){e=Ln(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var c=r.lines[i];if(c==e)break;t+=c.height}for(var M=r.parent;M;r=M,M=r.parent)for(var K=0;K<M.children.length;++K){var Q=M.children[K];if(Q==r)break;t+=Q.height}return t}function pr(e){if(e.height==0)return 0;for(var t=e.text.length,r,i=e;r=on(i);){var c=r.find(0,!0);i=c.from.line,t+=c.from.ch-c.to.ch}for(i=e;r=Xt(i);){var M=r.find(0,!0);t-=i.text.length-M.from.ch,i=M.to.line,t+=i.text.length-M.to.ch}return t}function jr(e){var t=e.display,r=e.doc;t.maxLine=mt(r,r.first),t.maxLineLength=pr(t.maxLine),t.maxLineChanged=!0,r.iter(function(i){var c=pr(i);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=i)})}var Mi=function(e,t,r){this.text=e,Ei(this,t),this.height=r?r(this):1};Mi.prototype.lineNo=function(){return It(this)},Te(Mi);function ua(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cr(e),Ei(e,r);var c=i?i(e):1;c!=e.height&&en(e,c)}function yt(e){e.parent=null,cr(e)}var Rt={},wt={};function Mt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?wt:Rt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Ht(e,t){var r=C("span",null,null,n?"padding-right: .1px":null),i={pre:C("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var M=c?t.rest[c-1]:t.line,K=void 0;i.pos=0,i.addToken=jt,At(e.display.measure)&&(K=$e(M,e.doc.direction))&&(i.addToken=Mn(i.addToken,K)),i.map=[];var Q=t!=e.display.externalMeasured&&It(M);ci(M,i,Ke(e,M,Q)),M.styleClasses&&(M.styleClasses.bgClass&&(i.bgClass=x(M.styleClasses.bgClass,i.bgClass||"")),M.styleClasses.textClass&&(i.textClass=x(M.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(pt(e.display.measure))),c==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var q=i.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=x(i.pre.className,i.textClass||"")),i}function Qt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jt(e,t,r,i,c,M,K){if(!t)return;var Q=e.splitSpaces?cn(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,pe),z&&G<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){q.lastIndex=ye;var Me=q.exec(t),ke=Me?Me.index-ye:t.length-ye;if(ke){var Ge=document.createTextNode(Q.slice(ye,ye+ke));z&&G<9?pe.appendChild(f("span",[Ge])):pe.appendChild(Ge),e.map.push(e.pos,e.pos+ke,Ge),e.col+=ke,e.pos+=ke}if(!Me)break;ye+=ke+1;var Ye=void 0;if(Me[0]==" "){var et=e.cm.options.tabSize,at=et-e.col%et;Ye=pe.appendChild(f("span",he(at),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=at}else Me[0]=="\r"||Me[0]==`
|
|
`?(Ye=pe.appendChild(f("span",Me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Me[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Me[0]),Ye.setAttribute("cm-text",Me[0]),z&&G<9?pe.appendChild(f("span",[Ye])):pe.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,r||i||c||te||M||K){var ht=r||"";i&&(ht+=i),c&&(ht+=c);var st=f("span",[pe],ht,M);if(K)for(var ft in K)K.hasOwnProperty(ft)&&ft!="style"&&ft!="class"&&st.setAttribute(ft,K[ft]);return e.content.appendChild(st)}e.content.appendChild(pe)}function cn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,i="",c=0;c<e.length;c++){var M=e.charAt(c);M==" "&&r&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(M="\xA0"),i+=M,r=M==" "}return i}function Mn(e,t){return function(r,i,c,M,K,Q,q){c=c?c+" cm-force-border":"cm-force-border";for(var te=r.pos,pe=te+i.length;;){for(var ye=void 0,Me=0;Me<t.length&&!(ye=t[Me],ye.to>te&&ye.from<=te);Me++);if(ye.to>=pe)return e(r,i,c,M,K,Q,q);e(r,i.slice(0,ye.to-te),c,M,null,Q,q),M=null,i=i.slice(ye.to-te),te=ye.to}}}function Nt(e,t,r,i){var c=!i&&r.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!i&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",r.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function ci(e,t,r){var i=e.markedSpans,c=e.text,M=0;if(!i){for(var K=1;K<r.length;K+=2)t.addToken(t,c.slice(M,M=r[K]),Mt(r[K+1],t.cm.options));return}for(var Q=c.length,q=0,te=1,pe="",ye,Me,ke=0,Ge,Ye,et,at,ht;;){if(ke==q){Ge=Ye=et=Me="",ht=null,at=null,ke=Infinity;for(var st=[],ft=void 0,Ct=0;Ct<i.length;++Ct){var Et=i[Ct],kt=Et.marker;if(kt.type=="bookmark"&&Et.from==q&&kt.widgetNode)st.push(kt);else if(Et.from<=q&&(Et.to==null||Et.to>q||kt.collapsed&&Et.to==q&&Et.from==q)){if(Et.to!=null&&Et.to!=q&&ke>Et.to&&(ke=Et.to,Ye=""),kt.className&&(Ge+=" "+kt.className),kt.css&&(Me=(Me?Me+";":"")+kt.css),kt.startStyle&&Et.from==q&&(et+=" "+kt.startStyle),kt.endStyle&&Et.to==ke&&(ft||(ft=[])).push(kt.endStyle,Et.to),kt.title&&((ht||(ht={})).title=kt.title),kt.attributes)for(var Zt in kt.attributes)(ht||(ht={}))[Zt]=kt.attributes[Zt];kt.collapsed&&(!at||xn(at.marker,kt)<0)&&(at=Et)}else Et.from>q&&ke>Et.from&&(ke=Et.from)}if(ft)for(var bn=0;bn<ft.length;bn+=2)ft[bn+1]==ke&&(Ye+=" "+ft[bn]);if(!at||at.from==q)for(var nn=0;nn<st.length;++nn)Nt(t,0,st[nn]);if(at&&(at.from||0)==q){if(Nt(t,(at.to==null?Q+1:at.to)-q,at.marker,at.from==null),at.to==null)return;at.to==q&&(at=!1)}}if(q>=Q)break;for(var Kn=Math.min(Q,ke);;){if(pe){var Un=q+pe.length;if(!at){var ln=Un>Kn?pe.slice(0,Kn-q):pe;t.addToken(t,ln,ye?ye+Ge:Ge,et,q+ln.length==ke?Ye:"",Me,ht)}if(Un>=Kn){pe=pe.slice(Kn-q),q=Kn;break}q=Un,et=""}pe=c.slice(M,M=r[te++]),ye=Mt(r[te++],t.cm.options)}}}function zt(e,t,r){this.line=t,this.rest=xi(t),this.size=this.rest?It(ne(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ai(e,t)}function Pn(e,t,r){for(var i=[],c,M=t;M<r;M=c){var K=new zt(e.doc,mt(e.doc,M),M);c=M+K.size,i.push(K)}return i}var An=null;function Qn(e){An?An.ops.push(e):e.ownsGroup=An={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var c=e.ops[i];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{An=null,t(r)}}var mr=null;function Tn(e,t){var r=ut(e,t);if(!r.length)return;var i=Array.prototype.slice.call(arguments,2),c;An?c=An.delayedCallbacks:mr?c=mr:(c=mr=[],setTimeout(Do,0));for(var M=function(Q){c.push(function(){return r[Q].apply(null,i)})},K=0;K<r.length;++K)M(K)}function Do(){var e=mr;mr=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,i){for(var c=0;c<t.changes.length;c++){var M=t.changes[c];M=="text"?Mo(e,t):M=="gutter"?Ja(e,t,r,i):M=="class"?ha(e,t):M=="widget"&&Po(e,t,i)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),z&&G<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=gr(t);t.background=i.insertBefore(f("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Ht(e,t)}function Mo(e,t){var r=t.text.className,i=$a(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var c=gr(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var K=gr(t),Q=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),K.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(f("div",$n(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,pe=M.hasOwnProperty(te)&&M[te];pe&&Q.appendChild(f("div",[pe],"CodeMirror-gutter-elt","left: "+i.gutterLeft[te]+"px; width: "+i.gutterWidth[te]+"px"))}}}function Po(e,t,r){t.alignable&&(t.alignable=null);for(var i=L("CodeMirror-linewidget"),c=t.node.firstChild,M=void 0;c;c=M)M=c.nextSibling,i.test(c.className)&&t.node.removeChild(c);Qa(e,t,r)}function No(e,t,r,i){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,r,i),Qa(e,t,i),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)Za(e,t.rest[i],t,r,!1)}function Za(e,t,r,i,c){if(!t.widgets)return;for(var M=gr(r),K=0,Q=t.widgets;K<Q.length;++K){var q=Q[K],te=f("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(q,te,r,i),e.display.input.setUneditable(te),c&&q.above?M.insertBefore(te,r.gutter||r.text):M.appendChild(te),Tn(q,"redraw")}}function Fo(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var c=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(c-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),S(t.display.measure,f("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function di(e,t){for(var r=we(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=S(e.measure,f("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function si(e){return ue-e.display.nativeBarWidth}function Pi(e){return e.display.scroller.clientWidth-si(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-si(e)-e.display.barHeight}function Uo(e,t,r){var i=e.options.lineWrapping,c=i&&Pi(e);if(!t.measure.heights||i&&t.measure.width!=c){var M=t.measure.heights=[];if(i){t.measure.width=c;for(var K=t.text.firstChild.getClientRects(),Q=0;Q<K.length-1;Q++){var q=K[Q],te=K[Q+1];Math.abs(q.bottom-te.bottom)>2&&M.push((q.bottom+te.top)/2-r.top)}}M.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var c=0;c<e.rest.length;c++)if(It(e.rest[c])>r)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Ln(t);var r=It(t),i=e.display.externalMeasured=new zt(e.doc,t,r);i.lineN=r;var c=i.built=Ht(e,i);return i.text=c.pre,S(e.display.lineMeasure,c.pre),i}function ts(e,t,r,i){return oi(e,Yi(e,t),r,i)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Yi(e,t){var r=It(t),i=fa(e,r);i&&!i.text?i=null:i&&i.changes&&(Ya(e,i,r,ba(e)),e.curOp.forceUpdate=!0),i||(i=Bo(e,t));var c=es(i,t,r);return{line:t,view:i,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function oi(e,t,r,i,c){t.before&&(r=-1);var M=r+(i||""),K;return t.cache.hasOwnProperty(M)?K=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,r,i),K.bogus||(t.cache[M]=K)),{left:K.left,right:K.right,top:c?K.rtop:K.top,bottom:c?K.rbottom:K.bottom}}var ns={left:0,right:0,top:0,bottom:0};function is(e,t,r){for(var i,c,M,K,Q,q,te=0;te<e.length;te+=3)if(Q=e[te],q=e[te+1],t<Q?(c=0,M=1,K="left"):t<q?(c=t-Q,M=c+1):(te==e.length-3||t==q&&e[te+3]>t)&&(M=q-Q,c=M-1,t>=q&&(K="right")),c!=null){if(i=e[te+2],Q==q&&r==(i.insertLeft?"left":"right")&&(K=r),r=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],K="left";if(r=="right"&&c==q-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)i=e[(te+=3)+2],K="right";break}return{node:i,start:c,end:M,collapse:K,coverStart:Q,coverEnd:q}}function jo(e,t){var r=ns;if(t=="left")for(var i=0;i<e.length&&!((r=e[i]).left!=r.right);i++);else for(var c=e.length-1;c>=0&&!((r=e[c]).left!=r.right);c--);return r}function Ho(e,t,r,i){var c=is(t.map,r,i),M=c.node,K=c.start,Q=c.end,q=c.collapse,te;if(M.nodeType==3){for(var pe=0;pe<4;pe++){for(;K&&Oe(t.line.text.charAt(c.coverStart+K));)--K;for(;c.coverStart+Q<c.coverEnd&&Oe(t.line.text.charAt(c.coverStart+Q));)++Q;if(z&&G<9&&K==0&&Q==c.coverEnd-c.coverStart?te=M.parentNode.getBoundingClientRect():te=jo(y(M,K,Q).getClientRects(),i),te.left||te.right||K==0)break;Q=K,K=K-1,q="right"}z&&G<11&&(te=Wo(e.display.measure,te))}else{K>0&&(q=i="right");var ye;e.options.lineWrapping&&(ye=M.getClientRects()).length>1?te=ye[i=="right"?ye.length-1:0]:te=M.getBoundingClientRect()}if(z&&G<9&&!K&&(!te||!te.left&&!te.right)){var Me=M.parentNode.getClientRects()[0];Me?te={left:Me.left,right:Me.left+Ji(e.display),top:Me.top,bottom:Me.bottom}:te=ns}for(var ke=te.top-t.rect.top,Ge=te.bottom-t.rect.top,Ye=(ke+Ge)/2,et=t.view.measure.heights,at=0;at<et.length-1&&!(Ye<et[at]);at++);var ht=at?et[at-1]:0,st=et[at],ft={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:ht,bottom:st};return!te.left&&!te.right&&(ft.bogus=!0),e.options.singleCursorHeightPerLine||(ft.rtop=ke,ft.rbottom=Ge),ft}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Lt(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function rs(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function as(e){e.display.externalMeasure=null,O(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function yr(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=vr(e.widgets[r]));return t}function Wr(e,t,r,i,c){if(!c){var M=pa(t);r.top+=M,r.bottom+=M}if(i=="line")return r;i||(i="local");var K=ei(t);if(i=="local"?K+=Hr(e.display):K-=e.display.viewOffset,i=="page"||i=="window"){var Q=e.display.lineSpace.getBoundingClientRect();K+=Q.top+(i=="window"?0:os());var q=Q.left+(i=="window"?0:ss());r.left+=q,r.right+=q}return r.top+=K,r.bottom+=K,r}function ls(e,t,r){if(r=="div")return t;var i=t.left,c=t.top;if(r=="page")i-=ss(),c-=os();else if(r=="local"||!r){var M=e.display.sizer.getBoundingClientRect();i+=M.left,c+=M.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:i-K.left,top:c-K.top}}function ma(e,t,r,i,c){return i||(i=mt(e.doc,t.line)),Wr(e,i,ts(e,i,t.ch,c),r)}function ti(e,t,r,i,c,M){i=i||mt(e.doc,t.line),c||(c=Yi(e,i));function K(Ge,Ye){var et=oi(e,c,Ge,Ye?"right":"left",M);return Ye?et.left=et.right:et.right=et.left,Wr(e,i,et,r)}var Q=$e(i,e.doc.direction),q=t.ch,te=t.sticky;if(q>=i.text.length?(q=i.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return K(te=="before"?q-1:q,te=="before");function pe(Ge,Ye,et){var at=Q[Ye],ht=at.level==1;return K(et?Ge-1:Ge,ht!=et)}var ye=Ze(Q,q,te),Me=qe,ke=pe(q,ye,te=="before");return Me!=null&&(ke.other=pe(q,Me,te!="before")),ke}function us(e,t){var r=0;t=_(e.doc,t),e.options.lineWrapping||(r=Ji(e.display)*t.ch);var i=mt(e.doc,t.line),c=ei(i)+Hr(e.display);return{left:r,right:r,top:c,bottom:c+i.height}}function ga(e,t,r,i,c){var M=Je(e,t,r);return M.xRel=c,i&&(M.outside=i),M}function va(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,r<0)return ga(i.first,0,null,-1,-1);var c=hn(i,r),M=i.first+i.size-1;if(c>M)return ga(i.first+i.size-1,mt(i,M).text.length,null,1,1);t<0&&(t=0);for(var K=mt(i,c);;){var Q=Go(e,K,c,t,r),q=ri(K,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==c)return te;K=mt(i,c=te.line)}}function hs(e,t,r,i){i-=pa(t);var c=t.text.length,M=He(function(K){return oi(e,r,K-1).bottom<=i},c,0);return c=He(function(K){return oi(e,r,K).top>i},M,c),{begin:M,end:c}}function cs(e,t,r,i){r||(r=Yi(e,t));var c=Wr(e,t,oi(e,r,i),"line").top;return hs(e,t,r,c)}function ya(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function Go(e,t,r,i,c){c-=ei(t);var M=Yi(e,t),K=pa(t),Q=0,q=t.text.length,te=!0,pe=$e(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?Ko:zo)(e,t,r,M,pe,i,c);te=ye.level!=1,Q=te?ye.from:ye.to-1,q=te?ye.to:ye.from-1}var Me=null,ke=null,Ge=He(function(Ct){var Et=oi(e,M,Ct);return Et.top+=K,Et.bottom+=K,ya(Et,i,c,!1)?(Et.top<=c&&Et.left<=i&&(Me=Ct,ke=Et),!0):!1},Q,q),Ye,et,at=!1;if(ke){var ht=i-ke.left<ke.right-i,st=ht==te;Ge=Me+(st?0:1),et=st?"after":"before",Ye=ht?ke.left:ke.right}else{!te&&(Ge==q||Ge==Q)&&Ge++,et=Ge==0?"after":Ge==t.text.length?"before":oi(e,M,Ge-(te?1:0)).bottom+K<=c==te?"after":"before";var ft=ti(e,Je(r,Ge,et),"line",t,M);Ye=ft.left,at=c<ft.top?-1:c>=ft.bottom?1:0}return Ge=Ie(t.text,Ge,1),ga(r,Ge,et,at,i-Ye)}function zo(e,t,r,i,c,M,K){var Q=He(function(ye){var Me=c[ye],ke=Me.level!=1;return ya(ti(e,Je(r,ke?Me.to:Me.from,ke?"before":"after"),"line",t,i),M,K,!0)},0,c.length-1),q=c[Q];if(Q>0){var te=q.level!=1,pe=ti(e,Je(r,te?q.from:q.to,te?"after":"before"),"line",t,i);ya(pe,M,K,!0)&&pe.top>K&&(q=c[Q-1])}return q}function Ko(e,t,r,i,c,M,K){var Q=hs(e,t,i,K),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Me=0;Me<c.length;Me++){var ke=c[Me];if(ke.from>=te||ke.to<=q)continue;var Ge=ke.level!=1,Ye=oi(e,i,Ge?Math.min(te,ke.to)-1:Math.max(q,ke.from)).right,et=Ye<M?M-Ye+1e9:Ye-M;(!pe||ye>et)&&(pe=ke,ye=et)}return pe||(pe=c[c.length-1]),pe.from<q&&(pe={from:q,to:pe.to,level:pe.level}),pe.to>te&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Ni;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ni==null){Ni=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ni.appendChild(document.createTextNode("x")),Ni.appendChild(f("br"));Ni.appendChild(document.createTextNode("x"))}S(e.measure,Ni);var r=Ni.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),O(e.measure),r||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),r=f("pre",[t],"CodeMirror-line-like");S(e.measure,r);var i=t.getBoundingClientRect(),c=(i.right-i.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,r={},i={},c=t.gutters.clientLeft,M=t.gutters.firstChild,K=0;M;M=M.nextSibling,++K){var Q=e.display.gutterSpecs[K].className;r[Q]=M.offsetLeft+M.clientLeft+c,i[Q]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=$i(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(c){if(ai(e.doc,c))return 0;var M=0;if(c.widgets)for(var K=0;K<c.widgets.length;K++)c.widgets[K].height&&(M+=c.widgets[K].height);return r?M+(Math.ceil(c.text.length/i)||1)*t:M+t}}function Ea(e){var t=e.doc,r=ds(e);t.iter(function(i){var c=r(i);c!=i.height&&en(i,c)})}function Fi(e,t,r,i){var c=e.display;if(!r&&we(t).getAttribute("cm-not-content")=="true")return null;var M,K,Q=c.lineSpace.getBoundingClientRect();try{M=t.clientX-Q.left,K=t.clientY-Q.top}catch(ye){return null}var q=va(e,M,K),te;if(i&&q.xRel>0&&(te=mt(e.doc,q.line).text).length==q.ch){var pe=W(te,te.length,e.options.tabSize)-te.length;q=Je(q.line,Math.max(0,Math.round((M-qa(e.display).left)/Ji(e.display))-pe))}return q}function Ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,t<0)return i}function Nn(e,t,r,i){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),i||(i=0);var c=e.display;if(i&&r<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)mn&&dr(e.doc,t)<c.viewTo&&Si(e);else if(r<=c.viewFrom)mn&&Ti(e.doc,r+i)>c.viewFrom?Si(e):(c.viewFrom+=i,c.viewTo+=i);else if(t<=c.viewFrom&&r>=c.viewTo)Si(e);else if(t<=c.viewFrom){var M=Gr(e,r,r+i,1);M?(c.view=c.view.slice(M.index),c.viewFrom=M.lineN,c.viewTo+=i):Si(e)}else if(r>=c.viewTo){var K=Gr(e,t,t,-1);K?(c.view=c.view.slice(0,K.index),c.viewTo=K.lineN):Si(e)}else{var Q=Gr(e,t,t,-1),q=Gr(e,r,r+i,1);Q&&q?(c.view=c.view.slice(0,Q.index).concat(Pn(e,Q.lineN,q.lineN)).concat(c.view.slice(q.index)),c.viewTo+=i):Si(e)}var te=c.externalMeasured;te&&(r<te.lineN?te.lineN+=i:t<te.lineN+te.size&&(c.externalMeasured=null))}function wi(e,t,r){e.curOp.viewChanged=!0;var i=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var M=i.view[Ui(e,t)];if(M.node==null)return;var K=M.changes||(M.changes=[]);ie(K,r)==-1&&K.push(r)}function Si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,r,i){var c=Ui(e,t),M,K=e.display.view;if(!mn||r==e.doc.first+e.doc.size)return{index:c,lineN:r};for(var Q=e.display.viewFrom,q=0;q<c;q++)Q+=K[q].size;if(Q!=t){if(i>0){if(c==K.length-1)return null;M=Q+K[c].size-t,c++}else M=Q-t;t+=M,r+=M}for(;dr(e.doc,r)!=r;){if(c==(i<0?0:K.length-1))return null;r+=i*K[c-(i<0?1:0)].size,c+=i}return{index:c,lineN:r}}function Vo(e,t,r){var i=e.display,c=i.view;c.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=Pn(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=Pn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Ui(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(Pn(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,Ui(e,r)))),i.viewTo=r}function fs(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var c=t[i];!c.hidden&&(!c.node||c.changes)&&++r}return r}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,i={},c=i.cursors=document.createDocumentFragment(),M=i.selection=document.createDocumentFragment(),K=0;K<r.sel.ranges.length;K++){if(!t&&K==r.sel.primIndex)continue;var Q=r.sel.ranges[K];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&ms(e,Q.head,c),q||Xo(e,Q,M)}return i}function ms(e,t,r){var i=ti(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=r.appendChild(f("div","\xA0","CodeMirror-cursor"));if(c.style.left=i.left+"px",c.style.top=i.top+"px",c.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var M=r.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=i.other.left+"px",M.style.top=i.other.top+"px",M.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function zr(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var i=e.display,c=e.doc,M=document.createDocumentFragment(),K=qa(e.display),Q=K.left,q=Math.max(i.sizerWidth,Pi(e)-i.sizer.offsetLeft)-K.right,te=c.direction=="ltr";function pe(st,ft,Ct,Et){ft<0&&(ft=0),ft=Math.round(ft),Et=Math.round(Et),M.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+st+`px;
|
|
top: `+ft+"px; width: "+(Ct==null?q-st:Ct)+`px;
|
|
height: `+(Et-ft)+"px"))}function ye(st,ft,Ct){var Et=mt(c,st),kt=Et.text.length,Zt,bn;function nn(ln,Bn){return ma(e,Je(st,ln),"div",Et,Bn)}function Kn(ln,Bn,wn){var dn=cs(e,Et,null,ln),un=Bn=="ltr"==(wn=="after")?"left":"right",rn=wn=="after"?dn.begin:dn.end-(/\s/.test(Et.text.charAt(dn.end-1))?2:1);return nn(rn,un)[un]}var Un=$e(Et,c.direction);return Xe(Un,ft||0,Ct==null?kt:Ct,function(ln,Bn,wn,dn){var un=wn=="ltr",rn=nn(ln,un?"left":"right"),jn=nn(Bn-1,un?"right":"left"),ur=ft==null&&ln==0,Ii=Ct==null&&Bn==kt,Rn=dn==0,li=!Un||dn==Un.length-1;if(jn.top-rn.top<=3){var _n=(te?ur:Ii)&&Rn,Va=(te?Ii:ur)&&li,pi=_n?Q:(un?rn:jn).left,Gi=Va?q:(un?jn:rn).right;pe(pi,rn.top,Gi-pi,rn.bottom)}else{var zi,Dn,hr,Xa;un?(zi=te&&ur&&Rn?Q:rn.left,Dn=te?q:Kn(ln,wn,"before"),hr=te?Q:Kn(Bn,wn,"after"),Xa=te&&Ii&&li?q:jn.right):(zi=te?Kn(ln,wn,"before"):Q,Dn=!te&&ur&&Rn?q:rn.right,hr=!te&&Ii&&li?Q:jn.left,Xa=te?Kn(Bn,wn,"after"):q),pe(zi,rn.top,Dn-zi,rn.bottom),rn.bottom<jn.top&&pe(Q,rn.bottom,null,jn.top),pe(hr,jn.top,Xa-hr,jn.bottom)}(!Zt||zr(rn,Zt)<0)&&(Zt=rn),zr(jn,Zt)<0&&(Zt=jn),(!bn||zr(rn,bn)<0)&&(bn=rn),zr(jn,bn)<0&&(bn=jn)}),{start:Zt,end:bn}}var Me=t.from(),ke=t.to();if(Me.line==ke.line)ye(Me.line,Me.ch,ke.ch);else{var Ge=mt(c,Me.line),Ye=mt(c,ke.line),et=Ln(Ge)==Ln(Ye),at=ye(Me.line,Me.ch,et?Ge.text.length+1:null).end,ht=ye(ke.line,et?0:null,ke.ch).start;et&&(at.top<ht.top-2?(pe(at.right,at.top,null,at.bottom),pe(Q,ht.top,ht.left,ht.bottom)):pe(at.right,at.top,ht.left-at.right,at.bottom)),at.bottom<ht.top&&pe(Q,at.bottom,null,ht.top)}r.appendChild(M)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Qi(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qi(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Kr(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var c=t.view[i],M=e.options.lineWrapping,K=void 0,Q=0;if(c.hidden)continue;if(z&&G<8){var q=c.node.offsetTop+c.node.offsetHeight;K=q-r,r=q}else{var te=c.node.getBoundingClientRect();K=te.bottom-te.top,!M&&c.text.firstChild&&(Q=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var pe=c.line.height-K;if((pe>.005||pe<-.005)&&(en(c.line,K),ys(c.line),c.rest))for(var ye=0;ye<c.rest.length;ye++)ys(c.rest[ye]);if(Q>e.display.sizerWidth){var Me=Math.ceil(Q/Ji(e.display));Me>e.display.maxLineLength&&(e.display.maxLineLength=Me,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Vr(e,t,r){var i=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-Hr(e));var c=r&&r.bottom!=null?r.bottom:i+e.wrapper.clientHeight,M=hn(t,i),K=hn(t,c);if(r&&r.ensure){var Q=r.ensure.from.line,q=r.ensure.to.line;Q<M?(M=Q,K=hn(t,ei(mt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=K&&(M=hn(t,ei(mt(t,q))-e.wrapper.clientHeight),K=q)}return{from:M,to:Math.max(K,M+1)}}function Yo(e,t){if(We(e,"scrollCursorIntoView"))return;var r=e.display,i=r.sizer.getBoundingClientRect(),c=null;if(t.top+i.top<0?c=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!l){var M=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+si(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(c),e.display.lineSpace.removeChild(M)}}function $o(e,t,r,i){i==null&&(i=0);var c;!e.options.lineWrapping&&t==r&&(t=t.ch?Je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Je(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var K=!1,Q=ti(e,t),q=!r||r==t?Q:ti(e,r);c={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-i,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+i};var te=wa(e,c),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(K=!0)),te.scrollLeft!=null&&(Bi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(K=!0)),!K)break}return c}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&Er(e,r.scrollTop),r.scrollLeft!=null&&Bi(e,r.scrollLeft)}function wa(e,t){var r=e.display,i=$i(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=da(e),K={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Q=e.doc.height+ca(r),q=t.top<i,te=t.bottom>Q-i;if(t.top<c)K.scrollTop=q?0:t.top;else if(t.bottom>c+M){var pe=Math.min(t.top,(te?Q:t.bottom)-M);pe!=c&&(K.scrollTop=pe)}var ye=e.options.fixedGutter?0:r.gutters.offsetWidth,Me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-ye,ke=Pi(e)-r.gutters.offsetWidth,Ge=t.right-t.left>ke;return Ge&&(t.right=t.left+ke),t.left<10?K.scrollLeft=0:t.left<Me?K.scrollLeft=Math.max(0,t.left+ye-(Ge?0:10)):t.right>ke+Me-3&&(K.scrollLeft=t.right+(Ge?0:10)-ke),K}function Sa(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zi(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _r(e,t,r){(t!=null||r!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),i=us(e,t.to);bs(e,r,i,t.margin)}}function bs(e,t,r,i){var c=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});_r(e,c.scrollLeft,c.scrollTop)}function Er(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bi(e,t,r,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:i,scrollHeight:i+si(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ji=function(e,t,r){this.cm=r;var i=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=c.tabIndex=-1,e(i),e(c),Fe(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Fe(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ji.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var c=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}},ji.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ji.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ji.prototype.zeroWidthHack=function(){var e=s&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new J,this.disableVert=new J},ji.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function i(){var c=e.getBoundingClientRect(),M=r=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},ji.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tr=function(){};Tr.prototype.update=function(){return{bottom:0,right:0}},Tr.prototype.setScrollLeft=function(){},Tr.prototype.setScrollTop=function(){},Tr.prototype.clear=function(){};function qi(e,t){t||(t=xr(e));var r=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var c=0;c<4&&r!=e.display.barWidth||i!=e.display.barHeight;c++)r!=e.display.barWidth&&e.options.lineWrapping&&Kr(e),Es(e,xr(e)),r=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:ji,null:Tr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Fe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Bi(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Hi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},Qn(e.curOp)}function Wi(e){var t=e.curOp;t&&Io(t,function(r){for(var i=0;i<r.ops.length;i++)r.ops[i].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var i=0;i<t.length;i++)tl(t[i]);for(var c=0;c<t.length;c++)nl(t[c]);for(var M=0;M<t.length;M++)il(t[M]);for(var K=0;K<t.length;K++)rl(t[K])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Kr(t),e.barMeasure=xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+si(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Pi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,i=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bi(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,_(i,e.scrollToPos.from),_(i,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var M=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(M)for(var Q=0;Q<M.length;++Q)M[Q].lines.length||je(M[Q],"hide");if(K)for(var q=0;q<K.length;++q)K[q].lines.length&&je(K[q],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function zn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{Wi(e)}}function vn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function In(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function yn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{Wi(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,i=it(e,t.highlightFrontier),c=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(i.line>=e.display.viewFrom){var K=M.styles,Q=M.text.length>e.options.maxHighlightLength?Bt(t.mode,i.state):null,q=Ee(e,M,i,!0);Q&&(i.state=Q),M.styles=q.styles;var te=M.styleClasses,pe=q.classes;pe?M.styleClasses=pe:te&&(M.styleClasses=null);for(var ye=!K||K.length!=M.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Me=0;!ye&&Me<K.length;++Me)ye=K[Me]!=M.styles[Me];ye&&c.push(i.line),M.stateAfter=i.save(),i.nextLine()}else M.text.length<=e.options.maxHighlightLength&&vt(e,M.text,i),M.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>r)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),c.length&&zn(e,function(){for(var M=0;M<c.length;M++)wi(e,c[M],"text")})}var Yr=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Vr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Pi(e),this.force=r,this.dims=ba(e),this.events=[]};Yr.prototype.signal=function(e,t){_e(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=si(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=si(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=B();if(!t||!b(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&b(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return Si(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Si(e),t.dims=ba(e));var c=i.first+i.size,M=Math.max(t.visible.from-e.options.viewportMargin,i.first),K=Math.min(c,t.visible.to+e.options.viewportMargin);r.viewFrom<M&&M-r.viewFrom<20&&(M=Math.max(i.first,r.viewFrom)),r.viewTo>K&&r.viewTo-K<20&&(K=Math.min(c,r.viewTo)),mn&&(M=dr(e.doc,M),K=Ti(e.doc,K));var Q=M!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,M,K),r.viewOffset=ei(mt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var q=fs(e);if(!Q&&q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return q>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),O(r.cursorDiv),O(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Q&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,wr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Pi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ca(e.display)-da(e),r.top)}),t.visible=Vr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Vr(e.display,e.doc,r));if(!Ca(e,t))break;Kr(e);var c=xr(e);br(e),qi(e,c),Ra(e,c),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var r=new Yr(e,t);if(Ca(e,r)){Kr(e),ws(e,r);var i=xr(e);br(e),qi(e,i),Ra(e,i),r.finish()}}function ul(e,t,r){var i=e.display,c=e.options.lineNumbers,M=i.lineDiv,K=M.firstChild;function Q(Ge){var Ye=Ge.nextSibling;return n&&s&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),Ye}for(var q=i.view,te=i.viewFrom,pe=0;pe<q.length;pe++){var ye=q[pe];if(!ye.hidden)if(!ye.node||ye.node.parentNode!=M){var Me=No(e,ye,te,r);M.insertBefore(Me,K)}else{for(;K!=ye.node;)K=Q(K);var ke=c&&t!=null&&t<=te&&ye.lineNumber;ye.changes&&(ie(ye.changes,"gutter")>-1&&(ke=!1),Ya(e,ye,te,r)),ke&&(O(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode($n(e.options,te)))),K=ye.node.nextSibling}te+=ye.size}for(;K;)K=Q(K)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+si(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,M=i+"px",K=0;K<r.length;K++)if(!r[K].hidden){e.options.fixedGutter&&(r[K].gutter&&(r[K].gutter.style.left=M),r[K].gutterBackground&&(r[K].gutterBackground.style.left=M));var Q=r[K].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=i+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=$n(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var c=i.measure.appendChild(f("div",[f("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=c.firstChild.offsetWidth,K=c.offsetWidth-M;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(M,i.lineGutter.offsetWidth-K)+1,i.lineNumWidth=i.lineNumInnerWidth+K,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Oa(e.display),!0}return!1}function La(e,t){for(var r=[],i=!1,c=0;c<e.length;c++){var M=e[c],K=null;if(typeof M!="string"&&(K=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)i=!0;else continue;r.push({className:M,style:K})}return t&&!i&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;O(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var c=r[i],M=c.className,K=c.style,Q=t.appendChild(f("div",null,"CodeMirror-gutter "+M));K&&(Q.style.cssText=K),M=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Oa(e)}function Sr(e){As(e.display),Nn(e),Ss(e)}function hl(e,t,r,i){var c=this;this.input=r,c.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=C("div",null,"CodeMirror-code"),c.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=f("div",null,"CodeMirror-cursors"),c.measure=f("div",null,"CodeMirror-measure"),c.lineMeasure=f("div",null,"CodeMirror-measure"),c.lineSpace=C("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var M=C("div",[c.lineSpace],"CodeMirror-lines");c.mover=f("div",[M],null,"position: relative"),c.sizer=f("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=f("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),c.gutters=f("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=f("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=f("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),z&&G<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!n&&!(P&&h)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(i.gutters,i.lineNumbers),As(c),r.init(c)}var $r=0,Xn=null;z?Xn=-.53:P?Xn=15:v?Xn=-.7:p&&(Xn=-1/3);function Os(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function cl(e){var t=Os(e);return t.x*=Xn,t.y*=Xn,t}function Rs(e,t){var r=Os(t),i=r.x,c=r.y,M=e.display,K=M.scroller,Q=K.scrollWidth>K.clientWidth,q=K.scrollHeight>K.clientHeight;if(!(i&&Q||c&&q))return;if(c&&s&&n){e:for(var te=t.target,pe=M.view;te!=K;te=te.parentNode)for(var ye=0;ye<pe.length;ye++)if(pe[ye].node==te){e.display.currentWheelTarget=te;break e}}if(i&&!P&&!m&&Xn!=null){c&&q&&Er(e,Math.max(0,K.scrollTop+c*Xn)),Bi(e,Math.max(0,K.scrollLeft+i*Xn)),(!c||c&&q)&&ae(t),M.wheelStartX=null;return}if(c&&Xn!=null){var Me=c*Xn,ke=e.doc.scrollTop,Ge=ke+M.wrapper.clientHeight;Me<0?ke=Math.max(0,ke+Me-50):Ge=Math.min(e.doc.height,Ge+Me+50),Aa(e,{top:ke,bottom:Ge})}$r<20&&(M.wheelStartX==null?(M.wheelStartX=K.scrollLeft,M.wheelStartY=K.scrollTop,M.wheelDX=i,M.wheelDY=c,setTimeout(function(){if(M.wheelStartX==null)return;var Ye=K.scrollLeft-M.wheelStartX,et=K.scrollTop-M.wheelStartY,at=et&&M.wheelDY&&et/M.wheelDY||Ye&&M.wheelDX&&Ye/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!at)return;Xn=(Xn*$r+at)/($r+1),++$r},200)):(M.wheelDX+=i,M.wheelDY+=c))}var Yn=function(e,t){this.ranges=e,this.primIndex=t};Yn.prototype.primary=function(){return this.ranges[this.primIndex]},Yn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!mi(r.anchor,i.anchor)||!mi(r.head,i.head))return!1}return!0},Yn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Kt(gi(this.ranges[t].anchor),gi(this.ranges[t].head));return new Yn(e,this.primIndex)},Yn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(Ot(t,i.from())>=0&&Ot(e,i.to())<=0)return r}return-1};var Kt=function(e,t){this.anchor=e,this.head=t};Kt.prototype.from=function(){return yi(this.anchor,this.head)},Kt.prototype.to=function(){return vi(this.anchor,this.head)},Kt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ni(e,t,r){var i=e&&e.options.selectionsMayTouch,c=t[r];t.sort(function(Me,ke){return Ot(Me.from(),ke.from())}),r=ie(t,c);for(var M=1;M<t.length;M++){var K=t[M],Q=t[M-1],q=Ot(Q.to(),K.from());if(i&&!K.empty()?q>0:q>=0){var te=yi(Q.from(),K.from()),pe=vi(Q.to(),K.to()),ye=Q.empty()?K.from()==K.head:Q.from()==Q.head;M<=r&&--r,t.splice(--M,2,new Kt(ye?pe:te,ye?te:pe))}}return new Yn(t,r)}function Ci(e,t){return new Yn([new Kt(e,t||e)],0)}function Ai(e){return e.text?Je(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ot(e,t.from)<0)return e;if(Ot(e,t.to)<=0)return Ai(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ai(t).ch-t.to.ch),Je(r,i)}function Ia(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var c=e.sel.ranges[i];r.push(new Kt(Ls(c.anchor,t),Ls(c.head,t)))}return ni(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Je(r.line,e.ch-t.ch+r.ch):Je(r.line+(e.line-t.line),e.ch)}function dl(e,t,r){for(var i=[],c=Je(e.first,0),M=c,K=0;K<t.length;K++){var Q=t[K],q=Is(Q.from,c,M),te=Is(Ai(Q),c,M);if(c=Q.to,M=te,r=="around"){var pe=e.sel.ranges[K],ye=Ot(pe.head,pe.anchor)<0;i[K]=new Kt(ye?te:q,ye?q:te)}else i[K]=new Kt(q,q)}return new Yn(i,e.sel.primIndex)}function Da(e){e.doc.mode=Vt(e.options,e.doc.modeOption),Cr(e)}function Cr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,wr(e,100),e.state.modeGen++,e.curOp&&Nn(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,i){function c(ht){return r?r[ht]:null}function M(ht,st,ft){ua(ht,st,ft,i),Tn(ht,"change",ht,t)}function K(ht,st){for(var ft=[],Ct=ht;Ct<st;++Ct)ft.push(new Mi(te[Ct],c(Ct),i));return ft}var Q=t.from,q=t.to,te=t.text,pe=mt(e,Q.line),ye=mt(e,q.line),Me=ne(te),ke=c(te.length-1),Ge=q.line-Q.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ye=K(0,te.length-1);M(ye,ye.text,ke),Ge&&e.remove(Q.line,Ge),Ye.length&&e.insert(Q.line,Ye)}else if(pe==ye)if(te.length==1)M(pe,pe.text.slice(0,Q.ch)+Me+pe.text.slice(q.ch),ke);else{var et=K(1,te.length-1);et.push(new Mi(Me+pe.text.slice(q.ch),ke,i)),M(pe,pe.text.slice(0,Q.ch)+te[0],c(0)),e.insert(Q.line+1,et)}else if(te.length==1)M(pe,pe.text.slice(0,Q.ch)+te[0]+ye.text.slice(q.ch),c(0)),e.remove(Q.line+1,Ge);else{M(pe,pe.text.slice(0,Q.ch)+te[0],c(0)),M(ye,Me+ye.text.slice(q.ch),ke);var at=K(1,te.length-1);Ge>1&&e.remove(Q.line+1,Ge-1),e.insert(Q.line+1,at)}Tn(e,"change",e,t)}function Oi(e,t,r){function i(c,M,K){if(c.linked)for(var Q=0;Q<c.linked.length;++Q){var q=c.linked[Q];if(q.doc==M)continue;var te=K&&q.sharedHist;if(r&&!te)continue;t(q.doc,te),i(q.doc,c,te)}}i(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||jr(e),e.options.mode=t.modeOption,Nn(e)}function Ms(e){(e.doc.direction=="rtl"?F:w)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){zn(e,function(){Ms(e),Nn(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,t){var r={from:gi(t.from),to:Ai(t),text:Hn(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),Oi(e,function(i){return Fs(i,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function Ns(e,t,r,i){var c=e.history;c.undone.length=0;var M=+new Date,K,Q;if((c.lastOp==i||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(c,c.lastOp==i)))Q=ne(K.changes),Ot(t.from,t.to)==0&&Ot(t.from,Q.to)==0?Q.to=Ai(t):K.changes.push(Ma(e,t));else{var q=ne(c.done);for((!q||!q.ranges)&&Qr(e.sel,c.done),K={changes:[Ma(e,t)],generation:c.generation},c.done.push(K);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(r),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=M,c.lastOp=c.lastSelOp=i,c.lastOrigin=c.lastSelOrigin=t.origin,Q||je(e,"historyAdded")}function ml(e,t,r,i){var c=t.charAt(0);return c=="*"||c=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,i){var c=e.history,M=i&&i.origin;r==c.lastSelOp||M&&c.lastSelOrigin==M&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==M||ml(e,M,ne(c.done),t))?c.done[c.done.length-1]=t:Qr(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=M,c.lastSelOp=r,i&&i.clearRedo!==!1&&Ps(c.undone)}function Qr(e,t){var r=ne(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,i){var c=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(K){K.markedSpans&&((c||(c=t["spans_"+e.id]={}))[M]=K.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],c=0;c<t.text.length;++c)i.push(vl(r[c]));return i}function Us(e,t){var r=yl(e,t),i=qn(e,t);if(!r)return i;if(!i)return r;for(var c=0;c<r.length;++c){var M=r[c],K=i[c];if(M&&K){e:for(var Q=0;Q<K.length;++Q){for(var q=K[Q],te=0;te<M.length;++te)if(M[te].marker==q.marker)continue e;M.push(q)}}else K&&(r[c]=K)}return r}function er(e,t,r){for(var i=[],c=0;c<e.length;++c){var M=e[c];if(M.ranges){i.push(r?Yn.prototype.deepCopy.call(M):M);continue}var K=M.changes,Q=[];i.push({changes:Q});for(var q=0;q<K.length;++q){var te=K[q],pe=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var ye in te)(pe=ye.match(/^spans_(\d+)$/))&&(ie(t,Number(pe[1]))>-1&&(ne(Q)[ye]=te[ye],delete te[ye]))}}return i}function Pa(e,t,r,i){if(i){var c=e.anchor;if(r){var M=Ot(t,c)<0;M!=Ot(r,c)<0?(c=t,t=r):M!=Ot(t,r)<0&&(t=r)}return new Kt(c,t)}else return new Kt(r||t,t)}function Zr(e,t,r,i,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),On(e,new Yn([Pa(e.sel.primary(),t,r,c)],0),i)}function Bs(e,t,r){for(var i=[],c=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)i[M]=Pa(e.sel.ranges[M],t[M],null,c);var K=ni(e.cm,i,e.sel.primIndex);On(e,K,r)}function Na(e,t,r,i){var c=e.sel.ranges.slice(0);c[t]=r,On(e,ni(e.cm,c,e.sel.primIndex),i)}function js(e,t,r,i){On(e,Ci(t,r),i)}function bl(e,t,r){var i={ranges:t.ranges,update:function(c){this.ranges=[];for(var M=0;M<c.length;M++)this.ranges[M]=new Kt(_(e,c[M].anchor),_(e,c[M].head))},origin:r&&r.origin};return je(e,"beforeSelectionChange",e,i),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ni(e.cm,i.ranges,i.ranges.length-1):t}function Hs(e,t,r){var i=e.history.done,c=ne(i);c&&c.ranges?(i[i.length-1]=t,qr(e,t,r)):On(e,t,r)}function On(e,t,r){qr(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qr(e,t,r){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var i=r&&r.bias||(Ot(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,i,!0)),!(r&&r.scroll===!1)&&e.cm&&Zi(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),Tn(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,r,i){for(var c,M=0;M<t.ranges.length;M++){var K=t.ranges[M],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],q=ea(e,K.anchor,Q&&Q.anchor,r,i),te=ea(e,K.head,Q&&Q.head,r,i);(c||q!=K.anchor||te!=K.head)&&(c||(c=t.ranges.slice(0,M)),c[M]=new Kt(q,te))}return c?ni(e.cm,c,t.primIndex):t}function tr(e,t,r,i,c){var M=mt(e,t.line);if(M.markedSpans)for(var K=0;K<M.markedSpans.length;++K){var Q=M.markedSpans[K],q=Q.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,pe="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(pe?Q.to>=t.ch:Q.to>t.ch))){if(c&&(je(q,"beforeCursorEnter"),q.explicitlyCleared))if(M.markedSpans){--K;continue}else break;if(!q.atomic)continue;if(r){var ye=q.find(i<0?1:-1),Me=void 0;if((i<0?pe:te)&&(ye=Ks(e,ye,-i,ye&&ye.line==t.line?M:null)),ye&&ye.line==t.line&&(Me=Ot(ye,r))&&(i<0?Me<0:Me>0))return tr(e,ye,t,i,c)}var ke=q.find(i<0?-1:1);return(i<0?te:pe)&&(ke=Ks(e,ke,i,ke.line==t.line?M:null)),ke?tr(e,ke,t,i,c):null}}return t}function ea(e,t,r,i,c){var M=i||1,K=tr(e,t,r,M,c)||!c&&tr(e,t,r,M,!0)||tr(e,t,r,-M,c)||!c&&tr(e,t,r,-M,!0);return K||(e.cantEdit=!0,Je(e.first,0))}function Ks(e,t,r,i){return r<0&&t.ch==0?t.line>e.first?_(e,Je(t.line-1)):null:r>0&&t.ch==(i||mt(e,t.line)).text.length?t.line<e.first+e.size-1?Je(t.line+1,0):null:new Je(t.line,t.ch+r)}function Vs(e){e.setSelection(Je(e.firstLine(),0),Je(e.lastLine()),ve)}function Xs(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(c,M,K,Q){c&&(i.from=_(e,c)),M&&(i.to=_(e,M)),K&&(i.text=K),Q!==void 0&&(i.origin=Q)}),je(e,"beforeChange",e,i),e.cm&&je(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function nr(e,t,r){if(e.cm){if(!e.cm.curOp)return vn(e.cm,nr)(e,t,r);if(e.cm.state.suppressEdits)return}if((_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var i=Di&&!r&&_i(e,t.from,t.to);if(i)for(var c=i.length-1;c>=0;--c)Ys(e,{from:i[c].from,to:i[c].to,text:c?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&Ot(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Ar(e,t,r,qn(e,t));var i=[];Oi(e,function(c,M){!M&&ie(i,c.history)==-1&&(Zs(c.history,t),i.push(c.history)),Ar(c,t,null,qn(c,t))})}function ta(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!r)return;for(var c=e.history,M,K=e.sel,Q=t=="undo"?c.done:c.undone,q=t=="undo"?c.undone:c.done,te=0;te<Q.length&&!(M=Q[te],r?M.ranges&&!M.equals(e.sel):!M.ranges);te++);if(te==Q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(M=Q.pop(),M.ranges){if(Qr(M,q),r&&!M.equals(e.sel)){On(e,M,{clearRedo:!1});return}K=M}else if(i){Q.push(M);return}else break;var pe=[];Qr(K,q),q.push({changes:pe,generation:c.generation}),c.generation=M.generation||++c.maxGeneration;for(var ye=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),Me=function(Ye){var et=M.changes[Ye];if(et.origin=t,ye&&!Xs(e,et,!1))return Q.length=0,{};pe.push(Ma(e,et));var at=Ye?Ia(e,et):ne(Q);Ar(e,et,at,Us(e,et)),!Ye&&e.cm&&e.cm.scrollIntoView({from:et.from,to:Ai(et)});var ht=[];Oi(e,function(st,ft){!ft&&ie(ht,st.history)==-1&&(Zs(st.history,et),ht.push(st.history)),Ar(st,et,null,Us(st,et))})},ke=M.changes.length-1;ke>=0;--ke){var Ge=Me(ke);if(Ge)return Ge.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yn(de(e.sel.ranges,function(c){return new Kt(Je(c.anchor.line+t,c.anchor.ch),Je(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Nn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)wi(e.cm,i,"gutter")}}function Ar(e,t,r,i){if(e.cm&&!e.cm.curOp)return vn(e.cm,Ar)(e,t,r,i);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Je(e.first,0),to:Je(t.to.line+c,t.to.ch),text:[ne(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:Je(M,mt(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hn(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),qr(e,r,ve),e.cantEdit&&ea(e,Je(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var i=e.doc,c=e.display,M=t.from,K=t.to,Q=!1,q=M.line;e.options.lineWrapping||(q=It(Ln(mt(i,M.line))),i.iter(q,K.line+1,function(ke){if(ke==c.maxLine)return Q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Ce(e),ka(i,t,r,ds(e)),e.options.lineWrapping||(i.iter(q,M.line+t.text.length,function(ke){var Ge=pr(ke);Ge>c.maxLineLength&&(c.maxLine=ke,c.maxLineLength=Ge,c.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Zn(i,M.line),wr(e,400);var te=t.text.length-(K.line-M.line)-1;t.full?Nn(e):M.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wi(e,M.line,"text"):Nn(e,M.line,K.line+1,te);var pe=_e(e,"changes"),ye=_e(e,"change");if(ye||pe){var Me={from:M,to:K,text:t.text,removed:t.removed,origin:t.origin};ye&&Tn(e,"change",e,Me),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Me)}e.display.selForContextMenu=null}function ir(e,t,r,i,c){var M;i||(i=r),Ot(i,r)<0&&(M=[i,r],r=M[0],i=M[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:r,to:i,text:t,origin:c})}function Js(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,i){for(var c=0;c<e.length;++c){var M=e[c],K=!0;if(M.ranges){M.copied||(M=e[c]=M.deepCopy(),M.copied=!0);for(var Q=0;Q<M.ranges.length;Q++)Js(M.ranges[Q].anchor,t,r,i),Js(M.ranges[Q].head,t,r,i);continue}for(var q=0;q<M.changes.length;++q){var te=M.changes[q];if(r<te.from.line)te.from=Je(te.from.line+i,te.from.ch),te.to=Je(te.to.line+i,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,c+1),c=0)}}function Zs(e,t){var r=t.from.line,i=t.to.line,c=t.text.length-(i-r)-1;Qs(e.done,r,i,c),Qs(e.undone,r,i,c)}function Or(e,t,r,i){var c=t,M=t;return typeof t=="number"?M=mt(e,X(e,t)):c=It(t),c==null?null:(i(M,c)&&e.cm&&wi(e.cm,c,r),M)}function Rr(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Rr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var c=this.lines[r];this.height-=c.height,yt(c),Tn(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var c=e[i];t+=c.chunkSize(),r+=c.height,c.parent=this}this.size=t,this.height=r,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],c=i.chunkSize();if(e<c){var M=Math.min(t,c-e),K=i.height;if(i.removeInner(e,M),this.height-=K-i.height,c==M&&(this.children.splice(r--,1),i.parent=null),(t-=M)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Rr))){var Q=[];this.collapse(Q),this.children=[new Rr(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var c=this.children[i],M=c.chunkSize();if(e<=M){if(c.insertInner(e,t,r),c.lines&&c.lines.length>50){for(var K=c.lines.length%25+25,Q=K;Q<c.lines.length;){var q=new Rr(c.lines.slice(Q,Q+=25));c.height-=q.height,this.children.splice(++i,0,q),q.parent=this}c.lines=c.lines.slice(0,K),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Lr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var c=ie(e.parent.children,e);e.parent.children.splice(c+1,0,r)}else{var i=new Lr(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var c=this.children[i],M=c.chunkSize();if(e<M){var K=Math.min(t,M-e);if(c.iterN(e,K,r))return!0;if((t-=K)==0)break;e=0}else e-=M}}};var Ir=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t};Ir.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=It(r);if(i==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(r.widgets=null);var M=vr(this);en(r,Math.max(0,r.height-M)),e&&(zn(e,function(){qs(e,r,-M),wi(e,i,"widget")}),Tn(e,"lineWidgetCleared",e,this,i))},Ir.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var c=vr(this)-t;if(!c)return;ai(this.doc,i)||en(i,i.height+c),r&&zn(r,function(){r.curOp.forceUpdate=!0,qs(r,i,c),Tn(r,"lineWidgetChanged",r,e,It(i))})},Te(Ir);function qs(e,t,r){ei(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,i){var c=new Ir(e,r,i),M=e.cm;return M&&c.noHScroll&&(M.display.alignWidgets=!0),Or(e,t,"widget",function(K){var Q=K.widgets||(K.widgets=[]);if(c.insertAt==null?Q.push(c):Q.splice(Math.min(Q.length-1,Math.max(0,c.insertAt)),0,c),c.line=K,M&&!ai(e,K)){var q=ei(K)<e.scrollTop;en(K,K.height+vr(c)),q&&Sa(M,c.height),M.curOp.forceUpdate=!0}return!0}),M&&Tn(M,"lineWidgetAdded",M,c,typeof t=="number"?t:It(t)),c}var eo=0,Ri=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Ri.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),_e(this,"clear")){var r=this.find();r&&Tn(this,"clear",r.from,r.to)}for(var i=null,c=null,M=0;M<this.lines.length;++M){var K=this.lines[M],Q=Gn(K.markedSpans,this);e&&!this.collapsed?wi(e,It(K),"text"):e&&(Q.to!=null&&(c=It(K)),Q.from!=null&&(i=It(K))),K.markedSpans=ki(K.markedSpans,Q),Q.from==null&&this.collapsed&&!ai(this.doc,K)&&e&&en(K,$i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Ln(this.lines[q]),pe=pr(te);pe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Nn(e,i,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&Tn(e,"markerCleared",e,this,i,c),t&&Wi(e),this.parent&&this.parent.clear()},Ri.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,i,c=0;c<this.lines.length;++c){var M=this.lines[c],K=Gn(M.markedSpans,this);if(K.from!=null&&(r=Je(t?M:It(M),K.from),e==-1))return r;if(K.to!=null&&(i=Je(t?M:It(M),K.to),e==1))return i}return r&&{from:r,to:i}},Ri.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;if(!t||!i)return;zn(i,function(){var c=t.line,M=It(t.line),K=fa(i,M);if(K&&(rs(K),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!ai(r.doc,c)&&r.height!=null){var Q=r.height;r.height=null;var q=vr(r)-Q;q&&en(c,c.height+q)}Tn(i,"markerChanged",i,e)})},Ri.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ie(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ri.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(Ri);function rr(e,t,r,i,c){if(i&&i.shared)return xl(e,t,r,i,c);if(e.cm&&!e.cm.curOp)return vn(e.cm,rr)(e,t,r,i,c);var M=new Ri(e,c),K=Ot(t,r);if(i&&g(i,M,!1),K>0||K==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=C("span",[M.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(gn(e,t.line,t,r,M)||t.line!=r.line&&gn(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");ui()}M.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,r.line+1,function(ye){q&&M.collapsed&&!q.options.lineWrapping&&Ln(ye)==q.display.maxLine&&(te=!0),M.collapsed&&Q!=t.line&&en(ye,0),bi(ye,new hi(M,Q==t.line?t.ch:null,Q==r.line?r.ch:null)),++Q}),M.collapsed&&e.iter(t.line,r.line+1,function(ye){ai(e,ye)&&en(ye,0)}),M.clearOnEnter&&Fe(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(Vn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++eo,M.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),M.collapsed)Nn(q,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var pe=t.line;pe<=r.line;pe++)wi(q,pe,"text");M.atomic&&Gs(q.doc),Tn(q,"markerAdded",q,M)}return M}var Dr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Dr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Tn(this,"clear")},Dr.prototype.find=function(e,t){return this.primary.find(e,t)},Te(Dr);function xl(e,t,r,i,c){i=g(i),i.shared=!1;var M=[rr(e,t,r,i,c)],K=M[0],Q=i.widgetNode;return Oi(e,function(q){Q&&(i.widgetNode=Q.cloneNode(!0)),M.push(rr(q,_(q,t),_(q,r),i,c));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;K=ne(M)}),new Dr(M,K)}function to(e){return e.findMarks(Je(e.first,0),e.clipPos(Je(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var i=t[r],c=i.find(),M=e.clipPos(c.from),K=e.clipPos(c.to);if(Ot(M,K)){var Q=rr(e,M,K,i.primary,i.primary.type);i.markers.push(Q),Q.parent=i}}}function wl(e){for(var t=function(i){var c=e[i],M=[c.primary.doc];Oi(c.primary.doc,function(q){return M.push(q)});for(var K=0;K<c.markers.length;K++){var Q=c.markers[K];ie(M,Q.doc)==-1&&(Q.parent=null,c.markers.splice(K--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Fn=function(e,t,r,i,c){if(!(this instanceof Fn))return new Fn(e,t,r,i,c);r==null&&(r=0),Lr.call(this,[new Rr([new Mi("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var M=Je(r,0);this.sel=Ci(M),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=i,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:M,to:M,text:e}),On(this,Ci(M),ve)};Fn.prototype=Ne(Lr.prototype,{constructor:Fn,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:yn(function(e){var t=Je(this.first,0),r=this.first+this.size-1;nr(this,{from:t,to:Je(r,mt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_r(this.cm,0,0),On(this,Ci(t),ve)}),replaceRange:function(e,t,r,i){t=_(this,t),r=r?_(this,r):t,ir(this,e,t,r,i)},getRange:function(e,t,r){var i=Hn(this,_(this,e),_(this,t));return r===!1?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(kn(this,e))return mt(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=mt(this,e)),Ln(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return _(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:yn(function(e,t,r){js(this,_(this,typeof e=="number"?Je(e,t||0):e),null,r)}),setSelection:yn(function(e,t,r){js(this,_(this,e),_(this,t||e),r)}),extendSelection:yn(function(e,t,r){Zr(this,_(this,e),t&&_(this,t),r)}),extendSelections:yn(function(e,t){Bs(this,H(this,e),t)}),extendSelectionsBy:yn(function(e,t){var r=de(this.sel.ranges,e);Bs(this,H(this,r),t)}),setSelections:yn(function(e,t,r){if(!e.length)return;for(var i=[],c=0;c<e.length;c++)i[c]=new Kt(_(this,e[c].anchor),_(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),On(this,ni(this.cm,i,t),r)}),addSelection:yn(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new Kt(_(this,e),_(this,t||e))),On(this,ni(this.cm,i,i.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,i=0;i<t.length;i++){var c=Hn(this,t[i].from(),t[i].to());r=r?r.concat(c):c}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var c=Hn(this,r[i].from(),r[i].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[i]=c}return t},replaceSelection:function(e,t,r){for(var i=[],c=0;c<this.sel.ranges.length;c++)i[c]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:yn(function(e,t,r){for(var i=[],c=this.sel,M=0;M<c.ranges.length;M++){var K=c.ranges[M];i[M]={from:K.from(),to:K.to(),text:this.splitLines(e[M]),origin:r}}for(var Q=t&&t!="end"&&dl(this,i,t),q=i.length-1;q>=0;q--)nr(this,i[q]);Q?Hs(this,Q):this.cm&&Zi(this.cm)}),undo:yn(function(){ta(this,"undo")}),redo:yn(function(){ta(this,"redo")}),undoSelection:yn(function(){ta(this,"undo",!0)}),redoSelection:yn(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Oi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:yn(function(e,t,r){return Or(this,e,"gutter",function(i){var c=i.gutterMarkers||(i.gutterMarkers={});return c[t]=r,!r&&oe(c)&&(i.gutterMarkers=null),!0})}),clearGutter:yn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Or(t,r,"gutter",function(){return r.gutterMarkers[e]=null,oe(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!kn(this,e))return null;if(t=e,e=mt(this,e),!e)return null}else if(t=It(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:yn(function(e,t,r){return Or(this,e,t=="gutter"?"gutter":"class",function(i){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[c])i[c]=r;else{if(L(r).test(i[c]))return!1;i[c]+=" "+r}return!0})}),removeLineClass:yn(function(e,t,r){return Or(this,e,t=="gutter"?"gutter":"class",function(i){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=i[c];if(M)if(r==null)i[c]=null;else{var K=M.match(L(r));if(!K)return!1;var Q=K.index+K[0].length;i[c]=M.slice(0,K.index)+(!K.index||Q==M.length?"":" ")+M.slice(Q)||null}else return!1;return!0})}),addLineWidget:yn(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return rr(this,_(this,e),_(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=_(this,e),rr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=_(this,e);var t=[],r=mt(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var c=r[i];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,r){e=_(this,e),t=_(this,t);var i=[],c=e.line;return this.iter(e.line,t.line+1,function(M){var K=M.markedSpans;if(K)for(var Q=0;Q<K.length;Q++){var q=K[Q];!(q.to!=null&&c==e.line&&e.ch>=q.to||q.from==null&&c!=e.line||q.from!=null&&c==t.line&&q.from>=t.ch)&&(!r||r(q.marker))&&i.push(q.marker.parent||q.marker)}++c}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)r[i].from!=null&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter(function(c){var M=c.text.length+i;if(M>e)return t=e,!0;e-=M,++r}),_(this,Je(r,t))},indexFromPos:function(e){e=_(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+r}),t},copy:function(e){var t=new Fn(Jt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var i=new Fn(Jt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(i,to(this)),i},unlinkDoc:function(e){if(e instanceof tn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var i=[e.id];Oi(e,function(c){return i.push(c.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,i),e.history.undone=er(this.history.undone,i)}},iterLinkedDocs:function(e){Oi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:yn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Fn.prototype.eachLine=Fn.prototype.iter;var no=0;function Cl(e){var t=this;if(io(t),We(t,e)||di(t.display,e))return;ae(e),z&&(no=+new Date);var r=Fi(t,e,!0),i=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var c=i.length,M=Array(c),K=0,Q=function(){++K==c&&vn(t,function(){r=_(t.doc,r);var ke={from:r,to:r,text:t.doc.splitLines(M.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,ke),Hs(t.doc,Ci(_(t.doc,r),_(t.doc,Ai(ke))))})()},q=function(ke,Ge){if(t.options.allowDropFileTypes&&ie(t.options.allowDropFileTypes,ke.type)==-1){Q();return}var Ye=new FileReader;Ye.onerror=function(){return Q()},Ye.onload=function(){var et=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(et)){Q();return}M[Ge]=et,Q()},Ye.readAsText(ke)},te=0;te<i.length;te++)q(i[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),qr(t.doc,Ci(r,r)),ye)for(var Me=0;Me<ye.length;++Me)ir(t.doc,"",ye[Me].anchor,ye[Me].head,"drag");t.replaceSelection(pe,"around","paste"),t.display.input.focus()}}catch(ke){}}}function Al(e,t){if(z&&(!e.state.draggingText||+new Date-no<100)){me(t);return}if(We(e,t)||di(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var r=f("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),m&&r.parentNode.removeChild(r)}}function Ol(e,t){var r=Fi(e,t);if(!r)return;var i=document.createDocumentFragment();ms(e,r,i),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),S(e.display.dragCursor,i)}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],i=0;i<t.length;i++){var c=t[i].CodeMirror;c&&r.push(c)}r.length&&r[0].operation(function(){for(var M=0;M<r.length;M++)e(r[M])})}var ao=!1;function Rl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Fe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),Fe(window,"blur",function(){return ro(Qi)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Li={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},kr=0;kr<10;kr++)Li[kr+48]=Li[kr+96]=String(kr);for(var na=65;na<=90;na++)Li[na]=String.fromCharCode(na);for(var Mr=1;Mr<=12;Mr++)Li[Mr+111]=Li[Mr+63235]="F"+Mr;var fi={};fi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fi.default=s?fi.macDefault:fi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,i,c,M,K=0;K<t.length-1;K++){var Q=t[K];if(/^(cmd|meta|m)$/i.test(Q))M=!0;else if(/^a(lt)?$/i.test(Q))r=!0;else if(/^(c|ctrl|control)$/i.test(Q))i=!0;else if(/^s(hift)?$/i.test(Q))c=!0;else throw new Error("Unrecognized modifier name: "+Q)}return r&&(e="Alt-"+e),i&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(i=="..."){delete e[r];continue}for(var c=de(r.split(" "),Dl),M=0;M<c.length;M++){var K=void 0,Q=void 0;M==c.length-1?(Q=c.join(" "),K=i):(Q=c.slice(0,M+1).join(" "),K="...");var q=t[Q];if(!q)t[Q]=K;else if(q!=K)throw new Error("Inconsistent bindings for "+Q)}delete e[r]}for(var te in t)e[te]=t[te];return e}function ar(e,t,r,i){t=ia(t);var c=t.call?t.call(e,i):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&r(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ar(e,t.fallthrough,r,i);for(var M=0;M<t.fallthrough.length;M++){var K=ar(e,t.fallthrough[M],r,i);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Li[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var r=Li[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function ia(e){return typeof e=="string"?fi[e]:e}function sr(e,t){for(var r=e.doc.sel.ranges,i=[],c=0;c<r.length;c++){for(var M=t(r[c]);i.length&&Ot(M.from,ne(i).to)<=0;){var K=i.pop();if(Ot(K.from,M.from)<0){M.from=K.from;break}}i.push(M)}zn(e,function(){for(var Q=i.length-1;Q>=0;Q--)ir(e.doc,"",i[Q].from,i[Q].to,"+delete");Zi(e)})}function Fa(e,t,r){var i=Ie(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ua(e,t,r){var i=Fa(e,t.ch,r);return i==null?null:new Je(t.line,i,r<0?"after":"before")}function Ba(e,t,r,i,c){if(e){t.doc.direction=="rtl"&&(c=-c);var M=$e(r,t.doc.direction);if(M){var K=c<0?ne(M):M[0],Q=c<0==(K.level==1),q=Q?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var pe=Yi(t,r);te=c<0?r.text.length-1:0;var ye=oi(t,pe,te).top;te=He(function(Me){return oi(t,pe,Me).top==ye},c<0==(K.level==1)?K.from:K.to-1,te),q=="before"&&(te=Fa(r,te,1))}else te=c<0?K.to:K.from;return new Je(i,te,q)}}return new Je(i,c<0?r.text.length:0,c<0?"before":"after")}function Ml(e,t,r,i){var c=$e(t,e.doc.direction);if(!c)return Ua(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=Ze(c,r.ch,r.sticky),K=c[M];if(e.doc.direction=="ltr"&&K.level%2==0&&(i>0?K.to>r.ch:K.from<r.ch))return Ua(t,r,i);var Q=function(at,ht){return Fa(t,at instanceof Je?at.ch:at,ht)},q,te=function(at){return e.options.lineWrapping?(q=q||Yi(e,t),cs(e,t,q,at)):{begin:0,end:t.text.length}},pe=te(r.sticky=="before"?Q(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var ye=K.level==1==i<0,Me=Q(r,ye?1:-1);if(Me!=null&&(ye?Me<=K.to&&Me<=pe.end:Me>=K.from&&Me>=pe.begin)){var ke=ye?"before":"after";return new Je(r.line,Me,ke)}}var Ge=function(at,ht,st){for(var ft=function(Zt,bn){return bn?new Je(r.line,Q(Zt,1),"before"):new Je(r.line,Zt,"after")};at>=0&&at<c.length;at+=ht){var Ct=c[at],Et=ht>0==(Ct.level!=1),kt=Et?st.begin:Q(st.end,-1);if(Ct.from<=kt&&kt<Ct.to)return ft(kt,Et);if(kt=Et?Ct.from:Q(Ct.to,-1),st.begin<=kt&&kt<st.end)return ft(kt,Et)}},Ye=Ge(M+i,i,pe);if(Ye)return Ye;var et=i>0?pe.end:Q(pe.begin,-1);return et!=null&&!(i>0&&et==t.text.length)&&(Ye=Ge(i>0?0:c.length-1,i,te(et)),Ye)?Ye:null}var Pr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return sr(e,function(t){if(t.empty()){var r=mt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Je(t.head.line+1,0)}:{from:t.head,to:Je(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sr(e,function(t){return{from:Je(t.from().line,0),to:_(e.doc,Je(t.to().line+1,0))}})},delLineLeft:function(e){return sr(e,function(t){return{from:Je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Le)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Le)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Le)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,c=0;c<r.length;c++){var M=r[c].from(),K=W(e.getLine(M.line),M.ch,i);t.push(he(i-K%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return zn(e,function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var c=t[i].head,M=mt(e.doc,c.line).text;if(M){if(c.ch==M.length&&(c=new Je(c.line,c.ch-1)),c.ch>0)c=new Je(c.line,c.ch+1),e.replaceRange(M.charAt(c.ch-1)+M.charAt(c.ch-2),Je(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var K=mt(e.doc,c.line-1).text;K&&(c=new Je(c.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Je(c.line-1,K.length-1),c,"+transpose"))}}r.push(new Kt(c,c))}e.setSelections(r)})},newlineAndIndent:function(e){return zn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Zi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=mt(e.doc,t),i=Ln(r);return i!=r&&(t=It(i)),Ba(!0,e,i,t,1)}function Pl(e,t){var r=mt(e.doc,t),i=Xi(r);return i!=r&&(t=It(i)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),i=mt(e.doc,r.line),c=$e(i,e.doc.direction);if(!c||c[0].level==0){var M=Math.max(r.ch,i.text.search(/\S/)),K=t.line==r.line&&t.ch<=M&&t.ch;return Je(r.line,K?0:M,r.sticky)}return r}function ra(e,t,r){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),c=t(e)!=Re}finally{e.display.shift=i,e.state.suppressEdits=!1}return c}function Nl(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var c=ar(t,e.state.keyMaps[i],r,e);if(c)return c}return e.options.extraKeys&&ar(t,e.options.extraKeys,r,e)||ar(t,e.options.keyMap,r,e)}var Fl=new J;function Nr(e,t,r,i){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,r,i))return!0}return co(e,t,r,i)}function co(e,t,r,i){var c=Nl(e,t,i);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&Tn(e,"keyHandled",e,t,r),(c=="handled"||c=="multi")&&(ae(r),xa(e)),!!c}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+r,t,function(i){return ra(e,i,!0)})||Nr(e,r,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return ra(e,i)}):Nr(e,r,t,function(i){return ra(e,i)}):!1}function Ul(e,t,r){return Nr(e,"'"+r+"'",t,function(i){return ra(e,i,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),We(t,e))return;z&&G<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=fo(t,e);m&&(ja=i?r:null,!i&&r==88&&!Ft&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(w(t,"CodeMirror-crosshair"),lt(document,"keyup",r),lt(document,"mouseover",r))}Fe(document,"keyup",r),Fe(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(di(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var r=e.keyCode,i=e.charCode;if(m&&r==ja){ja=null,ae(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(i==null?r:i);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&Ot(t,this.pos)==0&&r==this.button};var Fr,Ur;function Hl(e,t){var r=+new Date;return Ur&&Ur.compare(r,e,t)?(Fr=Ur=null,"triple"):Fr&&Fr.compare(r,e,t)?(Ur=new Ha(r,e,t),Fr=null,"double"):(Fr=new Ha(r,e,t),Ur=null,"single")}function vo(e){var t=this,r=t.display;if(We(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,di(r,e)){n||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=Fi(t,e),c=Ue(e),M=i?Hl(i,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,c,i,M,e))return;c==1?i?zl(t,i,M,e):we(e)==r.scroller&&ae(e):c==2?(i&&Zr(t.doc,i),setTimeout(function(){return r.input.focus()},20)):c==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,i,c){var M="Click";return i=="double"?M="Double"+M:i=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nr(e,oo(M,c),c,function(K){if(typeof K=="string"&&(K=Pr[K]),!K)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=K(e,r)!=Re}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,r){var i=e.getOption("configureMouse"),c=i?i(e,t,r):{};if(c.unit==null){var M=a?r.shiftKey&&r.metaKey:r.altKey;c.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||r.shiftKey),c.addNew==null&&(c.addNew=s?r.metaKey:r.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(s?r.altKey:r.ctrlKey)),c}function zl(e,t,r,i){z?setTimeout(I(gs,e),0):e.curOp.focus=B();var c=Gl(e,r,i),M=e.doc.sel,K;e.options.dragDrop&&ze&&!e.isReadOnly()&&r=="single"&&(K=M.contains(t))>-1&&(Ot((K=M.ranges[K]).from(),t)<0||t.xRel>0)&&(Ot(K.to(),t)>0||t.xRel<0)?Kl(e,i,t,c):Vl(e,i,t,c)}function Kl(e,t,r,i){var c=e.display,M=!1,K=vn(e,function(te){n&&(c.scroller.draggable=!1),e.state.draggingText=!1,lt(c.wrapper.ownerDocument,"mouseup",K),lt(c.wrapper.ownerDocument,"mousemove",Q),lt(c.scroller,"dragstart",q),lt(c.scroller,"drop",K),M||(ae(te),i.addNew||Zr(e.doc,r,null,null,i.extend),n&&!p||z&&G==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Q=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return M=!0};n&&(c.scroller.draggable=!0),e.state.draggingText=K,K.copy=!i.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Fe(c.wrapper.ownerDocument,"mouseup",K),Fe(c.wrapper.ownerDocument,"mousemove",Q),Fe(c.scroller,"dragstart",q),Fe(c.scroller,"drop",K),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Kt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Kt(Je(t.line,0),_(e.doc,Je(t.line+1,0)));var i=r(e,t);return new Kt(i.from,i.to)}function Vl(e,t,r,i){var c=e.display,M=e.doc;ae(t);var K,Q,q=M.sel,te=q.ranges;if(i.addNew&&!i.extend?(Q=M.sel.contains(r),Q>-1?K=te[Q]:K=new Kt(r,r)):(K=M.sel.primary(),Q=M.sel.primIndex),i.unit=="rectangle")i.addNew||(K=new Kt(r,r)),r=Fi(e,t,!0,!0),Q=-1;else{var pe=yo(e,r,i.unit);i.extend?K=Pa(K,pe.anchor,pe.head,i.extend):K=pe}i.addNew?Q==-1?(Q=te.length,On(M,ni(e,te.concat([K]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&i.unit=="char"&&!i.extend?(On(M,ni(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=M.sel):Na(M,Q,K,Se):(Q=0,On(M,new Yn([K],0),Se),q=M.sel);var ye=r;function Me(st){if(Ot(ye,st)==0)return;if(ye=st,i.unit=="rectangle"){for(var ft=[],Ct=e.options.tabSize,Et=W(mt(M,r.line).text,r.ch,Ct),kt=W(mt(M,st.line).text,st.ch,Ct),Zt=Math.min(Et,kt),bn=Math.max(Et,kt),nn=Math.min(r.line,st.line),Kn=Math.min(e.lastLine(),Math.max(r.line,st.line));nn<=Kn;nn++){var Un=mt(M,nn).text,ln=be(Un,Zt,Ct);Zt==bn?ft.push(new Kt(Je(nn,ln),Je(nn,ln))):Un.length>ln&&ft.push(new Kt(Je(nn,ln),Je(nn,be(Un,bn,Ct))))}ft.length||ft.push(new Kt(r,r)),On(M,ni(e,q.ranges.slice(0,Q).concat(ft),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(st)}else{var Bn=K,wn=yo(e,st,i.unit),dn=Bn.anchor,un;Ot(wn.anchor,dn)>0?(un=wn.head,dn=yi(Bn.from(),wn.anchor)):(un=wn.anchor,dn=vi(Bn.to(),wn.head));var rn=q.ranges.slice(0);rn[Q]=Xl(e,new Kt(_(M,dn),un)),On(M,ni(e,rn,Q),Se)}}var ke=c.wrapper.getBoundingClientRect(),Ge=0;function Ye(st){var ft=++Ge,Ct=Fi(e,st,!0,i.unit=="rectangle");if(!Ct)return;if(Ot(Ct,ye)!=0){e.curOp.focus=B(),Me(Ct);var Et=Vr(c,M);(Ct.line>=Et.to||Ct.line<Et.from)&&setTimeout(vn(e,function(){Ge==ft&&Ye(st)}),150)}else{var kt=st.clientY<ke.top?-20:st.clientY>ke.bottom?20:0;kt&&setTimeout(vn(e,function(){if(Ge!=ft)return;c.scroller.scrollTop+=kt,Ye(st)}),50)}}function et(st){e.state.selectingText=!1,Ge=Infinity,st&&(ae(st),c.input.focus()),lt(c.wrapper.ownerDocument,"mousemove",at),lt(c.wrapper.ownerDocument,"mouseup",ht),M.history.lastSelOrigin=null}var at=vn(e,function(st){st.buttons===0||!Ue(st)?et(st):Ye(st)}),ht=vn(e,et);e.state.selectingText=ht,Fe(c.wrapper.ownerDocument,"mousemove",at),Fe(c.wrapper.ownerDocument,"mouseup",ht)}function Xl(e,t){var r=t.anchor,i=t.head,c=mt(e.doc,r.line);if(Ot(r,i)==0&&r.sticky==i.sticky)return t;var M=$e(c);if(!M)return t;var K=Ze(M,r.ch,r.sticky),Q=M[K];if(Q.from!=r.ch&&Q.to!=r.ch)return t;var q=K+(Q.from==r.ch==(Q.level!=1)?0:1);if(q==0||q==M.length)return t;var te;if(i.line!=r.line)te=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Ze(M,i.ch,i.sticky),ye=pe-K||(i.ch-r.ch)*(Q.level==1?-1:1);pe==q-1||pe==q?te=ye<0:te=ye>0}var Me=M[q+(te?-1:0)],ke=te==(Me.level==1),Ge=ke?Me.from:Me.to,Ye=ke?"after":"before";return r.ch==Ge&&r.sticky==Ye?t:new Kt(new Je(r.line,Ge,Ye),i)}function bo(e,t,r,i){var c,M;if(t.touches)c=t.touches[0].clientX,M=t.touches[0].clientY;else try{c=t.clientX,M=t.clientY}catch(Me){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ae(t);var K=e.display,Q=K.lineDiv.getBoundingClientRect();if(M>Q.bottom||!_e(e,r))return fe(t);M-=Q.top-K.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=K.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=c){var pe=hn(e.doc,M),ye=e.display.gutterSpecs[q];return je(e,r,e,pe,ye.className,t),fe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(di(e.display,t)||Yl(e,t))return;if(We(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return _e(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}var or={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function r(i,c,M,K){e.defaults[i]=c,M&&(t[i]=K?function(Q,q,te){te!=or&&M(Q,q,te)}:M)}e.defineOption=r,e.Init=or,r("value","",function(i,c){return i.setValue(c)},!0),r("mode",null,function(i,c){i.doc.modeOption=c,Da(i)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(i){Cr(i),yr(i),Nn(i)},!0),r("lineSeparator",null,function(i,c){if(i.doc.lineSep=c,!c)return;var M=[],K=i.doc.first;i.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(c,te);if(pe==-1)break;te=pe+c.length,M.push(Je(K,pe))}K++});for(var Q=M.length-1;Q>=0;Q--)ir(i.doc,c,M[Q],Je(M[Q].line,M[Q].ch+c.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,c,M){i.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),M!=or&&i.refresh()}),r("specialCharPlaceholder",Qt,function(i){return i.refresh()},!0),r("electricChars",!0),r("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(i,c){return i.getInputField().spellcheck=c},!0),r("autocorrect",!1,function(i,c){return i.getInputField().autocorrect=c},!0),r("autocapitalize",!1,function(i,c){return i.getInputField().autocapitalize=c},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(i){Eo(i),Sr(i)},!0),r("keyMap","default",function(i,c,M){var K=ia(c),Q=M!=or&&ia(M);Q&&Q.detach&&Q.detach(i,K),K.attach&&K.attach(i,Q||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(i,c){i.display.gutterSpecs=La(c,i.options.lineNumbers),Sr(i)},!0),r("fixedGutter",!0,function(i,c){i.display.gutters.style.left=c?_a(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(i){return qi(i)},!0),r("scrollbarStyle","native",function(i){Ts(i),qi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),r("lineNumbers",!1,function(i,c){i.display.gutterSpecs=La(i.options.gutters,c),Sr(i)},!0),r("firstLineNumber",1,Sr,!0),r("lineNumberFormatter",function(i){return i},Sr,!0),r("showCursorWhenSelecting",!1,br,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(i,c){c=="nocursor"&&(Qi(i),i.display.input.blur()),i.display.input.readOnlyChanged(c)}),r("screenReaderLabel",null,function(i,c){c=c===""?null:c,i.display.input.screenReaderLabelChanged(c)}),r("disableInput",!1,function(i,c){c||i.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,br,!0),r("singleCursorHeightPerLine",!0,br,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Cr,!0),r("addModeClass",!1,Cr,!0),r("pollInterval",100),r("undoDepth",200,function(i,c){return i.doc.history.undoDepth=c}),r("historyEventDelay",1250),r("viewportMargin",10,function(i){return i.refresh()},!0),r("maxHighlightLength",1e4,Cr,!0),r("moveInputWithCursor",!0,function(i,c){c||i.display.input.resetPosition()}),r("tabindex",null,function(i,c){return i.display.input.getField().tabIndex=c||""}),r("autofocus",null),r("direction","ltr",function(i,c){return i.doc.setDirection(c)},!0),r("phrases",null)}function Jl(e,t,r){var i=r&&r!=or;if(!t!=!i){var c=e.display.dragFunctions,M=t?Fe:lt;M(e.display.scroller,"dragstart",c.start),M(e.display.scroller,"dragenter",c.enter),M(e.display.scroller,"dragover",c.over),M(e.display.scroller,"dragleave",c.leave),M(e.display.scroller,"drop",c.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),jr(e)),Ea(e),Nn(e),yr(e),setTimeout(function(){return qi(e)},100)}function tn(e,t){var r=this;if(!(this instanceof tn))return new tn(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var i=t.value;typeof i=="string"?i=new Fn(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var c=new tn.inputStyles[t.inputStyle](this),M=this.display=new hl(e,i,c,t);M.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new J,keySeq:null,specialChars:null},t.autofocus&&!h&&M.input.focus(),z&&G<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Rl(),Hi(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Qi(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],or);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);Wi(this),n&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}tn.defaults=xo,tn.optionHandlers=aa;function Zl(e){var t=e.display;Fe(t.scroller,"mousedown",vn(e,vo)),z&&G<11?Fe(t.scroller,"dblclick",vn(e,function(q){if(We(e,q))return;var te=Fi(e,q);if(!te||Wa(e,q)||di(e.display,q))return;ae(q);var pe=e.findWordAt(te);Zr(e.doc,pe.anchor,pe.head)})):Fe(t.scroller,"dblclick",function(q){return We(e,q)||ae(q)}),Fe(t.scroller,"contextmenu",function(q){return _o(e,q)}),Fe(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||_o(e,q)});var r,i={end:0};function c(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function M(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(q,te){if(te.left==null)return!0;var pe=te.left-q.left,ye=te.top-q.top;return pe*pe+ye*ye>20*20}Fe(t.scroller,"touchstart",function(q){if(!We(e,q)&&!M(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Fe(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!di(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||K(te,te.prev)?ye=new Kt(pe,pe):!te.prev.prev||K(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Kt(Je(pe.line,0),_(e.doc,Je(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ae(q)}c()}),Fe(t.scroller,"touchcancel",c),Fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Bi(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Fe(t.scroller,"mousewheel",function(q){return Rs(e,q)}),Fe(t.scroller,"DOMMouseScroll",function(q){return Rs(e,q)}),Fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){We(e,q)||me(q)},over:function(q){We(e,q)||(Ol(e,q),me(q))},start:function(q){return Al(e,q)},drop:vn(e,Cl),leave:function(q){We(e,q)||io(e)}};var Q=t.input.getField();Fe(Q,"keyup",function(q){return mo.call(e,q)}),Fe(Q,"keydown",vn(e,po)),Fe(Q,"keypress",vn(e,go)),Fe(Q,"focus",function(q){return Ta(e,q)}),Fe(Q,"blur",function(q){return Qi(e,q)})}var Ga=[];tn.defineInitHook=function(e){return Ga.push(e)};function Br(e,t,r,i){var c=e.doc,M;r==null&&(r="add"),r=="smart"&&(c.mode.indent?M=it(e,t).state:r="prev");var K=e.options.tabSize,Q=mt(c,t),q=W(Q.text,null,K);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],pe;if(!i&&!/\S/.test(Q.text))pe=0,r="not";else if(r=="smart"&&(pe=c.mode.indent(M,Q.text.slice(te.length),Q.text),pe==Re||pe>150)){if(!i)return;r="prev"}r=="prev"?t>c.first?pe=W(mt(c,t-1).text,null,K):pe=0:r=="add"?pe=q+e.options.indentUnit:r=="subtract"?pe=q-e.options.indentUnit:typeof r=="number"&&(pe=q+r),pe=Math.max(0,pe);var ye="",Me=0;if(e.options.indentWithTabs)for(var ke=Math.floor(pe/K);ke;--ke)Me+=K,ye+=" ";if(Me<pe&&(ye+=he(pe-Me)),ye!=te)return ir(c,ye,Je(t,0),Je(t,te.length),"+input"),Q.stateAfter=null,!0;for(var Ge=0;Ge<c.sel.ranges.length;Ge++){var Ye=c.sel.ranges[Ge];if(Ye.head.line==t&&Ye.head.ch<te.length){var et=Je(t,te.length);Na(c,Ge,new Kt(et,et));break}}}var ii=null;function sa(e){ii=e}function za(e,t,r,i,c){var M=e.doc;e.display.shift=!1,i||(i=M.sel);var K=+new Date-200,Q=c=="paste"||e.state.pasteIncoming>K,q=St(t),te=null;if(Q&&i.ranges.length>1)if(ii&&ii.text.join(`
|
|
`)==t){if(i.ranges.length%ii.text.length==0){te=[];for(var pe=0;pe<ii.text.length;pe++)te.push(M.splitLines(ii.text[pe]))}}else q.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=de(q,function(at){return[at]}));for(var ye=e.curOp.updateInput,Me=i.ranges.length-1;Me>=0;Me--){var ke=i.ranges[Me],Ge=ke.from(),Ye=ke.to();ke.empty()&&(r&&r>0?Ge=Je(Ge.line,Ge.ch-r):e.state.overwrite&&!Q?Ye=Je(Ye.line,Math.min(mt(M,Ye.line).text.length,Ye.ch+ne(q).length)):Q&&ii&&ii.lineWise&&ii.text.join(`
|
|
`)==q.join(`
|
|
`)&&(Ge=Ye=Je(Ge.line,0)));var et={from:Ge,to:Ye,text:te?te[Me%te.length]:q,origin:c||(Q?"paste":e.state.cutIncoming>K?"cut":"+input")};nr(e.doc,et),Tn(e,"inputRead",e,et)}t&&!Q&&wo(e,t),Zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&zn(t,function(){return za(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,i=r.ranges.length-1;i>=0;i--){var c=r.ranges[i];if(c.head.ch>100||i&&r.ranges[i-1].head.line==c.head.line)continue;var M=e.getModeAt(c.head),K=!1;if(M.electricChars){for(var Q=0;Q<M.electricChars.length;Q++)if(t.indexOf(M.electricChars.charAt(Q))>-1){K=Br(e,c.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(mt(e.doc,c.head.line).text.slice(0,c.head.ch))&&(K=Br(e,c.head.line,"smart")));K&&Tn(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var c=e.doc.sel.ranges[i].head.line,M={anchor:Je(c,0),head:Je(c+1,0)};r.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:r}}function Co(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,c){var M=this.options,K=M[i];if(M[i]==c&&i!="mode")return;M[i]=c,t.hasOwnProperty(i)&&vn(this,t[i])(this,c,K),je(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,c){this.state.keyMaps[c?"push":"unshift"](ia(i))},removeKeyMap:function(i){for(var c=this.state.keyMaps,M=0;M<c.length;++M)if(c[M]==i||c[M].name==i)return c.splice(M,1),!0},addOverlay:In(function(i,c){var M=i.token?i:e.getMode(this.options,i);if(M.startState)throw new Error("Overlays may not be stateful.");se(this.state.overlays,{mode:M,modeSpec:i,opaque:c&&c.opaque,priority:c&&c.priority||0},function(K){return K.priority}),this.state.modeGen++,Nn(this)}),removeOverlay:In(function(i){for(var c=this.state.overlays,M=0;M<c.length;++M){var K=c[M].modeSpec;if(K==i||typeof i=="string"&&K.name==i){c.splice(M,1),this.state.modeGen++,Nn(this);return}}}),indentLine:In(function(i,c,M){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),kn(this.doc,i)&&Br(this,i,c,M)}),indentSelection:In(function(i){for(var c=this.doc.sel.ranges,M=-1,K=0;K<c.length;K++){var Q=c[K];if(Q.empty())Q.head.line>M&&(Br(this,Q.head.line,i,!0),M=Q.head.line,K==this.doc.sel.primIndex&&Zi(this));else{var q=Q.from(),te=Q.to(),pe=Math.max(M,q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=pe;ye<M;++ye)Br(this,ye,i);var Me=this.doc.sel.ranges;q.ch==0&&c.length==Me.length&&Me[K].from().ch>0&&Na(this.doc,K,new Kt(q,Me[K].to()),ve)}}}),getTokenAt:function(i,c){return qt(this,i,c)},getLineTokens:function(i,c){return qt(this,Je(i),c,!0)},getTokenTypeAt:function(i){i=_(this.doc,i);var c=Ke(this,mt(this.doc,i.line)),M=0,K=(c.length-1)/2,Q=i.ch,q;if(Q==0)q=c[2];else for(;;){var te=M+K>>1;if((te?c[te*2-1]:0)>=Q)K=te;else if(c[te*2+1]<Q)M=te+1;else{q=c[te*2+2];break}}var pe=q?q.indexOf("overlay "):-1;return pe<0?q:pe==0?null:q.slice(0,pe-1)},getModeAt:function(i){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(i).state).mode:c},getHelper:function(i,c){return this.getHelpers(i,c)[0]},getHelpers:function(i,c){var M=[];if(!r.hasOwnProperty(c))return M;var K=r[c],Q=this.getModeAt(i);if(typeof Q[c]=="string")K[Q[c]]&&M.push(K[Q[c]]);else if(Q[c])for(var q=0;q<Q[c].length;q++){var te=K[Q[c][q]];te&&M.push(te)}else Q.helperType&&K[Q.helperType]?M.push(K[Q.helperType]):K[Q.name]&&M.push(K[Q.name]);for(var pe=0;pe<K._global.length;pe++){var ye=K._global[pe];ye.pred(Q,this)&&ie(M,ye.val)==-1&&M.push(ye.val)}return M},getStateAfter:function(i,c){var M=this.doc;return i=X(M,i==null?M.first+M.size-1:i),it(this,i+1,c).state},cursorCoords:function(i,c){var M,K=this.doc.sel.primary();return i==null?M=K.head:typeof i=="object"?M=_(this.doc,i):M=i?K.from():K.to(),ti(this,M,c||"page")},charCoords:function(i,c){return ma(this,_(this.doc,i),c||"page")},coordsChar:function(i,c){return i=ls(this,i,c||"page"),va(this,i.left,i.top)},lineAtHeight:function(i,c){return i=ls(this,{top:i,left:0},c||"page").top,hn(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,c,M){var K=!1,Q;if(typeof i=="number"){var q=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>q&&(i=q,K=!0),Q=mt(this.doc,i)}else Q=i;return Wr(this,Q,{top:0,left:0},c||"page",M||K).top+(K?this.doc.height-ei(Q):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,c,M,K,Q){var q=this.display;i=ti(this,_(this.doc,i));var te=i.bottom,pe=i.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),q.sizer.appendChild(c),K=="over")te=i.top;else if(K=="above"||K=="near"){var ye=Math.max(q.wrapper.clientHeight,this.doc.height),Me=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(K=="above"||i.bottom+c.offsetHeight>ye)&&i.top>c.offsetHeight?te=i.top-c.offsetHeight:i.bottom+c.offsetHeight<=ye&&(te=i.bottom),pe+c.offsetWidth>Me&&(pe=Me-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Q=="right"?(pe=q.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Q=="left"?pe=0:Q=="middle"&&(pe=(q.sizer.clientWidth-c.offsetWidth)/2),c.style.left=pe+"px"),M&&Jo(this,{left:pe,top:te,right:pe+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:In(po),triggerOnKeyPress:In(go),triggerOnKeyUp:mo,triggerOnMouseDown:In(vo),execCommand:function(i){if(Pr.hasOwnProperty(i))return Pr[i].call(null,this)},triggerElectric:In(function(i){wo(this,i)}),findPosH:function(i,c,M,K){var Q=1;c<0&&(Q=-1,c=-c);for(var q=_(this.doc,i),te=0;te<c&&!(q=Ka(this.doc,q,Q,M,K),q.hitSide);++te);return q},moveH:In(function(i,c){var M=this;this.extendSelectionsBy(function(K){return M.display.shift||M.doc.extend||K.empty()?Ka(M.doc,K.head,i,c,M.options.rtlMoveVisually):i<0?K.from():K.to()},Le)}),deleteH:In(function(i,c){var M=this.doc.sel,K=this.doc;M.somethingSelected()?K.replaceSelection("",null,"+delete"):sr(this,function(Q){var q=Ka(K,Q.head,i,c,!1);return i<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(i,c,M,K){var Q=1,q=K;c<0&&(Q=-1,c=-c);for(var te=_(this.doc,i),pe=0;pe<c;++pe){var ye=ti(this,te,"div");if(q==null?q=ye.left:ye.left=q,te=Oo(this,ye,Q,M),te.hitSide)break}return te},moveV:In(function(i,c){var M=this,K=this.doc,Q=[],q=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(pe){if(q)return i<0?pe.from():pe.to();var ye=ti(M,pe.head,"div");pe.goalColumn!=null&&(ye.left=pe.goalColumn),Q.push(ye.left);var Me=Oo(M,ye,i,c);return c=="page"&&pe==K.sel.primary()&&Sa(M,ma(M,Me,"div").top-ye.top),Me},Le),Q.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(i){var c=this.doc,M=mt(c,i.line).text,K=i.ch,Q=i.ch;if(M){var q=this.getHelper(i,"wordChars");(i.sticky=="before"||Q==M.length)&&K?--K:++Q;for(var te=M.charAt(K),pe=Be(te,q)?function(ye){return Be(ye,q)}:/\s/.test(te)?function(ye){return/\s/.test(ye)}:function(ye){return!/\s/.test(ye)&&!Be(ye)};K>0&&pe(M.charAt(K-1));)--K;for(;Q<M.length&&pe(M.charAt(Q));)++Q}return new Kt(Je(i.line,K),Je(i.line,Q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:In(function(i,c){_r(this,i,c)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-si(this)-this.display.barHeight,width:i.scrollWidth-si(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Pi(this)}},scrollIntoView:In(function(i,c){i==null?(i={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Je(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=c||0,i.from.line!=null?Qo(this,i):bs(this,i.from,i.to,i.margin)}),setSize:In(function(i,c){var M=this,K=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};i!=null&&(this.display.wrapper.style.width=K(i)),c!=null&&(this.display.wrapper.style.height=K(c)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){wi(M,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(i){return zn(this,i)},startOperation:function(){return Hi(this)},endOperation:function(){return Wi(this)},refresh:In(function(){var i=this.display.cachedTextHeight;Nn(this),this.curOp.forceUpdate=!0,yr(this),_r(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(i==null||Math.abs(i-$i(this.display))>.5||this.options.lineWrapping)&&Ea(this),je(this,"refresh",this)}),swapDoc:In(function(i){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),yr(this),this.display.input.reset(),_r(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Tn(this,"swapDoc",this,c),c}),phrase:function(i){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,i)?c[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(e),e.registerHelper=function(i,c,M){r.hasOwnProperty(i)||(r[i]=e[i]={_global:[]}),r[i][c]=M},e.registerGlobalHelper=function(i,c,M,K){e.registerHelper(i,c,K),r[i]._global.push({pred:M,val:K})}}function Ka(e,t,r,i,c){var M=t,K=r,Q=mt(e,t.line),q=c&&e.direction=="rtl"?-r:r;function te(){var ht=t.line+q;return ht<e.first||ht>=e.first+e.size?!1:(t=new Je(ht,t.ch,t.sticky),Q=mt(e,ht))}function pe(ht){var st;if(i=="codepoint"){var ft=Q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ft)?st=null:st=new Je(t.line,Math.max(0,Math.min(Q.text.length,t.ch+r*(ft>=55296&&ft<56320?2:1))),-r)}else c?st=Ml(e.cm,Q,t,r):st=Ua(Q,t,r);if(st==null)if(!ht&&te())t=Ba(c,e.cm,Q,t.line,q);else return!1;else t=st;return!0}if(i=="char"||i=="codepoint")pe();else if(i=="column")pe(!0);else if(i=="word"||i=="group")for(var ye=null,Me=i=="group",ke=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(r<0&&!pe(!Ge));Ge=!1){var Ye=Q.text.charAt(t.ch)||`
|
|
`,et=Be(Ye,ke)?"w":Me&&Ye==`
|
|
`?"n":!Me||/\s/.test(Ye)?null:"p";if(Me&&!Ge&&!et&&(et="s"),ye&&ye!=et){r<0&&(r=1,pe(),t.sticky="after");break}if(et&&(ye=et),r>0&&!pe(!Ge))break}var at=ea(e,t,M,K,!0);return mi(M,at)&&(at.hitSide=!0),at}function Oo(e,t,r,i){var c=e.doc,M=t.left,K;if(i=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*$i(e.display),3);K=(r>0?t.bottom:t.top)+r*q}else i=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,K),!te.outside);){if(r<0?K<=0:K>=c.height){te.hitSide=!0;break}K+=r*5}return te}var Yt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Yt.prototype.init=function(e){var t=this,r=this,i=r.cm,c=r.div=e.lineDiv;Co(c,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function M(Q){for(var q=Q.target;q;q=q.parentNode){if(q==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Fe(c,"paste",function(Q){if(!M(Q)||We(i,Q)||To(Q,i))return;G<=11&&setTimeout(vn(i,function(){return t.updateFromDOM()}),20)}),Fe(c,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Fe(c,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Fe(c,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Fe(c,"touchstart",function(){return r.forceCompositionEnd()}),Fe(c,"input",function(){t.composing||t.readFromDOMSoon()});function K(Q){if(!M(Q)||We(i,Q))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()}),Q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var q=So(i);sa({lineWise:!0,text:q.text}),Q.type=="cut"&&i.operation(function(){i.setSelections(q.ranges,0,ve),i.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=ii.text.join(`
|
|
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var pe=Ao(),ye=pe.firstChild;i.display.lineSpace.insertBefore(pe,i.display.lineSpace.firstChild),ye.value=ii.text.join(`
|
|
`);var Me=document.activeElement;N(ye),setTimeout(function(){i.display.lineSpace.removeChild(pe),Me.focus(),Me==c&&r.showPrimarySelection()},50)}Fe(c,"copy",K),Fe(c,"cut",K)},Yt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Yt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Yt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Yt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Yt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),c=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var M=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&K&&!K.bad&&Ot(yi(M,K),i)==0&&Ot(vi(M,K),c)==0)return;var Q=t.display.view,q=i.line>=t.display.viewFrom&&Ro(t,i)||{node:Q[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&Ro(t,c);if(!te){var pe=Q[Q.length-1].measure,ye=pe.maps?pe.maps[pe.maps.length-1]:pe.map;te={node:ye[ye.length-1],offset:ye[ye.length-2]-ye[ye.length-3]}}if(!q||!te){e.removeAllRanges();return}var Me=e.rangeCount&&e.getRangeAt(0),ke;try{ke=y(q.node,q.offset,te.offset,te.node)}catch(Ge){}ke&&(!P&&t.state.focused?(e.collapse(q.node,q.offset),ke.collapsed||(e.removeAllRanges(),e.addRange(ke))):(e.removeAllRanges(),e.addRange(ke)),Me&&e.anchorNode==null?e.addRange(Me):P&&this.startGracePeriod()),this.rememberSelection()},Yt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Yt.prototype.showMultipleSelections=function(e){S(this.cm.display.cursorDiv,e.cursors),S(this.cm.display.selectionDiv,e.selection)},Yt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Yt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Yt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Yt.prototype.blur=function(){this.div.blur()},Yt.prototype.getField=function(){return this.div},Yt.prototype.supportsTouch=function(){return!0},Yt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():zn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Yt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Yt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=oa(t,e.anchorNode,e.anchorOffset),i=oa(t,e.focusNode,e.focusOffset);r&&i&&zn(t,function(){On(t.doc,Ci(r,i),ve),(r.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},Yt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),i=r.from(),c=r.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Je(i.line-1,mt(e.doc,i.line-1).length)),c.ch==mt(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Je(c.line+1,0)),i.line<t.viewFrom||c.line>t.viewTo-1)return!1;var M,K,Q;i.line==t.viewFrom||(M=Ui(e,i.line))==0?(K=It(t.view[0].line),Q=t.view[0].node):(K=It(t.view[M].line),Q=t.view[M-1].node.nextSibling);var q=Ui(e,c.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=It(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Q)return!1;for(var ye=e.doc.splitLines(tu(e,Q,pe,K,te)),Me=Hn(e.doc,Je(K,0),Je(te,mt(e.doc,te).text.length));ye.length>1&&Me.length>1;)if(ne(ye)==ne(Me))ye.pop(),Me.pop(),te--;else if(ye[0]==Me[0])ye.shift(),Me.shift(),K++;else break;for(var ke=0,Ge=0,Ye=ye[0],et=Me[0],at=Math.min(Ye.length,et.length);ke<at&&Ye.charCodeAt(ke)==et.charCodeAt(ke);)++ke;for(var ht=ne(ye),st=ne(Me),ft=Math.min(ht.length-(ye.length==1?ke:0),st.length-(Me.length==1?ke:0));Ge<ft&&ht.charCodeAt(ht.length-Ge-1)==st.charCodeAt(st.length-Ge-1);)++Ge;if(ye.length==1&&Me.length==1&&K==i.line)for(;ke&&ke>i.ch&&ht.charCodeAt(ht.length-Ge-1)==st.charCodeAt(st.length-Ge-1);)ke--,Ge++;ye[ye.length-1]=ht.slice(0,ht.length-Ge).replace(/^\u200b+/,""),ye[0]=ye[0].slice(ke).replace(/\u200b+$/,"");var Ct=Je(K,ke),Et=Je(te,Me.length?ne(Me).length-Ge:0);if(ye.length>1||ye[0]||Ot(Ct,Et))return ir(e.doc,ye,Ct,Et,"+input"),!0},Yt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Yt.prototype.reset=function(){this.forceCompositionEnd()},Yt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Yt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Yt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zn(this.cm,function(){return Nn(e.cm)})},Yt.prototype.setUneditable=function(e){e.contentEditable="false"},Yt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vn(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Yt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Yt.prototype.onContextMenu=function(){},Yt.prototype.resetPosition=function(){},Yt.prototype.needsContentAttribute=!0;function Ro(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var i=mt(e.doc,t.line),c=es(r,i,t.line),M=$e(i,e.doc.direction),K="left";if(M){var Q=Ze(M,t.ch);K=Q%2?"right":"left"}var q=is(c.map,t.ch,K);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,i,c){var M="",K=!1,Q=e.doc.lineSeparator(),q=!1;function te(ke){return function(Ge){return Ge.id==ke}}function pe(){K&&(M+=Q,q&&(M+=Q),K=q=!1)}function ye(ke){ke&&(pe(),M+=ke)}function Me(ke){if(ke.nodeType==1){var Ge=ke.getAttribute("cm-text");if(Ge){ye(Ge);return}var Ye=ke.getAttribute("cm-marker"),et;if(Ye){var at=e.findMarks(Je(i,0),Je(c+1,0),te(+Ye));at.length&&(et=at[0].find(0))&&ye(Hn(e.doc,et.from,et.to).join(Q));return}if(ke.getAttribute("contenteditable")=="false")return;var ht=/^(pre|div|p|li|table|br)$/i.test(ke.nodeName);if(!/^br$/i.test(ke.nodeName)&&ke.textContent.length==0)return;ht&&pe();for(var st=0;st<ke.childNodes.length;st++)Me(ke.childNodes[st]);/^(pre|p)$/i.test(ke.nodeName)&&(q=!0),ht&&(K=!0)}else ke.nodeType==3&&ye(ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Me(t),t==r);)t=t.nextSibling,q=!1;return M}function oa(e,t,r){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[r],!i)return lr(e.clipPos(Je(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var M=e.display.view[c];if(M.node==i)return nu(M,t,r)}}function nu(e,t,r){var i=e.text.firstChild,c=!1;if(!t||!b(i,t))return lr(Je(It(e.line),0),!0);if(t==i&&(c=!0,t=i.childNodes[r],r=0,!t)){var M=e.rest?ne(e.rest):e.line;return lr(Je(It(M),M.text.length),c)}var K=t.nodeType==3?t:null,Q=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,r&&(r=K.nodeValue.length));Q.parentNode!=i;)Q=Q.parentNode;var q=e.measure,te=q.maps;function pe(et,at,ht){for(var st=-1;st<(te?te.length:0);st++)for(var ft=st<0?q.map:te[st],Ct=0;Ct<ft.length;Ct+=3){var Et=ft[Ct+2];if(Et==et||Et==at){var kt=It(st<0?e.line:e.rest[st]),Zt=ft[Ct]+ht;return(ht<0||Et!=et)&&(Zt=ft[Ct+(ht?1:0)]),Je(kt,Zt)}}}var ye=pe(K,Q,r);if(ye)return lr(ye,c);for(var Me=Q.nextSibling,ke=K?K.nodeValue.length-r:0;Me;Me=Me.nextSibling){if(ye=pe(Me,Me.firstChild,0),ye)return lr(Je(ye.line,ye.ch-ke),c);ke+=Me.textContent.length}for(var Ge=Q.previousSibling,Ye=r;Ge;Ge=Ge.previousSibling){if(ye=pe(Ge,Ge.firstChild,-1),ye)return lr(Je(ye.line,ye.ch+Ye),c);Ye+=Ge.textContent.length}}var sn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};sn.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(c.style.width="0px"),Fe(c,"input",function(){z&&G>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Fe(c,"paste",function(K){if(We(i,K)||To(K,i))return;i.state.pasteIncoming=+new Date,r.fastPoll()});function M(K){if(We(i,K))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Q=So(i);sa({lineWise:!0,text:Q.text}),K.type=="cut"?i.setSelections(Q.ranges,null,ve):(r.prevInput="",c.value=Q.text.join(`
|
|
`),N(c))}else return;K.type=="cut"&&(i.state.cutIncoming=+new Date)}Fe(c,"cut",M),Fe(c,"copy",M),Fe(e.scroller,"paste",function(K){if(di(e,K)||We(i,K))return;if(!c.dispatchEvent){i.state.pasteIncoming=+new Date,r.focus();return}var Q=new Event("paste");Q.clipboardData=K.clipboardData,c.dispatchEvent(Q)}),Fe(e.lineSpace,"selectstart",function(K){di(e,K)||ae(K)}),Fe(c,"compositionstart",function(){var K=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:i.markText(K,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Fe(c,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},sn.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},sn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},sn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var c=ti(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+K.top-M.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+K.left-M.left))}return i},sn.prototype.showSelection=function(e){var t=this.cm,r=t.display;S(r.cursorDiv,e.cursors),S(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&N(this.textarea),z&&G>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",z&&G>=9&&(this.hasSelection=null))},sn.prototype.getField=function(){return this.textarea},sn.prototype.supportsTouch=function(){return!1},sn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},sn.prototype.blur=function(){this.textarea.blur()},sn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sn.prototype.receivedFocus=function(){this.slowPoll()},sn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},sn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},sn.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=r.value;if(c==i&&!t.somethingSelected())return!1;if(z&&G>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=c.charCodeAt(0);if(M==8203&&!i&&(i="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,Q=Math.min(i.length,c.length);K<Q&&i.charCodeAt(K)==c.charCodeAt(K);)++K;return zn(t,function(){za(t,c.slice(K),i.length-K,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sn.prototype.onKeyPress=function(){z&&G>=9&&(this.hasSelection=null),this.fastPoll()},sn.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Fi(r,e),K=i.scroller.scrollTop;if(!M||m)return;var Q=r.options.resetSelectionOnContextMenu;Q&&r.doc.sel.contains(M)==-1&&vn(r,On)(r.doc,Ci(M),ve);var q=c.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px;
|
|
z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;n&&(ye=window.scrollY),i.input.focus(),n&&window.scrollTo(null,ye),i.input.reset(),r.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=ke,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll);function Me(){if(c.selectionStart!=null){var Ye=r.somethingSelected(),et="\u200B"+(Ye?c.value:"");c.value="\u21DA",c.value=et,t.prevInput=Ye?"":"\u200B",c.selectionStart=1,c.selectionEnd=et.length,i.selForContextMenu=r.doc.sel}}function ke(){if(t.contextMenuPending!=ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=q,z&&G<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=K),c.selectionStart!=null){(!z||z&&G<9)&&Me();var Ye=0,et=function(){i.selForContextMenu==r.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?vn(r,Vs)(r):Ye++<10?i.detectingSelectAll=setTimeout(et,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(et,200)}}if(z&&G>=9&&Me(),D){me(e);var Ge=function(){lt(window,"mouseup",Ge),setTimeout(ke,20)};Fe(window,"mouseup",Ge)}else setTimeout(ke,50)},sn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},sn.prototype.setUneditable=function(){},sn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=B();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function i(){e.value=Q.getValue()}var c;if(e.form&&(Fe(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var M=e.form;c=M.submit;try{var K=M.submit=function(){i(),M.submit=c,M.submit(),M.submit=K}}catch(q){}}t.finishInit=function(q){q.save=i,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,i(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Q=tn(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function ru(e){e.off=lt,e.on=Fe,e.wheelEventPixels=cl,e.Doc=Fn,e.splitLines=St,e.countColumn=W,e.findColumn=be,e.isWordChar=Pe,e.Pass=Re,e.signal=je,e.Line=Mi,e.changeEnd=Ai,e.scrollbarModel=xs,e.Pos=Je,e.cmpPos=Ot,e.modes=Dt,e.mimeModes=tt,e.resolveMode=bt,e.getMode=Vt,e.modeExtensions=_t,e.extendMode=xt,e.copyState=Bt,e.startState=pn,e.innerMode=$t,e.commands=Pr,e.keyMap=fi,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ar,e.normalizeKeyMap=kl,e.StringStream=Ut,e.SharedTextMarker=Dr,e.TextMarker=Ri,e.LineWidget=Ir,e.e_preventDefault=ae,e.e_stopPropagation=le,e.e_stop=me,e.addClass=F,e.contains=b,e.rmClass=w,e.keyNames=Li}$l(tn),ql(tn);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Fn.prototype)Fn.prototype.hasOwnProperty(la)&&ie(au,la)<0&&(tn.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fn.prototype[la]));return Te(Fn),tn.inputStyles={textarea:sn,contenteditable:Yt},tn.defineMode=function(e){!tn.defaults.mode&&e!="null"&&(tn.defaults.mode=e),fn.apply(this,arguments)},tn.defineMIME=En,tn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tn.defineMIME("text/plain","null"),tn.defineExtension=function(e,t){tn.prototype[e]=t},tn.defineDocExtension=function(e,t){Fn.prototype[e]=t},tn.fromTextArea=iu,ru(tn),tn.version="5.58.2",tn})},Y1PL:function(ot,xe,Z){"use strict";Z.r(xe),Z.d(xe,"ResizableTextArea",function(){return ie});var re=Z("wx14"),$=Z("1OyB"),P=Z("vuIU"),Y=Z("Ji7U"),j=Z("LK+K"),U=Z("q1tI"),z=Z("VTBJ"),G=Z("rePB"),n=Z("Zm9Q"),R=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),u=new Map;function l(ve){ve.forEach(function(Se){var Le,be=Se.target;(Le=u.get(be))===null||Le===void 0||Le.forEach(function(ce){return ce(be)})})}var d=new p.default(l),o=null,h=null;function s(ve,Se){u.has(ve)||(u.set(ve,new Set),d.observe(ve)),u.get(ve).add(Se)}function a(ve,Se){u.has(ve)&&(u.get(ve).delete(Se),u.get(ve).size||(d.unobserve(ve),u.delete(ve)))}var A=function(ve){Object(Y.a)(Le,ve);var Se=Object(j.a)(Le);function Le(){return Object($.a)(this,Le),Se.apply(this,arguments)}return Object(P.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(U.Component),E=U.createContext(null);function T(ve){var Se=ve.children,Le=ve.onBatchResize,be=U.useRef(0),ce=U.useRef([]),he=U.useContext(E),ne=U.useCallback(function(de,se,De){be.current+=1;var Ne=be.current;ce.current.push({size:de,element:se,data:De}),Promise.resolve().then(function(){Ne===be.current&&(Le==null||Le(ce.current),ce.current=[])}),he==null||he(de,se,De)},[Le,he]);return U.createElement(E.Provider,{value:ne},Se)}function D(ve){var Se=ve.children,Le=ve.disabled,be=U.useRef(null),ce=U.useRef(null),he=U.useContext(E),ne=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),de=U.isValidElement(Se)&&Object(v.c)(Se),se=de?Se.ref:null,De=U.useMemo(function(){return Object(v.a)(se,be)},[se,be]),Ne=U.useRef(ve);Ne.current=ve;var Ae=U.useCallback(function(Pe){var Be=Ne.current,oe=Be.onResize,ge=Be.data,Oe=Pe.getBoundingClientRect(),Ie=Oe.width,He=Oe.height,Xe=Pe.offsetWidth,qe=Pe.offsetHeight,Ze=Math.floor(Ie),nt=Math.floor(He);if(ne.current.width!==Ze||ne.current.height!==nt||ne.current.offsetWidth!==Xe||ne.current.offsetHeight!==qe){var $e={width:Ze,height:nt,offsetWidth:Xe,offsetHeight:qe};ne.current=$e;var Qe=Xe===Math.round(Ie)?Ie:Xe,Fe=qe===Math.round(He)?He:qe,ut=Object(z.a)(Object(z.a)({},$e),{},{offsetWidth:Qe,offsetHeight:Fe});he==null||he(ut,Pe,ge),oe&&Promise.resolve().then(function(){oe(ut,Pe)})}},[]);return U.useEffect(function(){var Pe=Object(m.a)(be.current)||Object(m.a)(ce.current);return Pe&&!Le&&s(Pe,Ae),function(){return a(Pe,Ae)}},[be.current,Le]),U.createElement(A,{ref:ce},de?U.cloneElement(Se,{ref:De}):Se)}var L="rc-observer-key";function w(ve){var Se=ve.children,Le=Object(n.a)(Se);return Le.map(function(be,ce){var he=(be==null?void 0:be.key)||"".concat(L,"-").concat(ce);return U.createElement(D,Object(re.a)({},ve,{key:he}),be)})}w.Collection=T;var O=w,S=Z("bT9E"),f=Z("TSYQ"),C=Z.n(f),y=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],B={},F;function x(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Se&&B[Le])return B[Le];var be=window.getComputedStyle(ve),ce=be.getPropertyValue("box-sizing")||be.getPropertyValue("-moz-box-sizing")||be.getPropertyValue("-webkit-box-sizing"),he=parseFloat(be.getPropertyValue("padding-bottom"))+parseFloat(be.getPropertyValue("padding-top")),ne=parseFloat(be.getPropertyValue("border-bottom-width"))+parseFloat(be.getPropertyValue("border-top-width")),de=b.map(function(De){return"".concat(De,":").concat(be.getPropertyValue(De))}).join(";"),se={sizingStyle:de,paddingSize:he,borderSize:ne,boxSizing:ce};return Se&&Le&&(B[Le]=se),se}function N(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ve.getAttribute("wrap")?F.setAttribute("wrap",ve.getAttribute("wrap")):F.removeAttribute("wrap");var ce=x(ve,Se),he=ce.paddingSize,ne=ce.borderSize,de=ce.boxSizing,se=ce.sizingStyle;F.setAttribute("style","".concat(se,";").concat(y)),F.value=ve.value||ve.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Ae=F.scrollHeight,Pe;if(de==="border-box"?Ae+=ne:de==="content-box"&&(Ae-=he),Le!==null||be!==null){F.value=" ";var Be=F.scrollHeight-he;Le!==null&&(De=Be*Le,de==="border-box"&&(De=De+he+ne),Ae=Math.max(De,Ae)),be!==null&&(Ne=Be*be,de==="border-box"&&(Ne=Ne+he+ne),Pe=Ae>Ne?"":"hidden",Ae=Math.min(Ne,Ae))}return{height:Ae,minHeight:De,maxHeight:Ne,overflowY:Pe,resize:"none"}}var I=Z("Gytx"),g=Z.n(I),W;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(W||(W={}));var J=function(ve){Object(Y.a)(Le,ve);var Se=Object(j.a)(Le);function Le(be){var ce;return Object($.a)(this,Le),ce=Se.call(this,be),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(he){ce.textArea=he},ce.handleResize=function(he){var ne=ce.state.resizeStatus,de=ce.props,se=de.autoSize,De=de.onResize;if(ne!==W.NONE)return;typeof De=="function"&&De(he),se&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var he=ce.props.autoSize;if(!he||!ce.textArea)return;var ne=he.minRows,de=he.maxRows,se=N(ce.textArea,!1,ne,de);ce.setState({textareaStyles:se,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:W.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:W.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var he=ce.props,ne=he.prefixCls,de=ne===void 0?"rc-textarea":ne,se=he.autoSize,De=he.onResize,Ne=he.className,Ae=he.disabled,Pe=ce.state,Be=Pe.textareaStyles,oe=Pe.resizeStatus,ge=Object(S.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Oe=C()(de,Ne,Object(G.a)({},"".concat(de,"-disabled"),Ae));"value"in ge&&(ge.value=ge.value||"");var Ie=Object(z.a)(Object(z.a)(Object(z.a)({},ce.props.style),Be),oe===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(O,{onResize:ce.handleResize,disabled:!(se||De)},U.createElement("textarea",Object(re.a)({},ge,{className:Oe,style:Ie,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:W.NONE},ce}return Object(P.a)(Le,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!g()(ce.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ce=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,he)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(U.Component),ie=J,ue=function(ve){Object(Y.a)(Le,ve);var Se=Object(j.a)(Le);function Le(be){var ce;Object($.a)(this,Le),ce=Se.call(this,be),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(ne){ce.resizableTextArea=ne},ce.handleChange=function(ne){var de=ce.props.onChange;ce.setValue(ne.target.value,function(){ce.resizableTextArea.resizeTextarea()}),de&&de(ne)},ce.handleKeyDown=function(ne){var de=ce.props,se=de.onPressEnter,De=de.onKeyDown;ne.keyCode===13&&se&&se(ne),De&&De(ne)};var he=typeof be.value=="undefined"||be.value===null?be.defaultValue:be.value;return ce.state={value:he},ce}return Object(P.a)(Le,[{key:"setValue",value:function(ce,he){"value"in this.props||this.setState({value:ce},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ie,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Le}(U.Component),Re=xe.default=ue},ZW9T:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return I});var re=Z("k1fw"),$=Z("oBTY"),P=Z("miYZ"),Y=Z("tsqr"),j=Z("rAM+"),U=Z("tJVT"),z=Z("PpiC"),G=Z("q1tI"),n=Z.n(G),R=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},l={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},h=Z("5VLF"),s=Z.n(h),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=function(W,J){return J.map(function(ie){return{label:ie,kind:W.languages.CompletionItemKind.Keyword,insertText:ie}})},E=function(W){return Object.keys(a.tables).map(function(J){return{label:J,kind:W.languages.CompletionItemKind.Variable,insertText:J}})},T=function(W,J){var ie=a.tables[W];return ie?ie.map(function(ue){return{label:ue,kind:J.languages.CompletionItemKind.Field,insertText:ue}}):[]};function D(g,W,J,ie,ue){var Re=W.getWordUntilPosition(J),ve={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Se=ie.map(function(Le){return{label:Le,kind:g.languages.CompletionItemKind.Keyword,insertText:Le,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return ue.map(function(Le){Se.push(Object(re.a)(Object(re.a)({},Le),{},{range:ve}))}),Se}var L=function(g){a.languages.map(function(ue){return g.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(ve,Se,Le){return Object(v.a)(p.a.mark(function be(){var ce;return p.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return ce=s()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:ve.getFullModelRange(),text:ce}]);case 2:case"end":return ne.stop()}},be)}))()}}),ue});var W=d.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=o.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=l.quickKey.map(function(ue){return{label:ue.label,kind:g.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,ve){var Se=Re.getWordUntilPosition(ve),Le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},be=Re.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object($.a)(d.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object($.a)(d.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:be.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,ve){var Se=Re.getWordUntilPosition(ve),Le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn};return{suggestions:Object($.a)(u.keywords.map(function(be){return{label:be,kind:g.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,ve){var Se=Re.getWordUntilPosition(ve),Le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},be=Re.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object($.a)(l.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:be.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,ve){var Se=Re.getWordUntilPosition(ve),Le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},be=Re.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object($.a)(o.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:be.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",O=Z("fjLI"),S=Z("LvDl"),f=Z("+ua5");function C(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,B={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=g;if(Array.isArray(g)){for(var J=0;J<g.length;J++){var ie=B[g[J]];if(ie)return ie}return W[0]}return B[W]||W}var x=null,N=xe.b=function(g){var W=g.width,J=W===void 0?"100%":W,ie=g.height,ue=ie===void 0?"100%":ie,Re=g.value,ve=g.language,Se=ve===void 0?"javascript":ve,Le=g.style,be=Le===void 0?{}:Le,ce=g.options,he=ce===void 0?{}:ce,ne=g.overrideServices,de=ne===void 0?{}:ne,se=g.theme,De=se===void 0?"vs-dark":se,Ne=g.onEditBlur,Ae=g.onSave,Pe=g.autoHeight,Be=Pe===void 0?!1:Pe,oe=g.forbidCopy,ge=oe===void 0?!1:oe,Oe=g.onChange,Ie=Oe===void 0?y:Oe,He=g.editorDidMount,Xe=He===void 0?y:He,qe=g.onFocus,Ze=qe===void 0?y:qe,nt=g.filename,$e=nt===void 0?"educoder.txt":nt,Qe=g.errorLine,Fe=g.errorContent,ut=Fe===void 0?"":Fe,lt=Object(z.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),je=Object(G.useRef)(),We=Object(G.useRef)({}),Ce=Object(G.useRef)(),_e=Object(G.useRef)(),Te=Object(G.useRef)(!1),ae=Object(G.useRef)(),le=Object(G.useState)(!1),fe=Object(U.a)(le,2),me=fe[0],we=fe[1];function Ue(){var _t;return je.current&&(_t=new R.default(function(xt){var Bt=Object(j.a)(xt),$t;try{for(Bt.s();!($t=Bt.n()).done;){var pn=$t.value;(pn.target.offsetHeight>0||pn.target.offsetWidth>0)&&We.current.instance.layout()}}catch(Ut){Bt.e(Ut)}finally{Bt.f()}}),_t.observe(je.current)),_t}function ze(){Y.b.warn(decodeURIComponent(w))}var rt=function(){var xt=We.current.instance;if(Re!=null&&xt&&me){var Bt=xt.getModel();Bt&&Re!==Bt.getValue()&&(b=!0,Bt.setValue(Re),xt.layout(),b=!1)}};Object(G.useEffect)(function(){_e.current&&clearTimeout(_e.current),_e.current=setTimeout(function(){rt()},500)},[Re,me,We.current]),Object(G.useEffect)(function(){if(Qe&&We.current&&We.current.instance){var _t=We.current.instance;_t.changeViewZones(function(Bt){var $t=document.createElement("div");$t.style.padding="10px 20px",$t.style.width="calc(100% - 20px)",$t.className="my-error-line-wrp",$t.innerHTML=ut,Bt.addZone({afterLineNumber:Qe||11,heightInLines:3,domNode:$t})});var xt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};_t.addOverlayWidget(xt),_t.revealPositionInCenter({lineNumber:20,column:1})}},[Qe,We.current,me]);function pt(){var _t=We.current.instance;if(_t){var xt=_t.getSelection(),Bt=We.current.pastePos||{},$t=new x.Range(Bt.startLineNumber||xt.endLineNumber,Bt.startColumn||xt.endColumn,Bt.endLineNumber||xt.endLineNumber,Bt.endColumn||xt.endColumn);setTimeout(function(){_t.executeEdits("",[{range:$t,text:""}])},300)}}function ct(_t){(window.navigator.platform.match("Mac")?_t.metaKey:_t.ctrlKey)&&_t.keyCode==83&&(_t.preventDefault(),Ae())}var At=function(){if(Be&&We.current.instance){var xt=We.current.instance.getContentHeight();bt(xt<ue?ue:xt)}else bt(ue)};function St(_t){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_t.dispatchEvent(xt)}function dt(_t,xt){var Bt=window.URL||window.webkitURL||window,$t=new Blob([xt]),pn=document.createElementNS("http://www.w3.org/1999/xhtml","a");pn.href=Bt.createObjectURL($t),pn.download=_t,St(pn)}Object(G.useEffect)(function(){At()},[At]),Object(G.useEffect)(function(){je.current&&!me&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(_t){try{x=_t,We.current.instance=x.editor.create(je.current,{value:Re,language:F(Se),theme:De,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},de);var xt=We.current.instance,Bt=O.d._menuItems,$t=Object($.a)(Bt).find(function(Jt){return Jt[0]._debugName=="EditorContext"}),pn=$t[1],Ut=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],mt=function(en,It){var hn=en._first;do{var kn,$n,Je=It.includes((kn=hn.element)===null||kn===void 0||(($n=kn.command)===null||$n===void 0)?void 0:$n.id);Je&&en._remove(hn)}while(hn=hn.next)};if(Xe(xt,x),setTimeout(function(){At(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){dt($e||"educoder.txt",xt.getValue())}}),xt.getDomNode().addEventListener("input",function(){Ce.current.autoFormat&&xt.getAction("editor.action.formatDocument").run()})},500),We.current.subscription=xt.onDidChangeModelContent(function(Jt){Te.current?clearTimeout(ae.current):(At(),Ie(xt.getValue(),Jt)),ae.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||L(x,F(Se)),ge&&(mt(pn,Ut),je.current.classList.add("noCopyPaste"),xt.onKeyDown(function(Jt){var en=Jt.keyCode,It=Jt.ctrlKey,hn=Jt.metaKey;(en===33||en===52)&&(hn||It)&&(ze(),Jt.preventDefault())})),window.Monaco=x,Ne&&xt.onDidBlurEditorWidget(function(){Ne(xt.getValue())}),Ze&&xt.onDidFocusEditorText(function(){Ze(xt.getValue())}),ge){xt.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return ze(),null}),xt.onDidPaste(function(Jt){We.current.pastePos=Jt});try{window.addEventListener("paste",pt)}catch(Jt){}}var Hn=Ue();return we(!0),function(){var Jt=We.current.instance;Jt.dispose();var en=Jt.getModel();en&&en.dispose(),We.current.subscription&&We.current.subscription.dispose(),ge&&window.removeEventListener("paste",pt),Hn.unobserve(je.current)}}catch(Jt){}})},[]),Object(G.useEffect)(function(){var _t=We.current.instance;if(_t&&me)return document.addEventListener("keydown",ct,!1),function(){document.removeEventListener("keydown",ct)}},[Ae,me]),Object(G.useEffect)(function(){var _t=We.current.instance;if(_t&&me){var xt=F(Se);x.editor.setModelLanguage(_t.getModel(),xt),console.log("language:",Se,_t.getModel(),xt)}},[Se,me]),Object(G.useEffect)(function(){var _t=We.current.instance;_t&&me&&x.editor.setTheme(De)},[De,me]),Object(G.useEffect)(function(){var _t=We.current.instance;Ce.current=he,_t&&me&&(_t.updateOptions(Object(re.a)({},he)),setTimeout(function(){_t.getModel().updateOptions(Object(re.a)({},he))},200))},[JSON.stringify(he),me]),Object(G.useEffect)(function(){var _t=We.current.instance;_t&&me&&_t.layout()},[J,ue,me]);var Ft=Object(G.useState)(C(J)),gt=Object(U.a)(Ft,2),Lt=gt[0],Dt=gt[1],tt=Object(G.useState)(C(ue)),fn=Object(U.a)(tt,2),En=fn[0],bt=fn[1],Vt=Object(re.a)(Object(re.a)({},be),{},{width:Lt,height:En});return n.a.createElement("div",{className:"my-monaco-editor",ref:je,style:Vt})};function I(g){var W=g.width,J=W===void 0?"100%":W,ie=g.height,ue=ie===void 0?"100%":ie,Re=g.original,ve=g.modified,Se=g.language,Le=g.options,be=Le===void 0?{}:Le,ce=Object(G.useRef)(),he=Object(G.useState)(null),ne=Object(U.a)(he,2),de=ne[0],se=ne[1];function De(Be){var oe;return ce.current&&(oe=new R.default(function(ge){var Oe=Object(j.a)(ge),Ie;try{for(Oe.s();!(Ie=Oe.n()).done;){var He=Ie.value;(He.target.offsetHeight>0||He.target.offsetWidth>0)&&Be.layout()}}catch(Xe){Oe.e(Xe)}finally{Oe.f()}}),oe.observe(ce.current)),oe}Object(G.useEffect)(function(){ce.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(Be){x=Be;var oe=x.editor.createDiffEditor(ce.current,Object(re.a)(Object(re.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},be),{},{wordWrap:!0}));se(oe);var ge=De(oe);return function(){oe.dispose();var Oe=oe.getModel();Oe&&Oe.dispose(),ge.unobserve(ce.current)}})},[]),Object(G.useEffect)(function(){de&&de.setModel({original:x.editor.createModel(Re,Se),modified:x.editor.createModel(ve,Se)})},[Re,ve,Se,de]);var Ne=C(J),Ae=C(ue),Pe={width:Ne,height:Ae};return n.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Pe})}},ZpRC:function(ot,xe,Z){"use strict";function re(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function $(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return $(p.overflowY,m)||$(p.overflowX,m)||function(u){var l=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(o){return null}}(u);return!!l&&(l.clientHeight<u.scrollHeight||l.clientWidth<u.scrollWidth)}(v)}return!1}function Y(v,m,p,u,l,d,o,h){return d<v&&o>m||d>v&&o<m?0:d<=v&&h<=p||o>=m&&h>=p?d-v-u:o>m&&h<p||d<v&&h>p?o-m+l:0}var j=function(v,m){var p=window,u=m.scrollMode,l=m.block,d=m.inline,o=m.boundary,h=m.skipOverflowHiddenElements,s=typeof o=="function"?o:function(Be){return Be!==o};if(!re(v))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,A=[],E=v;re(E)&&s(E);){if((E=E.parentElement)===a){A.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,h)&&A.push(E)}for(var T=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,L=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,O=v.getBoundingClientRect(),S=O.height,f=O.width,C=O.top,y=O.right,b=O.bottom,B=O.left,F=l==="start"||l==="nearest"?C:l==="end"?b:C+S/2,x=d==="center"?B+f/2:d==="end"?y:B,N=[],I=0;I<A.length;I++){var g=A[I],W=g.getBoundingClientRect(),J=W.height,ie=W.width,ue=W.top,Re=W.right,ve=W.bottom,Se=W.left;if(u==="if-needed"&&C>=0&&B>=0&&b<=D&&y<=T&&C>=ue&&b<=ve&&B>=Se&&y<=Re)return N;var Le=getComputedStyle(g),be=parseInt(Le.borderLeftWidth,10),ce=parseInt(Le.borderTopWidth,10),he=parseInt(Le.borderRightWidth,10),ne=parseInt(Le.borderBottomWidth,10),de=0,se=0,De="offsetWidth"in g?g.offsetWidth-g.clientWidth-be-he:0,Ne="offsetHeight"in g?g.offsetHeight-g.clientHeight-ce-ne:0;if(a===g)de=l==="start"?F:l==="end"?F-D:l==="nearest"?Y(w,w+D,D,ce,ne,w+F,w+F+S,S):F-D/2,se=d==="start"?x:d==="center"?x-T/2:d==="end"?x-T:Y(L,L+T,T,be,he,L+x,L+x+f,f),de=Math.max(0,de+w),se=Math.max(0,se+L);else{de=l==="start"?F-ue-ce:l==="end"?F-ve+ne+Ne:l==="nearest"?Y(ue,ve,J,ce,ne+Ne,F,F+S,S):F-(ue+J/2)+Ne/2,se=d==="start"?x-Se-be:d==="center"?x-(Se+ie/2)+De/2:d==="end"?x-Re+he+De:Y(Se,Re,ie,be,he+De,x,x+f,f);var Ae=g.scrollLeft,Pe=g.scrollTop;F+=Pe-(de=Math.max(0,Math.min(Pe+de,g.scrollHeight-J+Ne))),x+=Ae-(se=Math.max(0,Math.min(Ae+se,g.scrollWidth-ie+De)))}N.push({el:g,top:de,left:se})}return N};function U(v){return v===Object(v)&&Object.keys(v).length!==0}function z(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(u){var l=u.el,d=u.top,o=u.left;l.scroll&&p?l.scroll({top:d,left:o,behavior:m}):(l.scrollTop=d,l.scrollLeft=o)})}function G(v){return v===!1?{block:"end",inline:"nearest"}:U(v)?v:{block:"start",inline:"nearest"}}function n(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(U(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var u=G(m);return z(j(v,u),u.behavior)}var R=xe.a=n},Zss7:function(ot,xe,Z){var re;(function($){var P=/^\s+/,Y=/\s+$/,j=0,U=$.round,z=$.min,G=$.max,n=$.random;function R(ne,de){if(ne=ne||"",de=de||{},ne instanceof R)return ne;if(!(this instanceof R))return new R(ne,de);var se=v(ne);this._originalInput=ne,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=U(100*this._a)/100,this._format=de.format||se.format,this._gradientType=de.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=se.ok,this._tc_id=j++}R.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),de,se,De,Ne,Ae,Pe;return de=ne.r/255,se=ne.g/255,De=ne.b/255,de<=.03928?Ne=de/12.92:Ne=$.pow((de+.055)/1.055,2.4),se<=.03928?Ae=se/12.92:Ae=$.pow((se+.055)/1.055,2.4),De<=.03928?Pe=De/12.92:Pe=$.pow((De+.055)/1.055,2.4),.2126*Ne+.7152*Ae+.0722*Pe},setAlpha:function(ne){return this._a=N(ne),this._roundA=U(100*this._a)/100,this},toHsv:function(){var ne=l(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=l(this._r,this._g,this._b),de=U(ne.h*360),se=U(ne.s*100),De=U(ne.v*100);return this._a==1?"hsv("+de+", "+se+"%, "+De+"%)":"hsva("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var ne=p(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=p(this._r,this._g,this._b),de=U(ne.h*360),se=U(ne.s*100),De=U(ne.l*100);return this._a==1?"hsl("+de+", "+se+"%, "+De+"%)":"hsla("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHex:function(ne){return o(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return h(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(I(this._r,255)*100)+"%",g:U(I(this._g,255)*100)+"%",b:U(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%)":"rgba("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var de="#"+s(this._r,this._g,this._b,this._a),se=de,De=this._gradientType?"GradientType = 1, ":"";if(ne){var Ne=R(ne);se="#"+s(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+de+",endColorstr="+se+")"},toString:function(ne){var de=!!ne;ne=ne||this._format;var se=!1,De=this._a<1&&this._a>=0,Ne=!de&&De&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return Ne?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(se=this.toRgbString()),ne==="prgb"&&(se=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(se=this.toHexString()),ne==="hex3"&&(se=this.toHexString(!0)),ne==="hex4"&&(se=this.toHex8String(!0)),ne==="hex8"&&(se=this.toHex8String()),ne==="name"&&(se=this.toName()),ne==="hsl"&&(se=this.toHslString()),ne==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function(ne,de){var se=ne.apply(null,[this].concat([].slice.call(de)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(L,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(A,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(ne,de){return ne.apply(null,[this].concat([].slice.call(de)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},R.fromRatio=function(ne,de){if(typeof ne=="object"){var se={};for(var De in ne)ne.hasOwnProperty(De)&&(De==="a"?se[De]=ne[De]:se[De]=Re(ne[De]));ne=se}return R(ne,de)};function v(ne){var de={r:0,g:0,b:0},se=1,De=null,Ne=null,Ae=null,Pe=!1,Be=!1;return typeof ne=="string"&&(ne=ce(ne)),typeof ne=="object"&&(be(ne.r)&&be(ne.g)&&be(ne.b)?(de=m(ne.r,ne.g,ne.b),Pe=!0,Be=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):be(ne.h)&&be(ne.s)&&be(ne.v)?(De=Re(ne.s),Ne=Re(ne.v),de=d(ne.h,De,Ne),Pe=!0,Be="hsv"):be(ne.h)&&be(ne.s)&&be(ne.l)&&(De=Re(ne.s),Ae=Re(ne.l),de=u(ne.h,De,Ae),Pe=!0,Be="hsl"),ne.hasOwnProperty("a")&&(se=ne.a)),se=N(se),{ok:Pe,format:ne.format||Be,r:z(255,G(de.r,0)),g:z(255,G(de.g,0)),b:z(255,G(de.b,0)),a:se}}function m(ne,de,se){return{r:I(ne,255)*255,g:I(de,255)*255,b:I(se,255)*255}}function p(ne,de,se){ne=I(ne,255),de=I(de,255),se=I(se,255);var De=G(ne,de,se),Ne=z(ne,de,se),Ae,Pe,Be=(De+Ne)/2;if(De==Ne)Ae=Pe=0;else{var oe=De-Ne;Pe=Be>.5?oe/(2-De-Ne):oe/(De+Ne);switch(De){case ne:Ae=(de-se)/oe+(de<se?6:0);break;case de:Ae=(se-ne)/oe+2;break;case se:Ae=(ne-de)/oe+4;break}Ae/=6}return{h:Ae,s:Pe,l:Be}}function u(ne,de,se){var De,Ne,Ae;ne=I(ne,360),de=I(de,100),se=I(se,100);function Pe(ge,Oe,Ie){return Ie<0&&(Ie+=1),Ie>1&&(Ie-=1),Ie<1/6?ge+(Oe-ge)*6*Ie:Ie<1/2?Oe:Ie<2/3?ge+(Oe-ge)*(2/3-Ie)*6:ge}if(de===0)De=Ne=Ae=se;else{var Be=se<.5?se*(1+de):se+de-se*de,oe=2*se-Be;De=Pe(oe,Be,ne+1/3),Ne=Pe(oe,Be,ne),Ae=Pe(oe,Be,ne-1/3)}return{r:De*255,g:Ne*255,b:Ae*255}}function l(ne,de,se){ne=I(ne,255),de=I(de,255),se=I(se,255);var De=G(ne,de,se),Ne=z(ne,de,se),Ae,Pe,Be=De,oe=De-Ne;if(Pe=De===0?0:oe/De,De==Ne)Ae=0;else{switch(De){case ne:Ae=(de-se)/oe+(de<se?6:0);break;case de:Ae=(se-ne)/oe+2;break;case se:Ae=(ne-de)/oe+4;break}Ae/=6}return{h:Ae,s:Pe,v:Be}}function d(ne,de,se){ne=I(ne,360)*6,de=I(de,100),se=I(se,100);var De=$.floor(ne),Ne=ne-De,Ae=se*(1-de),Pe=se*(1-Ne*de),Be=se*(1-(1-Ne)*de),oe=De%6,ge=[se,Pe,Ae,Ae,Be,se][oe],Oe=[Be,se,se,Pe,Ae,Ae][oe],Ie=[Ae,Ae,Be,se,se,Pe][oe];return{r:ge*255,g:Oe*255,b:Ie*255}}function o(ne,de,se,De){var Ne=[ue(U(ne).toString(16)),ue(U(de).toString(16)),ue(U(se).toString(16))];return De&&Ne[0].charAt(0)==Ne[0].charAt(1)&&Ne[1].charAt(0)==Ne[1].charAt(1)&&Ne[2].charAt(0)==Ne[2].charAt(1)?Ne[0].charAt(0)+Ne[1].charAt(0)+Ne[2].charAt(0):Ne.join("")}function h(ne,de,se,De,Ne){var Ae=[ue(U(ne).toString(16)),ue(U(de).toString(16)),ue(U(se).toString(16)),ue(ve(De))];return Ne&&Ae[0].charAt(0)==Ae[0].charAt(1)&&Ae[1].charAt(0)==Ae[1].charAt(1)&&Ae[2].charAt(0)==Ae[2].charAt(1)&&Ae[3].charAt(0)==Ae[3].charAt(1)?Ae[0].charAt(0)+Ae[1].charAt(0)+Ae[2].charAt(0)+Ae[3].charAt(0):Ae.join("")}function s(ne,de,se,De){var Ne=[ue(ve(De)),ue(U(ne).toString(16)),ue(U(de).toString(16)),ue(U(se).toString(16))];return Ne.join("")}R.equals=function(ne,de){return!ne||!de?!1:R(ne).toRgbString()==R(de).toRgbString()},R.random=function(){return R.fromRatio({r:n(),g:n(),b:n()})};function a(ne,de){de=de===0?0:de||10;var se=R(ne).toHsl();return se.s-=de/100,se.s=g(se.s),R(se)}function A(ne,de){de=de===0?0:de||10;var se=R(ne).toHsl();return se.s+=de/100,se.s=g(se.s),R(se)}function E(ne){return R(ne).desaturate(100)}function T(ne,de){de=de===0?0:de||10;var se=R(ne).toHsl();return se.l+=de/100,se.l=g(se.l),R(se)}function D(ne,de){de=de===0?0:de||10;var se=R(ne).toRgb();return se.r=G(0,z(255,se.r-U(255*-(de/100)))),se.g=G(0,z(255,se.g-U(255*-(de/100)))),se.b=G(0,z(255,se.b-U(255*-(de/100)))),R(se)}function L(ne,de){de=de===0?0:de||10;var se=R(ne).toHsl();return se.l-=de/100,se.l=g(se.l),R(se)}function w(ne,de){var se=R(ne).toHsl(),De=(se.h+de)%360;return se.h=De<0?360+De:De,R(se)}function O(ne){var de=R(ne).toHsl();return de.h=(de.h+180)%360,R(de)}function S(ne){var de=R(ne).toHsl(),se=de.h;return[R(ne),R({h:(se+120)%360,s:de.s,l:de.l}),R({h:(se+240)%360,s:de.s,l:de.l})]}function f(ne){var de=R(ne).toHsl(),se=de.h;return[R(ne),R({h:(se+90)%360,s:de.s,l:de.l}),R({h:(se+180)%360,s:de.s,l:de.l}),R({h:(se+270)%360,s:de.s,l:de.l})]}function C(ne){var de=R(ne).toHsl(),se=de.h;return[R(ne),R({h:(se+72)%360,s:de.s,l:de.l}),R({h:(se+216)%360,s:de.s,l:de.l})]}function y(ne,de,se){de=de||6,se=se||30;var De=R(ne).toHsl(),Ne=360/se,Ae=[R(ne)];for(De.h=(De.h-(Ne*de>>1)+720)%360;--de;)De.h=(De.h+Ne)%360,Ae.push(R(De));return Ae}function b(ne,de){de=de||6;for(var se=R(ne).toHsv(),De=se.h,Ne=se.s,Ae=se.v,Pe=[],Be=1/de;de--;)Pe.push(R({h:De,s:Ne,v:Ae})),Ae=(Ae+Be)%1;return Pe}R.mix=function(ne,de,se){se=se===0?0:se||50;var De=R(ne).toRgb(),Ne=R(de).toRgb(),Ae=se/100,Pe={r:(Ne.r-De.r)*Ae+De.r,g:(Ne.g-De.g)*Ae+De.g,b:(Ne.b-De.b)*Ae+De.b,a:(Ne.a-De.a)*Ae+De.a};return R(Pe)},R.readability=function(ne,de){var se=R(ne),De=R(de);return($.max(se.getLuminance(),De.getLuminance())+.05)/($.min(se.getLuminance(),De.getLuminance())+.05)},R.isReadable=function(ne,de,se){var De=R.readability(ne,de),Ne,Ae;Ae=!1,Ne=he(se);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Ae=De>=4.5;break;case"AAlarge":Ae=De>=3;break;case"AAAsmall":Ae=De>=7;break}return Ae},R.mostReadable=function(ne,de,se){var De=null,Ne=0,Ae,Pe,Be,oe;se=se||{},Pe=se.includeFallbackColors,Be=se.level,oe=se.size;for(var ge=0;ge<de.length;ge++)Ae=R.readability(ne,de[ge]),Ae>Ne&&(Ne=Ae,De=R(de[ge]));return R.isReadable(ne,De,{level:Be,size:oe})||!Pe?De:(se.includeFallbackColors=!1,R.mostReadable(ne,["#fff","#000"],se))};var B=R.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=R.hexNames=x(B);function x(ne){var de={};for(var se in ne)ne.hasOwnProperty(se)&&(de[ne[se]]=se);return de}function N(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function I(ne,de){J(ne)&&(ne="100%");var se=ie(ne);return ne=z(de,G(0,parseFloat(ne))),se&&(ne=parseInt(ne*de,10)/100),$.abs(ne-de)<1e-6?1:ne%de/parseFloat(de)}function g(ne){return z(1,G(0,ne))}function W(ne){return parseInt(ne,16)}function J(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function ie(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function ue(ne){return ne.length==1?"0"+ne:""+ne}function Re(ne){return ne<=1&&(ne=ne*100+"%"),ne}function ve(ne){return $.round(parseFloat(ne)*255).toString(16)}function Se(ne){return W(ne)/255}var Le=function(){var ne="[-\\+]?\\d+%?",de="[-\\+]?\\d*\\.\\d+%?",se="(?:"+de+")|(?:"+ne+")",De="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",Ne="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+Ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function be(ne){return!!Le.CSS_UNIT.exec(ne)}function ce(ne){ne=ne.replace(P,"").replace(Y,"").toLowerCase();var de=!1;if(B[ne])ne=B[ne],de=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Le.rgb.exec(ne))?{r:se[1],g:se[2],b:se[3]}:(se=Le.rgba.exec(ne))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Le.hsl.exec(ne))?{h:se[1],s:se[2],l:se[3]}:(se=Le.hsla.exec(ne))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Le.hsv.exec(ne))?{h:se[1],s:se[2],v:se[3]}:(se=Le.hsva.exec(ne))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Le.hex8.exec(ne))?{r:W(se[1]),g:W(se[2]),b:W(se[3]),a:Se(se[4]),format:de?"name":"hex8"}:(se=Le.hex6.exec(ne))?{r:W(se[1]),g:W(se[2]),b:W(se[3]),format:de?"name":"hex"}:(se=Le.hex4.exec(ne))?{r:W(se[1]+""+se[1]),g:W(se[2]+""+se[2]),b:W(se[3]+""+se[3]),a:Se(se[4]+""+se[4]),format:de?"name":"hex8"}:(se=Le.hex3.exec(ne))?{r:W(se[1]+""+se[1]),g:W(se[2]+""+se[2]),b:W(se[3]+""+se[3]),format:de?"name":"hex"}:!1}function he(ne){var de,se;return ne=ne||{level:"AA",size:"small"},de=(ne.level||"AA").toUpperCase(),se=(ne.size||"small").toLowerCase(),de!=="AA"&&de!=="AAA"&&(de="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:de,size:se}}ot.exports?ot.exports=R:!(re=function(){return R}.call(xe,Z,xe,ot),re!==void 0&&(ot.exports=re))})(Math)},bT9E:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});var re=Z("VTBJ");function $(P,Y){var j=Object(re.a)({},P);return Array.isArray(Y)&&Y.forEach(function(U){delete j[U]}),j}},c5Ni:function(ot,xe,Z){},dejd:function(ot,xe,Z){},dmUQ:function(ot,xe,Z){"use strict";var re=Z("Ff2n"),$=Z("rePB"),P=Z("1OyB"),Y=Z("vuIU"),j=Z("Ji7U"),U=Z("md7G"),z=Z("foSv"),G=Z("q1tI"),n=Z.n(G),R=Z("TSYQ"),v=Z.n(R),m=Z("4IlW");function p(S,f){var C=Object.keys(S);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(S);f&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(S,b).enumerable})),C.push.apply(C,y)}return C}function u(S){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?p(Object(C),!0).forEach(function(y){Object($.a)(S,y,C[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(C)):p(Object(C)).forEach(function(y){Object.defineProperty(S,y,Object.getOwnPropertyDescriptor(C,y))})}return S}function l(S){var f=d();return function(){var y=Object(z.a)(S),b;if(f){var B=Object(z.a)(this).constructor;b=Reflect.construct(y,arguments,B)}else b=y.apply(this,arguments);return Object(U.a)(this,b)}}function d(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(S){return!1}}function o(){}function h(S){S.preventDefault()}var s=function(f){return f.replace(/[^\w.-]+/g,"")},a=200,A=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(f){return f!=null},D=function(f,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},L=function(S){Object(j.a)(C,S);var f=l(C);function C(y){var b;Object(P.a)(this,C),b=f.call(this,y),b.onKeyDown=function(x){var N=b.props,I=N.onKeyDown,g=N.onPressEnter;if(x.keyCode===m.a.UP){var W=b.getRatio(x);b.up(x,W,null),b.stop()}else if(x.keyCode===m.a.DOWN){var J=b.getRatio(x);b.down(x,J,null),b.stop()}else x.keyCode===m.a.ENTER&&g&&g(x);if(b.recordCursorPosition(),b.lastKeyCode=x.keyCode,I){for(var ie=arguments.length,ue=new Array(ie>1?ie-1:0),Re=1;Re<ie;Re++)ue[Re-1]=arguments[Re];I.apply(void 0,[x].concat(ue))}},b.onKeyUp=function(x){var N=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),N){for(var I=arguments.length,g=new Array(I>1?I-1:0),W=1;W<I;W++)g[W-1]=arguments[W];N.apply(void 0,[x].concat(g))}},b.onChange=function(x){var N=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(x)),b.setState({inputValue:b.rawInput}),N(b.toNumber(b.rawInput))},b.onMouseUp=function(){var x=b.props.onMouseUp;b.recordCursorPosition(),x&&x.apply(void 0,arguments)},b.onFocus=function(){var x;b.setState({focused:!0}),(x=b.props).onFocus.apply(x,arguments)},b.onBlur=function(){var x=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var N=b.getCurrentValidValue(b.state.inputValue),I=b.setValue(N,o);if(x){var g=b.input.value,W=b.getInputDisplayValue({focus:!1,value:I});b.input.value=W&&Number(W),x.apply(void 0,arguments),b.input.value=g}},b.getRatio=function(x){var N=1;return x.metaKey||x.ctrlKey?N=.1:x.shiftKey&&(N=10),N},b.getFullNum=function(x){return isNaN(x)?x:/e/i.test(String(x))?Number(x).toFixed(18).replace(/\.?0+$/,""):x},b.getPrecision=function(x){if(T(b.props.precision))return b.props.precision;var N=String(x);if(N.indexOf("e-")>=0)return parseInt(N.slice(N.indexOf("e-")+2),10);var I=0;return N.indexOf(".")>=0&&(I=N.length-N.indexOf(".")-1),I},b.getInputDisplayValue=function(x){var N=x||b.state,I=N.focused,g=N.inputValue,W=N.value,J;I?J=g:J=b.toPrecisionAsStep(W),J==null&&(J="");var ie=b.formatWrapper(J);return T(b.props.decimalSeparator)&&(ie=ie.toString().replace(".",b.props.decimalSeparator)),ie},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(x){}},b.restoreByAfter=function(x){if(x===void 0)return!1;var N=b.input.value,I=N.lastIndexOf(x);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===x[0]?(b.fixCaret(g,g),!0):I+x.length===N.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(x){return x===void 0?!1:Array.prototype.some.call(x,function(N,I){var g=x.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(x){return isNaN(x)||x===""||x===null||x&&x.toString().indexOf(".")===x.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(x,N,I){b.pressingUpOrDown=!0,b.step("down",x,N,I)},b.up=function(x,N,I){b.pressingUpOrDown=!0,b.step("up",x,N,I)},b.saveInput=function(x){b.input=x};var B=y.value;B===void 0&&(B=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(B));return b.state=u(u({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(Y.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var B=this.props,F=B.value,x=B.onChange,N=B.max,I=B.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,N)||!D(b.min,I)){var W=g?F:this.getValidValue(F),J;this.pressingUpOrDown?J=W:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:J})}var ie="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==N&&typeof ie=="number"&&ie>N&&x&&x(N),"min"in this.props&&b.min!==I&&typeof ie=="number"&&ie<I&&x&&x(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var B=b;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(b){var B=b.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,x=parseFloat(b);return isNaN(x)?b:(x<B&&(x=B),x>F&&(x=F),x)}},{key:"setValue",value:function(b,B){var F=this.props.precision,x=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),N=this.state.value,I=N===void 0?null:N,g=this.state.inputValue,W=g===void 0?null:g,J=typeof x=="number"?x.toFixed(F):"".concat(x),ie=x!==I||J!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},B)):this.setState({value:x,inputValue:this.toPrecisionAsStep(b)},B),ie&&this.props.onChange(x),x}},{key:"getMaxPrecision",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,x=F.precision,N=F.step;if(T(x))return x;var I=this.getPrecision(B),g=this.getPrecision(N),W=this.getPrecision(b);return b?Math.max(W,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,B);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var B=Math.abs(this.getMaxPrecision(b));return isNaN(B)?b.toString():Number(b).toFixed(B)}},{key:"toNumber",value:function(b){var B=this.props.precision,F=this.state.focused,x=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||x?b:T(B)?Math.round(b*Math.pow(10,B))/Math.pow(10,B):Number(b)}},{key:"upStep",value:function(b,B){var F=this.props.step,x=this.getPrecisionFactor(b,B),N=Math.abs(this.getMaxPrecision(b,B)),I=((x*b+x*F*B)/x).toFixed(N);return this.toNumber(I)}},{key:"downStep",value:function(b,B){var F=this.props.step,x=this.getPrecisionFactor(b,B),N=Math.abs(this.getMaxPrecision(b,B)),I=((x*b-x*F*B)/x).toFixed(N);return this.toNumber(I)}},{key:"step",value:function(b,B){var F=this,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var W=this["".concat(b,"Step")](g,x),J=W>I.max||W<I.min;if(W>I.max?W=I.max:W<I.min&&(W=I.min),this.setValue(W,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){F[b](B,x,!0)},N?a:A)}},{key:"fixCaret",value:function(b,B){if(b===void 0||B===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,x=this.input.selectionEnd;(b!==F||B!==x)&&this.input.setSelectionRange(b,B)}catch(N){}}},{key:"render",value:function(){var b,B=this.props,F=B.prefixCls,x=B.disabled,N=B.readOnly,I=B.useTouch,g=B.autoComplete,W=B.upHandler,J=B.downHandler,ie=B.className,ue=B.max,Re=B.min,ve=B.style,Se=B.title,Le=B.onMouseEnter,be=B.onMouseLeave,ce=B.onMouseOver,he=B.onMouseOut,ne=B.required,de=B.onClick,se=B.tabIndex,De=B.type,Ne=B.placeholder,Ae=B.id,Pe=B.inputMode,Be=B.pattern,oe=B.step,ge=B.maxLength,Oe=B.autoFocus,Ie=B.name,He=B.onPaste,Xe=B.onInput,qe=Object(re.a)(B,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ze=this.state,nt=Ze.value,$e=Ze.focused,Qe=v()(F,(b={},Object($.a)(b,ie,!!ie),Object($.a)(b,"".concat(F,"-disabled"),x),Object($.a)(b,"".concat(F,"-focused"),$e),b)),Fe={};Object.keys(qe).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Fe[me]=qe[me])});var ut=!N&&!x,lt=this.getInputDisplayValue(null),je=(nt||nt===0)&&(isNaN(nt)||Number(nt)>=ue),We=(nt||nt===0)&&(isNaN(nt)||Number(nt)<=Re),Ce=je||x||N,_e=We||x||N,Te=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object($.a)({},"".concat(F,"-handler-up-disabled"),Ce)),ae=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object($.a)({},"".concat(F,"-handler-down-disabled"),_e)),le=I?{onTouchStart:Ce?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},fe=I?{onTouchStart:_e?o:this.down,onTouchEnd:this.stop}:{onMouseDown:_e?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Qe,style:ve,title:Se,onMouseEnter:Le,onMouseLeave:be,onMouseOver:ce,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(F,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Te}),W||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:h})),n.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Decrease Value","aria-disabled":_e,className:ae}),J||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:h}))),n.a.createElement("div",{className:"".concat(F,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":ue,"aria-valuenow":nt,required:ne,type:De,placeholder:Ne,onPaste:He,onClick:de,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:se,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:o,onKeyUp:ut?this.onKeyUp:o,autoFocus:Oe,maxLength:ge,readOnly:N,disabled:x,max:ue,min:Re,step:oe,name:Ie,title:Se,id:Ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:Be,inputMode:Pe,onInput:Xe},Fe))))}}]),C}(n.a.Component);L.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var w=L,O=xe.a=w},fjLI:function(ot,xe,Z){"use strict";Z.d(xe,"f",function(){return p}),Z.d(xe,"b",function(){return u}),Z.d(xe,"a",function(){return l}),Z.d(xe,"d",function(){return d}),Z.d(xe,"e",function(){return o}),Z.d(xe,"c",function(){return h});var re=Z("8HAY"),$=Z("Vhoy"),P=Z("MI8n"),Y=Z("JYp7"),j=Z("pmY6"),U=Z("24hK"),z=Z("nnTU"),G=Z("T8No"),n=Z("Cg/j"),R=Z("t9D7"),v=function(s,a,A,E){var T=arguments.length,D=T<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,A):E,L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,A,E);else for(var w=s.length-1;w>=0;w--)(L=s[w])&&(D=(T<3?L(D):T>3?L(a,A,D):L(a,A))||D);return T>3&&D&&Object.defineProperty(a,A,D),D},m=function(s,a){return function(A,E){a(A,E,s)}};function p(s){return s.command!==void 0}class u{constructor(s){this.id=u._idPool++,this._debugName=s}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const l=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===u.CommandPalette}}addCommand(s){return this.addCommands(Y.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let a=!1;for(const A of s)a=this._commands.delete(A.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,A)=>s.set(A,a)),s}appendMenuItem(s,a){return this.appendMenuItems(Y.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,A=new U.a;for(const{id:E,item:T}of s){let D=this._menuItems.get(E);D||(D=new U.a,this._menuItems.set(E,D)),A.push(D.push(T)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(j.i)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(a),A.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===u.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const A of s)p(A)&&(a.add(A.command.id),A.alt&&a.add(A.alt.id));this._commands.forEach((A,E)=>{a.has(E)||s.push({command:A})})}};class o extends re.e{constructor(s,a,A,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=A,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=a.getActions(this._options);a.dispose();for(const[,E]of A)E.length>0&&(s.push(...E),s.push(new re.d));return s.length&&s.pop(),s}}let h=class s{constructor(a,A,E,T,D){var L,w;if(this._commandService=D,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(w=typeof a.tooltip=="string"?a.tooltip:(L=a.tooltip)===null||L===void 0?void 0:L.value)!==null&&w!==void 0?w:"",this.enabled=!a.precondition||T.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const O=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=T.contextMatchesRules(O.condition),this.checked&&O.tooltip&&(this.tooltip=typeof O.tooltip=="string"?O.tooltip:O.tooltip.value),O.title&&(this.label=typeof O.title=="string"?O.title:O.title.value)}this.item=a,this.alt=A?new s(A,void 0,E,T,D):void 0,this._options=E,R.d.isThemeIcon(a.icon)&&(this.class=$.a.asClassName(a.icon))}dispose(){}run(...a){var A,E;let T=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(T=[...T,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(T=[...T,...a]),this._commandService.executeCommand(this.id,...T)}};h=v([m(3,G.b),m(4,z.b)],h)},h78n:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return b});var re=Z("q1tI"),$=Z.n(re),P=Z("TSYQ"),Y=Z.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},U=function(x){var N=x.map(function(){return Object(re.useRef)()}),I=Object(re.useRef)();return Object(re.useEffect)(function(){var g=Date.now(),W=!1;Object.keys(N).forEach(function(J){var ie=N[J].current;if(!ie)return;W=!0;var ue=ie.style;ue.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(ue.transitionDuration="0s, 0s")}),W&&(I.current=Date.now())}),[N]};function z(){return z=Object.assign||function(F){for(var x=1;x<arguments.length;x++){var N=arguments[x];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(F[I]=N[I])}return F},z.apply(this,arguments)}function G(F,x){return p(F)||m(F,x)||R(F,x)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(F,x){if(!F)return;if(typeof F=="string")return v(F,x);var N=Object.prototype.toString.call(F).slice(8,-1);if(N==="Object"&&F.constructor&&(N=F.constructor.name),N==="Map"||N==="Set")return Array.from(F);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return v(F,x)}function v(F,x){(x==null||x>F.length)&&(x=F.length);for(var N=0,I=new Array(x);N<x;N++)I[N]=F[N];return I}function m(F,x){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var N=[],I=!0,g=!1,W=void 0;try{for(var J=F[Symbol.iterator](),ie;!(I=(ie=J.next()).done)&&!(N.push(ie.value),x&&N.length===x);I=!0);}catch(ue){g=!0,W=ue}finally{try{!I&&J.return!=null&&J.return()}finally{if(g)throw W}}return N}function p(F){if(Array.isArray(F))return F}function u(F,x){if(F==null)return{};var N=l(F,x),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(g=0;g<W.length;g++){if(I=W[g],x.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function l(F,x){if(F==null)return{};var N={},I=Object.keys(F),g,W;for(W=0;W<I.length;W++){if(g=I[W],x.indexOf(g)>=0)continue;N[g]=F[g]}return N}var d=function(x){var N=x.className,I=x.percent,g=x.prefixCls,W=x.strokeColor,J=x.strokeLinecap,ie=x.strokeWidth,ue=x.style,Re=x.trailColor,ve=x.trailWidth,Se=x.transition,Le=u(x,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Le.gapPosition;var be=Array.isArray(I)?I:[I],ce=Array.isArray(W)?W:[W],he=U(be),ne=G(he,1),de=ne[0],se=ie/2,De=100-ie/2,Ne="M ".concat(J==="round"?se:0,",").concat(se,`
|
|
L `).concat(J==="round"?De:100,",").concat(se),Ae="0 0 100 ".concat(ie),Pe=0;return $.a.createElement("svg",z({className:Y()("".concat(g,"-line"),N),viewBox:Ae,preserveAspectRatio:"none",style:ue},Le),$.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Ne,strokeLinecap:J,stroke:Re,strokeWidth:ve||ie,fillOpacity:"0"}),be.map(function(Be,oe){var ge={strokeDasharray:"".concat(Be,"px, 100px"),strokeDashoffset:"-".concat(Pe,"px"),transition:Se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Oe=ce[oe]||ce[ce.length-1];return Pe+=Be,$.a.createElement("path",{key:oe,className:"".concat(g,"-line-path"),d:Ne,strokeLinecap:J,stroke:Oe,strokeWidth:ie,fillOpacity:"0",ref:de[oe],style:ge})}))};d.defaultProps=j;var o=d;function h(){return h=Object.assign||function(F){for(var x=1;x<arguments.length;x++){var N=arguments[x];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(F[I]=N[I])}return F},h.apply(this,arguments)}function s(F,x){return D(F)||T(F,x)||A(F,x)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(F,x){if(!F)return;if(typeof F=="string")return E(F,x);var N=Object.prototype.toString.call(F).slice(8,-1);if(N==="Object"&&F.constructor&&(N=F.constructor.name),N==="Map"||N==="Set")return Array.from(F);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return E(F,x)}function E(F,x){(x==null||x>F.length)&&(x=F.length);for(var N=0,I=new Array(x);N<x;N++)I[N]=F[N];return I}function T(F,x){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var N=[],I=!0,g=!1,W=void 0;try{for(var J=F[Symbol.iterator](),ie;!(I=(ie=J.next()).done)&&!(N.push(ie.value),x&&N.length===x);I=!0);}catch(ue){g=!0,W=ue}finally{try{!I&&J.return!=null&&J.return()}finally{if(g)throw W}}return N}function D(F){if(Array.isArray(F))return F}function L(F,x){if(F==null)return{};var N=w(F,x),I,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(F);for(g=0;g<W.length;g++){if(I=W[g],x.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function w(F,x){if(F==null)return{};var N={},I=Object.keys(F),g,W;for(W=0;W<I.length;W++){if(g=I[W],x.indexOf(g)>=0)continue;N[g]=F[g]}return N}var O=0;function S(F){return+F.replace("%","")}function f(F){return Array.isArray(F)?F:[F]}function C(F,x,N,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,J=50-I/2,ie=0,ue=-J,Re=0,ve=-2*J;switch(W){case"left":ie=-J,ue=0,Re=2*J,ve=0;break;case"right":ie=J,ue=0,Re=-2*J,ve=0;break;case"bottom":ue=J,ve=2*J;break;default:}var Se="M 50,50 m ".concat(ie,",").concat(ue,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(Re,",").concat(-ve,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(-Re,",").concat(ve),Le=Math.PI*2*J,be={stroke:N,strokeDasharray:"".concat(x/100*(Le-g),"px ").concat(Le,"px"),strokeDashoffset:"-".concat(g/2+F/100*(Le-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Se,pathStyle:be}}var y=function(x){var N=x.prefixCls,I=x.strokeWidth,g=x.trailWidth,W=x.gapDegree,J=x.gapPosition,ie=x.trailColor,ue=x.strokeLinecap,Re=x.style,ve=x.className,Se=x.strokeColor,Le=x.percent,be=L(x,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ce=Object(re.useMemo)(function(){return O+=1,O},[]),he=C(0,100,ie,I,W,J),ne=he.pathString,de=he.pathStyle,se=f(Le),De=f(Se),Ne=De.find(function(ge){return Object.prototype.toString.call(ge)==="[object Object]"}),Ae=U(se),Pe=s(Ae,1),Be=Pe[0],oe=function(){var Oe=0;return se.map(function(Ie,He){var Xe=De[He]||De[De.length-1],qe=Object.prototype.toString.call(Xe)==="[object Object]"?"url(#".concat(N,"-gradient-").concat(ce,")"):"",Ze=C(Oe,Ie,Xe,I,W,J);return Oe+=Ie,$.a.createElement("path",{key:He,className:"".concat(N,"-circle-path"),d:Ze.pathString,stroke:qe,strokeLinecap:ue,strokeWidth:I,opacity:Ie===0?0:1,fillOpacity:"0",style:Ze.pathStyle,ref:Be[He]})})};return $.a.createElement("svg",h({className:Y()("".concat(N,"-circle"),ve),viewBox:"0 0 100 100",style:Re},be),Ne&&$.a.createElement("defs",null,$.a.createElement("linearGradient",{id:"".concat(N,"-gradient-").concat(ce),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(ge,Oe){return S(ge)-S(Oe)}).map(function(ge,Oe){return $.a.createElement("stop",{key:Oe,offset:ge,stopColor:Ne[ge]})}))),$.a.createElement("path",{className:"".concat(N,"-circle-trail"),d:ne,stroke:ie,strokeLinecap:ue,strokeWidth:g||I,fillOpacity:"0",style:de}),oe().reverse())};y.defaultProps=j;var b=y,B={Line:o,Circle:b}},ic2d:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return Y});var re=Z("FWmy"),$=Z("746U");class P{constructor(){this.data=new Map}add(j,U){re.a($.l(j)),re.a($.k(U)),re.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,U)}as(j){return this.data.get(j)||null}}const Y=new P},kSUc:function(ot,xe,Z){},lZu9:function(ot,xe,Z){(function(re){re(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function($,P){var Y=re.getMode($,"text/html"),j=Y.name=="null";function U(I){if(re.findModeByName){var g=re.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var W=re.getMode($,I);return W.name=="null"?null:W}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var z={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var G in z)z.hasOwnProperty(G)&&P.tokenTypeOverrides[G]&&(z[G]=P.tokenTypeOverrides[G]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,h=" ";function s(I,g,W){return g.f=g.inline=W,W(I,g)}function a(I,g,W){return g.f=g.block=W,W(I,g)}function A(I){return!I||!/\S/.test(I.string)}function E(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var W=re.innerMode(Y,I.htmlState);g=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}g&&(I.f=S,I.block=T,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function T(I,g){var W=I.column()===g.indentation,J=A(g.prevLine.stream),ie=g.indentedCode,ue=g.prevLine.hr,Re=g.list!==!1,ve=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Se=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Re)){for(g.list=null;Se<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Se-g.listStack[g.listStack.length-1])}var Le=!J&&!ue&&!g.prevLine.header&&(!Re||!ie)&&!g.prevLine.fencedCodeEnd,be=(g.list===!1||ue||J)&&g.indentation<=ve&&I.match(n),ce=null;if(g.indentationDiff>=4&&(ie||g.prevLine.fencedCodeEnd||g.prevLine.header||J))return I.skipToEnd(),g.indentedCode=!0,z.code;if(I.eatSpace())return null;if(W&&g.indentation<=ve&&(ce=I.match(m))&&ce[1].length<=6)return g.quote=0,g.header=ce[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,w(g);if(g.indentation<=ve&&I.eat(">"))return g.quote=W?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),w(g);if(!be&&!g.setext&&W&&g.indentation<=ve&&(ce=I.match(R))){var he=ce[1]?"ol":"ul";return g.indentation=Se+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+he]),w(g)}else{if(W&&g.indentation<=ve&&(ce=I.match(l,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ce[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&U(ce[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=re.startState(g.localMode)),g.f=g.block=L,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,w(g);if(g.setext||(!Le||!Re)&&!g.quote&&g.list===!1&&!g.code&&!be&&!d.test(I.string)&&(ce=I.lookAhead(1))&&(ce=ce.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=ce[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,w(g);if(be)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,z.hr;if(I.peek()==="[")return s(I,g,B)}return s(I,g,g.inline)}function D(I,g){var W=Y.token(I,g.htmlState);if(!j){var J=re.innerMode(Y,g.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=S,g.block=T,g.htmlState=null)}return W}function L(I,g){var W=g.listStack[g.listStack.length-1]||0,J=g.indentation<W,ie=W+3;if(g.fencedEndRE&&g.indentation<=ie&&(J||I.match(g.fencedEndRE))){P.highlightFormatting&&(g.formatting="code-block");var ue;return J||(ue=w(g)),g.localMode=g.localState=null,g.block=T,g.f=S,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,J?a(I,g,g.block):ue}else return g.localMode?g.localMode.token(I,g.localState):(I.skipToEnd(),z.code)}function w(I){var g=[];if(I.formatting){g.push(z.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var W=0;W<I.formatting.length;W++)g.push(z.formatting+"-"+I.formatting[W]),I.formatting[W]==="header"&&g.push(z.formatting+"-"+I.formatting[W]+"-"+I.header),I.formatting[W]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(z.formatting+"-"+I.formatting[W]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(z.linkHref,"url"):(I.strong&&g.push(z.strong),I.em&&g.push(z.em),I.strikethrough&&g.push(z.strikethrough),I.emoji&&g.push(z.emoji),I.linkText&&g.push(z.linkText),I.code&&g.push(z.code),I.image&&g.push(z.image),I.imageAltText&&g.push(z.imageAltText,"link"),I.imageMarker&&g.push(z.imageMarker)),I.header&&g.push(z.header,z.header+"-"+I.header),I.quote&&(g.push(z.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(z.quote+"-"+I.quote):g.push(z.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var J=(I.listStack.length-1)%3;J?J===1?g.push(z.list2):g.push(z.list3):g.push(z.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function O(I,g){return I.match(u,!0)?w(g):void 0}function S(I,g){var W=g.text(I,g);if(typeof W!="undefined")return W;if(g.list)return g.list=null,w(g);if(g.taskList){var J=I.match(v,!0)[1]===" ";return J?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,w(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),w(g);var ie=I.next();if(g.linkTitle){g.linkTitle=!1;var ue=ie;ie==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(I.match(new RegExp(Re),!0))return z.linkHref}if(ie==="`"){var ve=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Se=I.current().length;if(g.code==0&&(!g.quote||Se==1))return g.code=Se,w(g);if(Se==g.code){var Le=w(g);return g.code=0,Le}else return g.formatting=ve,w(g)}else if(g.code)return w(g);if(ie==="\\"&&(I.next(),P.highlightFormatting)){var be=w(g),ce=z.formatting+"-escape";return be?be+" "+ce:ce}if(ie==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),w(g);if(ie==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),w(g);if(ie==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var be=w(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=C,be}if(ie==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),w(g);if(ie==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var be=w(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?C:S,be}if(ie==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,P.highlightFormatting&&(g.formatting="link");var be=w(g);return be?be+=" ":be="",be+z.linkInline}if(ie==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,P.highlightFormatting&&(g.formatting="link");var be=w(g);return be?be+=" ":be="",be+z.linkEmail}if(P.xml&&ie==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=I.string.indexOf(">",I.pos);if(he!=-1){var ne=I.string.substring(I.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=re.startState(Y),a(I,g,D)}if(P.xml&&ie==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var de=1,se=I.pos==1?" ":I.string.charAt(I.pos-2);de<3&&I.eat(ie);)de++;var De=I.peek()||" ",Ne=!/\s/.test(De)&&(!o.test(De)||/\s/.test(se)||o.test(se)),Ae=!/\s/.test(se)&&(!o.test(se)||/\s/.test(De)||o.test(De)),Pe=null,Be=null;if(de%2&&(!g.em&&Ne&&(ie==="*"||!Ae||o.test(se))?Pe=!0:g.em==ie&&Ae&&(ie==="*"||!Ne||o.test(De))&&(Pe=!1)),de>1&&(!g.strong&&Ne&&(ie==="*"||!Ae||o.test(se))?Be=!0:g.strong==ie&&Ae&&(ie==="*"||!Ne||o.test(De))&&(Be=!1)),Be!=null||Pe!=null){P.highlightFormatting&&(g.formatting=Pe==null?"strong":Be==null?"em":"strong em"),Pe===!0&&(g.em=ie),Be===!0&&(g.strong=ie);var Le=w(g);return Pe===!1&&(g.em=!1),Be===!1&&(g.strong=!1),Le}}else if(ie===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return w(g);I.backUp(1)}if(P.strikethrough){if(ie==="~"&&I.eatWhile(ie)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var Le=w(g);return g.strikethrough=!1,Le}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),w(g)}else if(ie===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return w(g);I.backUp(2)}}if(P.emoji&&ie===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var oe=w(g);return g.emoji=!1,oe}return ie===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),w(g)}function f(I,g){var W=I.next();if(W===">"){g.f=g.inline=S,P.highlightFormatting&&(g.formatting="link");var J=w(g);return J?J+=" ":J="",J+z.linkInline}return I.match(/^[^>]+/,!0),z.linkInline}function C(I,g){if(I.eatSpace())return null;var W=I.next();return W==="("||W==="["?(g.f=g.inline=b(W==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,w(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,W){var J=g.next();if(J===I){W.f=W.inline=S,P.highlightFormatting&&(W.formatting="link-string");var ie=w(W);return W.linkHref=!1,ie}return g.match(y[I]),W.linkHref=!0,w(W)}}function B(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,w(g)):s(I,g,S)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=x,P.highlightFormatting&&(g.formatting="link");var W=w(g);return g.linkText=!1,W}return I.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function x(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=S,z.linkHref+" url")}var N={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:S,text:O,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&re.copyState(Y,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?re.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return E(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var W=I.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(g.indentation=W,g.indentationDiff=null,W>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:Y}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:N}},indent:function(I,g,W){return I.block==D&&Y.indent?Y.indent(I.htmlState,g,W):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,W):re.Pass},blankLine:E,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return N},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},nEHx:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return re});var re;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(re||(re={}))},nnTU:function(ot,xe,Z){"use strict";Z.d(xe,"b",function(){return z}),Z.d(xe,"a",function(){return G});var re=Z("MI8n"),$=Z("JYp7"),P=Z("pmY6"),Y=Z("24hK"),j=Z("746U"),U=Z("Cg/j");const z=Object(U.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new re.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,R){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!R)throw new Error("invalid command");return this.registerCommand({id:n,handler:R})}if(n.description){const l=[];for(let o of n.description.args)l.push(o.constraint);const d=n.handler;n.handler=function(o,...h){return Object(j.o)(h,l),d(o,...h)}}const{id:v}=n;let m=this._commands.get(v);m||(m=new Y.a,this._commands.set(v,m));let p=m.unshift(n),u=Object(P.i)(()=>{p();const l=this._commands.get(v);(l==null?void 0:l.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),u}registerCommandAlias(n,R){return G.registerCommand(n,(v,...m)=>v.get(z).executeCommand(R,...m))}getCommand(n){const R=this._commands.get(n);return!R||R.isEmpty()?void 0:$.a.first(R)}getCommands(){const n=new Map;for(const R of this._commands.keys()){const v=this.getCommand(R);v&&n.set(R,v)}return n}};G.registerCommand("noop",()=>{})},osHv:function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $=re.Pos;function P(o,h){return o.line-h.line||o.ch-h.ch}var Y="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",j=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+Y+"]["+j+"]*)","g");function z(o,h,s,a){this.line=h,this.ch=s,this.cm=o,this.text=o.getLine(h),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function G(o,h){var s=o.cm.getTokenTypeAt($(o.line,h));return s&&/\btag\b/.test(s)}function n(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function R(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var h=o.text.indexOf(">",o.ch);if(h==-1){if(n(o))continue;return}if(!G(o,h+1)){o.ch=h+1;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function m(o){for(;;){var h=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(h==-1){if(R(o))continue;return}if(!G(o,h+1)){o.ch=h;continue}U.lastIndex=h,o.ch=h;var s=U.exec(o.text);if(s&&s.index==h)return s}}function p(o){for(;;){U.lastIndex=o.ch;var h=U.exec(o.text);if(!h){if(n(o))continue;return}if(!G(o,h.index+1)){o.ch=h.index+1;continue}return o.ch=h.index+h[0].length,h}}function u(o){for(;;){var h=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(h==-1){if(R(o))continue;return}if(!G(o,h+1)){o.ch=h;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function l(o,h){for(var s=[];;){var a=p(o),A,E=o.line,T=o.ch-(a?a[0].length:0);if(!a||!(A=v(o)))return;if(A=="selfClose")continue;if(a[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==a[2]){s.length=D;break}if(D<0&&(!h||h==a[2]))return{tag:a[2],from:$(E,T),to:$(o.line,o.ch)}}else s.push(a[2])}}function d(o,h){for(var s=[];;){var a=u(o);if(!a)return;if(a=="selfClose"){m(o);continue}var A=o.line,E=o.ch,T=m(o);if(!T)return;if(T[1])s.push(T[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==T[2]){s.length=D;break}if(D<0&&(!h||h==T[2]))return{tag:T[2],from:$(o.line,o.ch),to:$(A,E)}}}}re.registerHelper("fold","xml",function(o,h){for(var s=new z(o,h.line,0);;){var a=p(s);if(!a||s.line!=h.line)return;var A=v(s);if(!A)return;if(!a[1]&&A!="selfClose"){var E=$(s.line,s.ch),T=l(s,a[2]);return T&&P(T.from,E)>0?{from:E,to:T.from}:null}}}),re.findMatchingTag=function(o,h,s){var a=new z(o,h.line,h.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var A=v(a),E=A&&$(a.line,a.ch),T=A&&m(a);if(!A||!T||P(a,h)>0)return;var D={from:$(a.line,a.ch),to:E,tag:T[2]};return A=="selfClose"?{open:D,close:null,at:"open"}:T[1]?{open:d(a,T[2]),close:D,at:"close"}:(a=new z(o,E.line,E.ch,s),{open:D,close:l(a,T[2]),at:"open"})},re.findEnclosingTag=function(o,h,s,a){for(var A=new z(o,h.line,h.ch,s);;){var E=d(A,a);if(!E)break;var T=new z(o,h.line,h.ch,s),D=l(T,E.tag);if(D)return{open:E,close:D}}},re.scanForClosingTag=function(o,h,s,a){var A=new z(o,h.line,h.ch,a?{from:0,to:a}:null);return l(A,s)}})},p0QG:function(ot,xe,Z){ot.exports={flex_box_center:"flex_box_center___2axlI",flex_space_between:"flex_space_between___F6m1U",flex_box_vertical_center:"flex_box_vertical_center___2GovZ",flex_box_center_end:"flex_box_center_end___2h9j0",flex_box_column:"flex_box_column___1kuIs",SubMentItem:"SubMentItem___34z-Y",MenuItem:"MenuItem___1bbPM",wrp:"wrp___3LRhb",classroomInfo:"classroomInfo___Ohxoq",title:"title___22ZLP",titleLeft:"titleLeft___1MP-h",titleRight:"titleRight___3zsz9",classroomUser:"classroomUser___1ePAN",headPic:"headPic___2lEg_",teacherInfo:"teacherInfo___3C0Dn",classroomDesc:"classroomDesc____QVZX",classroomDescBg:"classroomDescBg___1e7L7",joinCouses:"joinCouses___2G4vP",bg:"bg___2QojS",leftMenus:"leftMenus___34tjX",titleSelected:"titleSelected___K6QwW",menuText:"menuText___3qMqH",totalCount:"totalCount___R2q38",actions:"actions___26Ww0",task_count:"task_count___3UQ1V",container:"container___2EGM4",leftMenuActions:"leftMenuActions___3_J-1"}},p5ED:function(ot,xe,Z){"use strict";var re=Z("+L6B"),$=Z("2/Rp"),P=Z("5Dmo"),Y=Z("3S7+"),j=Z("k1fw"),U=Z("9og8"),z=Z("tJVT"),G=Z("WmNS"),n=Z.n(G),R=Z("q1tI"),v=Z.n(R),m=Z("vHTk"),p=Z.n(m),u=Z("yEEn"),l=Z("ZW9T"),d=Z("1vsH"),o=Z("V0Rq"),h=Z("m3rI");xe.a=function(s){var a,A,E,T,D,L,w,O=s.editOffice,S=O===void 0?"view":O,f=s.data,C=s.theme,y=s.type,b=s.filename,B=s.monacoEditor,F=s.className,x=s.style,N=s.close,I=s.onClose,g=s.hasMask,W=s.disabledDownload,J=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ie=Object(z.a)(J,2),ue=ie[0],Re=ie[1],ve=Object(R.useState)(""),Se=Object(z.a)(ve,2),Le=Se[0],be=Se[1],ce=Object(R.useState)(),he=Object(z.a)(ce,2),ne=he[0],de=he[1],se=window.ENV==="build"?"/react/build":"",De=h.a.PROXY_SERVER||location.origin,Ne,Ae=1024*1024,Pe=10*Ae,Be=Object(R.useRef)();(a=f)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(f=h.a.API_SERVER+f),y==="office"&&(Ne=Object(d.T)(f).filesize,Ne>Pe&&(y="other")),b&&B&&(B.filename=b),Object(R.useEffect)(function(){var Ie,He,Xe=(Ie=document.cookie)===null||Ie===void 0||((He=Ie.replace(/\s/g,""))===null||He===void 0)?void 0:He.split(";");Xe==null||Xe.map(function(qe){var Ze=qe.split("=");Ze[0]==="_educoder_session"&&be(Ze[1])})},[]),Object(R.useEffect)(function(){y==="office"&&oe()},[y,f]);var oe=function(){var Ie=Object(U.a)(n.a.mark(function He(){var Xe,qe,Ze;return n.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return console.log("data:",f),Xe=f,f.startsWith("http")||(Xe=location.origin+Xe),qe=new URL(Xe).pathname.split("/").pop(),$e.next=6,Object(o.V)({attachment_id:qe});case 6:Ze=$e.sent,de(Ze);case 8:case"end":return $e.stop()}},He)}));return function(){return Ie.apply(this,arguments)}}(),ge=function(){if(f.startsWith("http")||f.startsWith("blob:")){Oe();return}Object(d.z)(b||"educoder",f,b)},Oe=function(){Object(d.x)(b||"educoder",decodeURIComponent(f))};return v.a.createElement("div",{style:Object(j.a)({},x||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},N&&v.a.createElement("div",{className:p.a.close,ref:Be},!W&&v.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Be.current}},v.a.createElement("span",{onClick:Oe},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Be.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(l.b,B)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((A=f)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((E=f)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((T=f)===null||T===void 0?void 0:T.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),y==="office"&&ne&&v.a.createElement("iframe",{src:"".concat(se,"/office.html?key=").concat(ne.key,"&url=").concat(De+ne.url,"&callbackUrl=").concat(De+ne.callbackUrl,"&fileType=").concat(ne.fileType,"&title=").concat(ne.title,"&model=").concat(S,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),y==="html"&&v.a.createElement("iframe",{src:f+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(se,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!W)}),y==="image"&&v.a.createElement("img",{src:"".concat(((D=f)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((L=f)===null||L===void 0?void 0:L.indexOf("https://"))>-1||(w=f)!==null&&w!==void 0&&w.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),y==="other"&&v.a.createElement("div",null,v.a.createElement($.a,{type:"primary",size:"large",onClick:ge},v.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement($.a,{type:"primary",size:"large",onClick:ge},v.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,xe,Z){},pmY6:function(ot,xe,Z){"use strict";Z.d(xe,"h",function(){return R}),Z.d(xe,"g",function(){return m}),Z.d(xe,"f",function(){return p}),Z.d(xe,"e",function(){return u}),Z.d(xe,"i",function(){return l}),Z.d(xe,"b",function(){return d}),Z.d(xe,"a",function(){return o}),Z.d(xe,"d",function(){return h}),Z.d(xe,"c",function(){return s});var re=Z("C/vA"),$=Z("JYp7");const P=!1;let Y=null;function j(a){Y=a}if(P){const a="__is_disposable_tracked__";j(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[a]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==o.None)try{A[a]=!0}catch(T){}}markAsDisposed(A){if(A&&A!==o.None)try{A[a]=!0}catch(E){}}markAsSingleton(A){}})}function U(a){return Y==null||Y.trackDisposable(a),a}function z(a){Y==null||Y.markAsDisposed(a)}function G(a,A){Y==null||Y.setParent(a,A)}function n(a,A){if(!Y)return;for(const E of a)Y.setParent(E,A)}function R(a){return Y==null||Y.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function m(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if($.a.is(a)){let A=[];for(const E of a)if(E)try{E.dispose()}catch(T){A.push(T)}if(A.length===1)throw A[0];if(A.length>1)throw new v(A);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function u(...a){const A=l(()=>p(a));return n(a,A),A}function l(a){const A=U({dispose:Object(re.a)(()=>{z(A),a()})});return A}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;z(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return G(a,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(a),a}}d.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new d,U(this),G(this._store,this)}dispose(){z(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}o.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var A;if(this._isDisposed||a===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),a&&G(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,z(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&G(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(ot,xe,Z){var re,$;(function(){var P;(function(){"use strict";var z=[,,function(v){function m(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var l=new m(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},m.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},m.prototype.has_match=function(l){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(l))return!0;return!1},m.prototype.set_indent=function(l,d){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(l){this.__items.push(l);var d=l.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=l.length-d:this.__character_count+=l.length},m.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function p(l,d){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),d=d||"",l.indent_level>0&&(d=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}p.prototype.get_indent_size=function(l,d){var o=this.__base_string_length;return d=d||0,l<0&&(o=0),o+=l*this.__indent_size,o+=d,o},p.prototype.get_indent_string=function(l,d){var o=this.__base_string;return d=d||0,l<0&&(l=0,o=""),d+=l*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},p.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var l=this.__cache.length,d=0,o="";this.__indent_size&&l>=this.__indent_size&&(d=Math.floor(l/this.__indent_size),l-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function u(l,d){this.__indent_cache=new p(l,d),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(l,d){return this.__indent_cache.get_indent_string(l,d)},u.prototype.get_indent_size=function(l,d){return this.__indent_cache.get_indent_size(l,d)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(l){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return l!==`
|
|
`&&(o=o.replace(/[\n]/g,l)),o},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(l,d){return l=l||0,d=d||0,this.next_line.set_indent(l,d),this.__lines.length>1?(this.current_line.set_indent(l,d),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(l){for(var d=0;d<l.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(l){for(var d=this.__lines.length;l<d;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(l,d){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(l)!==0&&h.item(-1)!==d){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=u},function(v){function m(p,u,l,d){this.type=p,this.text=u,this.comments_before=null,this.newlines=l||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(l,d){this.raw_options=p(l,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(l,d){var o=this.raw_options[l],h=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},m.prototype._get_boolean=function(l,d){var o=this.raw_options[l],h=o===void 0?!!d:!!o;return h},m.prototype._get_characters=function(l,d){var o=this.raw_options[l],h=d||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},m.prototype._get_number=function(l,d){var o=this.raw_options[l];d=parseInt(d,10),isNaN(d)&&(d=0);var h=parseInt(o,10);return isNaN(h)&&(h=d),h},m.prototype._get_selection=function(l,d,o){var h=this._get_selection_list(l,d,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return h[0]},m.prototype._get_selection_list=function(l,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var h=this._get_array(l,o);if(!this._is_valid_selection(h,d))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return h},m.prototype._is_valid_selection=function(l,d){return l.length&&d.length&&!l.some(function(o){return d.indexOf(o)===-1})};function p(l,d){var o={};l=u(l);var h;for(h in l)h!==d&&(o[h]=l[h]);if(d&&l[d])for(h in l[d])o[h]=l[d][h];return o}function u(l){var d={},o;for(o in l){var h=o.replace(/-/g,"_");d[h]=l[o]}return d}v.exports.Options=m,v.exports.normalizeOpts=u,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},p.prototype.peek=function(u){var l=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(l=this.__input.charAt(u)),l},p.prototype.__match=function(u,l){u.lastIndex=l;var d=u.exec(this.__input);return d&&!(m&&u.sticky)&&(d.index!==l&&(d=null)),d},p.prototype.test=function(u,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(u,l):!1},p.prototype.testChar=function(u,l){var d=this.peek(l);return u.lastIndex=0,d!==null&&u.test(d)},p.prototype.match=function(u){var l=this.__match(u,this.__position);return l?this.__position+=l[0].length:l=null,l},p.prototype.read=function(u,l,d){var o="",h;return u&&(h=this.match(u),h&&(o+=h[0])),l&&(h||!u)&&(o+=this.readUntil(l,d)),o},p.prototype.readUntil=function(u,l){var d="",o=this.__position;u.lastIndex=this.__position;var h=u.exec(this.__input);return h?(o=h.index,l&&(o+=h[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},p.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},p.prototype.get_regexp=function(u,l){var d=null,o="g";return l&&m&&(o="y"),typeof u=="string"&&u!==""?d=new RegExp(u,o):u&&(d=new RegExp(u.source,o)),d},p.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(u){var l=this.__position,d=this.readUntilAfter(u);return this.__position=l,d},p.prototype.lookBack=function(u){var l=this.__position-1;return l>=u.length&&this.__input.substring(l-u.length,l).toLowerCase()===u},v.exports.InputScanner=p},function(v,m,p){var u=p(8).InputScanner,l=p(3).Token,d=p(10).TokenStream,o=p(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,A){this._input=new u(a),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,A=new l(h.START,""),E=null,T=[],D=new d;A.type!==h.EOF;){for(a=this._get_next_token(A,E);this._is_comment(a);)D.add(a),a=this._get_next_token(A,E);D.isEmpty()||(a.comments_before=D,D=new d),a.parent=E,this._is_opening(a)?(T.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=T.pop(),a.parent=E),a.previous=A,A.next=a,this.__tokens.add(a),A=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(h.RAW,E):this._create_token(h.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,A){return!1},s.prototype._create_token=function(a,A){var E=new l(a,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=h},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var u=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(u=this.__tokens[p]),u},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var u=p(12).Pattern;function l(d,o){u.call(this,d,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new u,l.prototype.__set_whitespace_patterns=function(d,o){d+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var o=this.__split(this._newline_regexp,d);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return d},l.prototype.matching=function(d,o){var h=this._create();return h.__set_whitespace_patterns(d,o),h._update(),h},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(d,o){d.lastIndex=0;for(var h=0,s=[],a=d.exec(o);a;)s.push(o.substring(h,a.index)),h=a.index+a[0].length,a=d.exec(o);return h<o.length?s.push(o.substring(h,o.length)):s.push(""),s},v.exports.WhitespacePattern=l},function(v){function m(p,u){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(p),u._update(),u},m.prototype.until=function(p){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(p),u._update(),u},m.prototype.starting_with=function(p){var u=this._create();return u._starting_pattern=this._input.get_regexp(p,!0),u._update(),u},m.prototype.matching=function(p){var u=this._create();return u._match_pattern=this._input.get_regexp(p,!0),u._update(),u},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,u){p=typeof p=="string"?p:p.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+u,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(p);l;)u[l[1]]=l[2],l=this.__directive_pattern.exec(p);return u},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var u=p(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(o,h){u.call(this,o,h),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var s=new u(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new u,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(o){var h=this._create();return h._disabled[o]=!0,h._update(),h},d.prototype.read_options=function(o){var h=this._create();for(var s in l)h._disabled[s]=o.templating.indexOf(s)===-1;return h._update(),h},d.prototype.exclude=function(o){var h=this._create();return h._excluded[o]=!0,h._update(),h},d.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),o+=h,h=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},d.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},d.prototype._read_template=function(){var o="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},v.exports.TemplatablePattern=d},,,,function(v,m,p){var u=p(19).Beautifier,l=p(20).Options;function d(o,h,s,a){var A=new u(o,h,s,a);return A.beautify()}v.exports=d,v.exports.defaultOptions=function(){return new l}},function(v,m,p){var u=p(20).Options,l=p(2).Output,d=p(21).Tokenizer,o=p(21).TOKEN,h=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(C,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new l(C,y)};a.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},a.prototype.set_space_before_token=function(C,y){this._output.space_before_token=C,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},a.prototype.print_preserved_newlines=function(C){var y=0;C.type!==o.TEXT&&C.previous.type!==o.TEXT&&(y=C.newlines?1:0),this.preserve_newlines&&(y=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var b=0;b<y;b++)this.print_newline(b>0);return y!==0},a.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(C){this._output.add_new_line(C)},a.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var A=function(C){for(var y=null,b=C.next;b.type!==o.EOF&&C.closed!==b;){if(b.type===o.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===o.EQUALS&&b.next.next&&b.next.next.type===o.VALUE&&(y=b.next.next.text);break}b=b.next}return y},E=function(C,y){var b=null,B=null;return y.closed?(C==="script"?b="text/javascript":C==="style"&&(b="text/css"),b=A(y)||b,b.search("text/css")>-1?B="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":b.search(/test\/null/)>-1&&(B="null"),B):null};function T(C,y){return y.indexOf(C)!==-1}function D(C,y,b){this.parent=C||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function L(C){this._printer=C,this._current_frame=null}L.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},L.prototype.record_tag=function(C){var y=new D(this._current_frame,C,this._printer.indent_level);this._current_frame=y},L.prototype._try_pop_frame=function(C){var y=null;return C&&(y=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),y},L.prototype._get_frame=function(C,y){for(var b=this._current_frame;b&&!(C.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},L.prototype.try_pop=function(C,y){var b=this._get_frame([C],y);return this._try_pop_frame(b)},L.prototype.indent_to_tag=function(C){var y=this._get_frame(C);y&&(this._printer.indent_level=y.indent_level)};function w(C,y,b,B){this._source_text=C||"",y=y||{},this._js_beautify=b,this._css_beautify=B,this._tag_stack=null;var F=new u(y,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
|
|
`,C&&h.test(C)&&(y=C.match(h)[0])),C=C.replace(s,`
|
|
`);var b=C.match(/^[\t ]*/)[0],B={text:"",type:""},F=new O,x=new a(this._options,b),N=new d(C,this._options).tokenize();this._tag_stack=new L(x);for(var I=null,g=N.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(I=this._handle_tag_open(x,g,F,B),F=I):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(x,g,F,N):g.type===o.TAG_CLOSE?I=this._handle_tag_close(x,g,F):g.type===o.TEXT?I=this._handle_text(x,g,F):x.add_raw_token(g),B=I,g=N.next();var W=x._output.get_code(y);return W},w.prototype._handle_tag_close=function(C,y,b){var B={text:y.text,type:y.type};return C.alignment_size=0,b.tag_complete=!0,C.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?C.add_raw_token(y):(b.tag_start_char==="<"&&(C.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(C.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&C.set_wrap_point(),B},w.prototype._handle_inside_tag=function(C,y,b,B){var F=b.has_wrapped_attrs,x={text:y.text,type:y.type};if(C.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)C.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===o.TEXT)C.print_preserved_newlines(y)?(y.newlines=0,C.add_raw_token(y)):C.print_token(y);else{if(y.type===o.ATTRIBUTE?(C.set_space_before_token(!0),b.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&C.set_space_before_token(!1),y.type===o.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var N=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,W;do{if(W=B.peek(g),W.type===o.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&W.type!==o.EOF&&W.type!==o.TAG_CLOSE);N=!I}N&&(C.print_newline(!1),F=!0)}C.print_token(y),F=F||C.previous_token_wrapped(),b.has_wrapped_attrs=F}return x},w.prototype._handle_text=function(C,y,b){var B={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(C,y,b):b.is_unformatted||b.is_content_unformatted?C.add_raw_token(y):(C.traverse_whitespace(y),C.print_token(y)),B},w.prototype._print_custom_beatifier_text=function(C,y,b){var B=this;if(y.text!==""){var F=y.text,x,N=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:b.custom_beautifier_name==="html"&&(x=function(ve,Se){var Le=new w(ve,Se,B._js_beautify,B._css_beautify);return Le.beautify()}),this._options.indent_scripts==="keep"?N=0:this._options.indent_scripts==="separate"&&(N=-C.indent_level);var W=C.get_full_indent(N);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!J){C.add_raw_token(y);return}I=W+J[1]+`
|
|
`,F=J[4],J[5]&&(g=W+J[5]),F=F.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
|
|
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(y.whitespace_before=J[0]))}if(F)if(x){var ie=function(){this.eol=`
|
|
`};ie.prototype=this._options.raw_options;var ue=new ie;F=x(W+F,ue)}else{var Re=y.whitespace_before;Re&&(F=F.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),F=W+F.replace(/\n/g,`
|
|
`+W)}I&&(F?F=I+F+`
|
|
`+g:F=I+g),C.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,C.add_raw_token(y),C.print_newline(!0))}},w.prototype._handle_tag_open=function(C,y,b,B){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(C.add_raw_token(y),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(C.traverse_whitespace(y),this._set_tag_position(C,y,F,b,B),F.is_inline_element||C.set_wrap_point(),C.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=y.text.length+1),!F.tag_complete&&!F.is_unformatted&&(C.alignment_size=F.alignment_size),F};var O=function(C,y){if(this.parent=C||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var b;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(b=y.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};w.prototype._get_tag_open_token=function(C){var y=new O(this._tag_stack.get_parser_token(),C);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||T(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&T(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&T(y.tag_check,this._options.content_unformatted),y.is_inline_element=T(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},w.prototype._set_tag_position=function(C,y,b,B,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=E(b.tag_check,y)))),T(b.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var x=C.current_line_has_match(/{{#if/);x||C.print_newline(!1)}b.tag_name==="!--"&&F.type===o.TAG_CLOSE&&B.is_end_tag&&b.text.indexOf(`
|
|
`)===-1||(b.is_inline_element||b.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,b))}else if(b.is_end_tag){var N=!1;N=b.start_tag_token&&b.start_tag_token.multiline_content,N=N||!b.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(F.type===o.TAG_CLOSE&&b.start_tag_token===B)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(N=!1),N&&C.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,b)},w.prototype._calcluate_parent_multiline=function(C,y){y.parent&&C._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var S=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];w.prototype._do_optional_end_element=function(C){var y=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(C.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&S.indexOf(C.tag_name)!==-1){var b=C.parent.parent;(!b||f.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=w},function(v,m,p){var u=p(6).Options;function l(d){u.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}l.prototype=new u,v.exports.Options=l},function(v,m,p){var u=p(9).Tokenizer,l=p(9).TOKEN,d=p(13).Directives,o=p(14).TemplatablePattern,h=p(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},a=new d(/<\!--/,/-->/),A=function(E,T){u.call(this,E,T),this._current_tag_name="";var D=new o(this._input).read_options(this._options),L=new h(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),handlebars_open:L.until(/[\n\r\t }]/),handlebars_raw_close:L.until(/}}/),comment:L.starting_with(/<!--/).until_after(/-->/),cdata:L.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:L.starting_with(/<!\[/).until_after(/]>/),processing:L.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=L.matching(w).until_after(w)}};A.prototype=new u,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},A.prototype._is_closing=function(E,T){return E.type===s.TAG_CLOSE&&T&&((E.text===">"||E.text==="/>")&&T.text[0]==="<"||E.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,T){var D=null;this._readWhitespace();var L=this._input.peek();return L===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(L,T),D=D||this._read_attribute(L,E,T),D=D||this._read_close(L,T),D=D||this._read_raw_content(L,E,T),D=D||this._read_content_word(L),D=D||this._read_comment_or_cdata(L),D=D||this._read_processing(L),D=D||this._read_open(L,T),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},A.prototype._read_comment_or_cdata=function(E){var T=null,D=null,L=null;if(E==="<"){var w=this._input.peek(1);w==="!"&&(D=this.__patterns.comment.read(),D?(L=a.get_directives(D),L&&L.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(T=this._create_token(s.COMMENT,D),T.directives=L)}return T},A.prototype._read_processing=function(E){var T=null,D=null,L=null;if(E==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(T=this._create_token(s.COMMENT,D),T.directives=L)}return T},A.prototype._read_open=function(E,T){var D=null,L=null;return T||E==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),L=this._create_token(s.TAG_OPEN,D)),L},A.prototype._read_open_handlebars=function(E,T){var D=null,L=null;return T||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),L=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),L=this._create_token(s.TAG_OPEN,D))),L},A.prototype._read_close=function(E,T){var D=null,L=null;return T&&(T.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(D=this._input.next(),E==="/"&&(D+=this._input.next()),L=this._create_token(s.TAG_CLOSE,D)):T.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),L=this._create_token(s.TAG_CLOSE,"}}"))),L},A.prototype._read_attribute=function(E,T,D){var L=null,w="";if(D&&D.text[0]==="<")if(E==="=")L=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var O=this._input.next();E==='"'?O+=this.__patterns.double_quote.read():O+=this.__patterns.single_quote.read(),L=this._create_token(s.VALUE,O)}else w=this.__patterns.attribute.read(),w&&(T.type===s.EQUALS?L=this._create_token(s.VALUE,w):L=this._create_token(s.ATTRIBUTE,w));return L},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,T,D){var L="";if(D&&D.text[0]==="{")L=this.__patterns.handlebars_raw_close.read();else if(T.type===s.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var w=T.opened.text.substr(1).toLowerCase();if(w==="script"||w==="style"){var O=this._read_comment_or_cdata(E);if(O)return O.type=s.TEXT,O;L=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(w)&&(L=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return L?this._create_token(s.TEXT,L):null},A.prototype._read_content_word=function(E){var T="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(s.TEXT,T)},v.exports.Tokenizer=A,v.exports.TOKEN=s}],G={};function n(v){var m=G[v];if(m!==void 0)return m.exports;var p=G[v]={exports:{}};return z[v](p,p.exports,n),p.exports}var R=n(18);P=R})();var Y=P;if(!0)!(re=[Z,Z("6UM0"),Z("TXwP")],$=function(z){var G=Z("6UM0"),n=Z("TXwP");return{html_beautify:function(R,v){return Y(R,v,G.js_beautify,n.css_beautify)}}}.apply(xe,re),$!==void 0&&(ot.exports=$));else var j,U})()},"rAM+":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});var re=Z("Qw5x");function $(P,Y){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(re.a)(P))||Y&&P&&typeof P.length=="number"){j&&(P=j);var U=0,z=function(){};return{s:z,n:function(){return U>=P.length?{done:!0}:{done:!1,value:P[U++]}},e:function(m){throw m},f:z}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var G=!0,n=!1,R;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return G=m.done,m},e:function(m){n=!0,R=m},f:function(){try{!G&&j.return!=null&&j.return()}finally{if(n)throw R}}}}},rUJ1:function(ot,xe){const Z=/[&<>"']/,re=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},j=L=>Y[L];function U(L,w){if(w){if(Z.test(L))return L.replace(re,j)}else if($.test(L))return L.replace(P,j);return L}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(L){return L.replace(z,(w,O)=>(O=O.toLowerCase(),O==="colon"?":":O.charAt(0)==="#"?O.charAt(1)==="x"?String.fromCharCode(parseInt(O.substring(2),16)):String.fromCharCode(+O.substring(1)):""))}const n=/(^|[^\[])\^/g;function R(L,w){L=L.source||L,w=w||"";const O={replace:(S,f)=>(f=f.source||f,f=f.replace(n,"$1"),L=L.replace(S,f),O),getRegex:()=>new RegExp(L,w)};return O}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(L,w,O){if(L){let S;try{S=decodeURIComponent(G(O)).replace(v,"").toLowerCase()}catch(f){return null}if(S.indexOf("javascript:")===0||S.indexOf("vbscript:")===0||S.indexOf("data:")===0)return null}w&&!m.test(O)&&(O=h(w,O));try{O=encodeURI(O).replace(/%25/g,"%")}catch(S){return null}return O}const u={},l=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(L,w){u[" "+L]||(l.test(L)?u[" "+L]=L+"/":u[" "+L]=E(L,"/",!0)),L=u[" "+L];const O=L.indexOf(":")===-1;return w.substring(0,2)==="//"?O?w:L.replace(d,"$1")+w:w.charAt(0)==="/"?O?w:L.replace(o,"$1")+w:L+w}const s={exec:function(){}};function a(L){let w=1,O,S;for(;w<arguments.length;w++){O=arguments[w];for(S in O)Object.prototype.hasOwnProperty.call(O,S)&&(L[S]=O[S])}return L}function A(L,w){const O=L.replace(/\|/g,(C,y,b)=>{let B=!1,F=y;for(;--F>=0&&b[F]==="\\";)B=!B;return B?"|":" |"}),S=O.split(/ \|/);let f=0;if(S.length>w)S.splice(w);else for(;S.length<w;)S.push("");for(;f<S.length;f++)S[f]=S[f].trim().replace(/\\\|/g,"|");return S}function E(L,w,O){const S=L.length;if(S===0)return"";let f=0;for(;f<S;){const C=L.charAt(S-f-1);if(C===w&&!O)f++;else if(C!==w&&O)f++;else break}return L.substr(0,S-f)}function T(L,w){if(L.indexOf(w[1])===-1)return-1;const O=L.length;let S=0,f=0;for(;f<O;f++)if(L[f]==="\\")f++;else if(L[f]===w[0])S++;else if(L[f]===w[1]&&(S--,S<0))return f;return-1}function D(L){L&&L.sanitize&&!L.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ot.exports={escape:U,unescape:G,edit:R,cleanUrl:p,resolveUrl:h,noopTest:s,merge:a,splitCells:A,rtrim:E,findClosingBracket:T,checkSanitizeDeprecation:D}},t9D7:function(ot,xe,Z){"use strict";Z.d(xe,"b",function(){return z}),Z.d(xe,"g",function(){return n}),Z.d(xe,"d",function(){return R}),Z.d(xe,"e",function(){return v}),Z.d(xe,"a",function(){return m}),Z.d(xe,"f",function(){return l}),Z.d(xe,"c",function(){return d});var re=Z("Vhoy"),$=Z("MI8n"),P=Z("pmY6"),Y=Z("Cg/j"),j=Z("ic2d"),U=Z("nEHx");const z=Object(Y.c)("themeService");var G;(function(o){function h(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=h})(G||(G={}));function n(o){return{id:o}}var R;(function(o){function h(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||G.isThemeColor(D.color))}o.isThemeIcon=h;const s=new RegExp(`^\\$\\((${re.a.iconNameExpression}(?:${re.a.iconModifierExpression})?)\\)$`);function a(D){const L=s.exec(D);if(!L)return;let[,w]=L;return{id:w}}o.fromString=a;function A(D,L){let w=D.id;const O=w.lastIndexOf("~");return O!==-1&&(w=w.substring(0,O)),L&&(w=`${w}~${L}`),{id:w}}o.modify=A;function E(D,L){var w,O;return D.id===L.id&&((w=D.color)===null||w===void 0?void 0:w.id)===((O=L.color)===null||O===void 0?void 0:O.id)}o.isEqual=E;function T(D,L){return{id:D.id,color:L?n(L):void 0}}o.asThemeIcon=T,o.asClassNameArray=re.a.asClassNameArray,o.asClassName=re.a.asClassName,o.asCSSSelector=re.a.asCSSSelector})(R||(R={}));function v(o){switch(o){case U.a.DARK:return"vs-dark";case U.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(P.i)(()=>{const h=this.themingParticipants.indexOf(o);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new p;j.a.add(m.ThemingContribution,u);function l(o){return u.onColorThemeChange(o)}class d extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(ot,xe,Z){typeof window!="undefined"&&function($,P){ot.exports=P()}(this,function(){return function(re){var $={};function P(Y){if($[Y])return $[Y].exports;var j=$[Y]={i:Y,l:!1,exports:{}};return re[Y].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=re,P.c=$,P.d=function(Y,j,U){P.o(Y,j)||Object.defineProperty(Y,j,{enumerable:!0,get:U})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,j){if(j&1&&(Y=P(Y)),j&8)return Y;if(j&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var U=Object.create(null);if(P.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:Y}),j&2&&typeof Y!="string")for(var z in Y)P.d(U,z,function(G){return Y[G]}.bind(null,z));return U},P.n=function(Y){var j=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(j,"a",j),j},P.o=function(Y,j){return Object.prototype.hasOwnProperty.call(Y,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(re,$,P){"use strict";var Y=Object.prototype.hasOwnProperty,j="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(j=!1));function z(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function G(v,m,p,u,l){if(typeof p!="function")throw new TypeError("The listener must be a function");var d=new z(p,u||v,l),o=j?j+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],d]:v._events[o].push(d):(v._events[o]=d,v._eventsCount++),v}function n(v,m){--v._eventsCount===0?v._events=new U:delete v._events[m]}function R(){this._events=new U,this._eventsCount=0}R.prototype.eventNames=function(){var m=[],p,u;if(this._eventsCount===0)return m;for(u in p=this._events)Y.call(p,u)&&m.push(j?u.slice(1):u);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},R.prototype.listeners=function(m){var p=j?j+m:m,u=this._events[p];if(!u)return[];if(u.fn)return[u.fn];for(var l=0,d=u.length,o=new Array(d);l<d;l++)o[l]=u[l].fn;return o},R.prototype.listenerCount=function(m){var p=j?j+m:m,u=this._events[p];return u?u.fn?1:u.length:0},R.prototype.emit=function(m,p,u,l,d,o){var h=j?j+m:m;if(!this._events[h])return!1;var s=this._events[h],a=arguments.length,A,E;if(s.fn){s.once&&this.removeListener(m,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,u),!0;case 4:return s.fn.call(s.context,p,u,l),!0;case 5:return s.fn.call(s.context,p,u,l,d),!0;case 6:return s.fn.call(s.context,p,u,l,d,o),!0}for(E=1,A=new Array(a-1);E<a;E++)A[E-1]=arguments[E];s.fn.apply(s.context,A)}else{var T=s.length,D;for(E=0;E<T;E++){s[E].once&&this.removeListener(m,s[E].fn,void 0,!0);switch(a){case 1:s[E].fn.call(s[E].context);break;case 2:s[E].fn.call(s[E].context,p);break;case 3:s[E].fn.call(s[E].context,p,u);break;case 4:s[E].fn.call(s[E].context,p,u,l);break;default:if(!A)for(D=1,A=new Array(a-1);D<a;D++)A[D-1]=arguments[D];s[E].fn.apply(s[E].context,A)}}}return!0},R.prototype.on=function(m,p,u){return G(this,m,p,u,!1)},R.prototype.once=function(m,p,u){return G(this,m,p,u,!0)},R.prototype.removeListener=function(m,p,u,l){var d=j?j+m:m;if(!this._events[d])return this;if(!p)return n(this,d),this;var o=this._events[d];if(o.fn)o.fn===p&&(!l||o.once)&&(!u||o.context===u)&&n(this,d);else{for(var h=0,s=[],a=o.length;h<a;h++)(o[h].fn!==p||l&&!o[h].once||u&&o[h].context!==u)&&s.push(o[h]);s.length?this._events[d]=s.length===1?s[0]:s:n(this,d)}return this},R.prototype.removeAllListeners=function(m){var p;return m?(p=j?j+m:m,this._events[p]&&n(this,p)):(this._events=new U,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=j,R.EventEmitter=R,re.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(re,$,P){(function(Y){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,U=/^([^\/?#]*)([^]*)$/,z=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(R,v,m){if(m=m||{},R=R.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return R;var p=n.parseURL(R);if(!p)throw new Error("Error trying to parse base URL.");return p.path=n.normalizePath(p.path),n.buildURLFromParts(p)}var u=n.parseURL(v);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return m.alwaysNormalize?(u.path=n.normalizePath(u.path),n.buildURLFromParts(u)):v;var l=n.parseURL(R);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var d=U.exec(l.path);l.netLoc=d[1],l.path=d[2]}l.netLoc&&!l.path&&(l.path="/");var o={scheme:l.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(o.netLoc=l.netLoc,u.path[0]!=="/"))if(!u.path)o.path=l.path,u.params||(o.params=l.params,u.query||(o.query=l.query));else{var h=l.path,s=h.substring(0,h.lastIndexOf("/")+1)+u.path;o.path=n.normalizePath(s)}return o.path===null&&(o.path=m.alwaysNormalize?n.normalizePath(u.path):u.path),n.buildURLFromParts(o)},parseURL:function(R){var v=j.exec(R);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(z,"");R.length!==(R=R.replace(G,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};re.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(re,$,P){function Y(m){var p={};function u(d){if(p[d])return p[d].exports;var o=p[d]={i:d,l:!1,exports:{}};return m[d].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=m,u.c=p,u.i=function(d){return d},u.d=function(d,o,h){u.o(d,o)||Object.defineProperty(d,o,{configurable:!1,enumerable:!0,get:h})},u.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},u.n=function(d){var o=d&&d.__esModule?function(){return d.default}:function(){return d};return u.d(o,"a",o),o},u.o=function(d,o){return Object.prototype.hasOwnProperty.call(d,o)},u.p="/",u.oe=function(d){throw console.error(d),d};var l=u(u.s=ENTRY_MODULE);return l.default||l}var j="[\\.|\\-|\\+|\\w|/|@]+",U="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function z(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(m){return!isNaN(1*m)}function n(m,p,u){var l={};l[u]=[];var d=p.toString(),o=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return l;for(var h=o[1],s=new RegExp("(\\\\n|\\W)"+z(h)+U,"g"),a;a=s.exec(d);){if(a[3]==="dll-reference")continue;l[u].push(a[3])}for(s=new RegExp("\\("+z(h)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+U,"g");a=s.exec(d);)m[a[2]]||(l[u].push(a[1]),m[a[2]]=P(a[1]).m),l[a[2]]=l[a[2]]||[],l[a[2]].push(a[4]);for(var A=Object.keys(l),E=0;E<A.length;E++)for(var T=0;T<l[A[E]].length;T++)G(l[A[E]][T])&&(l[A[E]][T]=1*l[A[E]][T]);return l}function R(m){var p=Object.keys(m);return p.reduce(function(u,l){return u||m[l].length>0},!1)}function v(m,p){for(var u={main:[p]},l={main:[]},d={main:{}};R(u);)for(var o=Object.keys(u),h=0;h<o.length;h++){var s=o[h],a=u[s],A=a.pop();if(d[s]=d[s]||{},d[s][A]||!m[s][A])continue;d[s][A]=!0,l[s]=l[s]||[],l[s].push(A);for(var E=n(m,m[s][A],s),T=Object.keys(E),D=0;D<T.length;D++)u[T[D]]=u[T[D]]||[],u[T[D]]=u[T[D]].concat(E[T[D]])}return l}re.exports=function(m,p){p=p||{};var u={main:P.m},l=p.all?{main:Object.keys(u.main)}:v(u,m),d="";Object.keys(l).filter(function(A){return A!=="main"}).forEach(function(A){for(var E=0;l[A][E];)E++;l[A].push(E),u[A][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+A+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+l[A].map(function(T){return""+JSON.stringify(T)+": "+u[A][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+l.main.map(function(A){return""+JSON.stringify(A)+": "+u.main[A].toString()}).join(",")+"}))(self);";var o=new window.Blob([d],{type:"text/javascript"});if(p.bare)return o;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,s=h.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(re,$,P){"use strict";P.r($),P.d($,"hlsDefaultConfig",function(){return D}),P.d($,"mergeConfig",function(){return w}),P.d($,"enableStreamingMode",function(){return O});var Y=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),U=P("./src/controller/audio-track-controller.ts"),z=P("./src/controller/subtitle-stream-controller.ts"),G=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),R=P("./src/controller/timeline-controller.ts"),v=P("./src/controller/cap-level-controller.ts"),m=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),u=P("./src/controller/cmcd-controller.ts"),l=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),o=P("./src/utils/cues.ts"),h=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(S){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(S[y]=C[y])}return S},a.apply(this,arguments)}function A(S,f){var C=Object.keys(S);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(S);f&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(S,b).enumerable})),C.push.apply(C,y)}return C}function E(S){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?A(Object(C),!0).forEach(function(y){T(S,y,C[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(C)):A(Object(C)).forEach(function(y){Object.defineProperty(S,y,Object.getOwnPropertyDescriptor(C,y))})}return S}function T(S,f,C){return f in S?Object.defineProperty(S,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[f]=C,S}var D=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Y.default,bufferController:n.default,capLevelController:v.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:h.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},L()),{},{subtitleStreamController:z.SubtitleStreamController,subtitleTrackController:G.default,timelineController:R.TimelineController,audioStreamController:j.default,audioTrackController:U.default,emeController:p.default,cmcdController:u.default});function L(){return{cueHandler:o.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function w(S,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},S,f)}function O(S){var f=S.loader;if(f!==d.default&&f!==l.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),S.progressive=!1;else{var C=Object(d.fetchSupported)();C&&(S.loader=d.default,S.progressive=!0,S.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),G=P("./src/errors.ts"),n=P("./src/types/loader.ts"),R=P("./src/utils/logger.ts");function v(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function m(u,l,d){return l&&v(u.prototype,l),d&&v(u,d),u}var p=function(){function u(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var o=d.config;this.bwEstimator=new j.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var l=u.prototype;return l.registerListeners=function(){var o=this.hls;o.on(U.Events.FRAG_LOADING,this.onFragLoading,this),o.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(U.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(U.Events.FRAG_LOADING,this.onFragLoading,this),o.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(U.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(o,h){var s=h.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=h.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(o,h){var s=this.hls.config;h.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,A=s.config,E=s.media;if(!o||!E)return;var T=h?h.stats:o.stats,D=h?h.duration:o.duration;if(T.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||E.paused||!E.playbackRate||!E.readyState)return;var L=performance.now()-T.loading.start,w=Math.abs(E.playbackRate);if(L<=500*D/w)return;var O=s.levels,S=s.minAutoLevel,f=O[o.level],C=T.total||Math.max(T.loaded,Math.round(D*f.maxBitrate/8)),y=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/L),b=(C-T.loaded)/y,B=E.currentTime,F=(z.BufferHelper.bufferInfo(E,B,A.maxBufferHole).end-B)/w;if(F>=2*D/w||b<=F)return;var x=Number.POSITIVE_INFINITY,N;for(N=o.level-1;N>S;N--){var I=O[N].maxBitrate;if(x=D*I/(8*.8*y),x<F)break}if(x>=b)return;var g=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+o.sn+(h?" part "+h.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+N+`
|
|
Current BW estimate: `+(Object(Y.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+x.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),s.nextLoadLevel=N,this.bwEstimator.sample(L,T.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:h,stats:T})},l.onFragLoaded=function(o,h){var s=h.frag,a=h.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(s.sn)){var A=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[s.level],D=(T.loaded?T.loaded.bytes:0)+A.loaded,L=(T.loaded?T.loaded.duration:0)+E;T.loaded={bytes:D,duration:L},T.realBitrate=Math.round(8*D/L)}if(s.bitrateTest){var w={stats:A,frag:s,part:a,id:s.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,w),s.bitrateTest=!1}}},l.onFragBuffered=function(o,h){var s=h.frag,a=h.part,A=a?a.stats:s.stats;if(A.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=A.parsing.end-A.loading.start;this.bwEstimator.sample(E,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},l.onError=function(o,h){switch(h.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.maxAutoLevel,A=s.config,E=s.minAutoLevel,T=s.media,D=h?h.duration:o?o.duration:0,L=T?T.currentTime:0,w=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,O=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,S=(z.BufferHelper.bufferInfo(T,L,A.maxBufferHole).end-L)/w,f=this.findBestLevel(O,E,a,S,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(f>=0)return f;R.logger.trace((S?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=D?Math.min(D,A.maxStarvationDelay):A.maxStarvationDelay,y=A.abrBandWidthFactor,b=A.abrBandWidthUpFactor;if(!S){var B=this.bitrateTestDelay;if(B){var F=D?Math.min(D,A.maxLoadingDelay):A.maxLoadingDelay;C=F-B,R.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),y=b=1}}return f=this.findBestLevel(O,E,a,S+C,y,b),Math.max(f,0)},l.findBestLevel=function(o,h,s,a,A,E){for(var T,D=this.fragCurrent,L=this.partCurrent,w=this.lastLoadedFragLevel,O=this.hls.levels,S=O[w],f=!!(S!=null&&(T=S.details)!==null&&T!==void 0&&T.live),C=S==null?void 0:S.codecSet,y=L?L.duration:D?D.duration:0,b=s;b>=h;b--){var B=O[b];if(!B||C&&B.codecSet!==C)continue;var F=B.details,x=(L?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,N=void 0;b<=w?N=A*o:N=E*o;var I=O[b].maxBitrate,g=I*x/N;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(N)+"/"+I+"/"+x+"/"+a+"/"+g),N>I&&(!g||f&&!this.bitrateTestDelay||g<a))return b}return-1},m(u,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,h=this.bwEstimator;if(o!==-1&&(!h||!h.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),u}();$.default=p},"./src/controller/audio-stream-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/events.ts"),z=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),R=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),u=P("./src/types/transmuxer.ts"),l=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),o=P("./src/errors.ts"),h=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var w=arguments[L];for(var O in w)Object.prototype.hasOwnProperty.call(w,O)&&(D[O]=w[O])}return D},s.apply(this,arguments)}function a(D,L){D.prototype=Object.create(L.prototype),D.prototype.constructor=D,A(D,L)}function A(D,L){return A=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},A(D,L)}var E=100,T=function(D){a(L,D);function L(O,S){var f;return f=D.call(this,O,S,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var w=L.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var S=this.hls;S.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),S.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.on(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),S.on(U.Events.ERROR,this.onError,this),S.on(U.Events.BUFFER_RESET,this.onBufferReset,this),S.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),S.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),S.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var S=this.hls;S.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(U.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),S.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.off(U.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),S.off(U.Events.ERROR,this.onError,this),S.off(U.Events.BUFFER_RESET,this.onBufferReset,this),S.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),S.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),S.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(S,f){var C=f.frag,y=f.id,b=f.initPTS;if(y==="main"){var B=C.cc;this.initPTS[C.cc]=b,this.log("InitPTS for cc: "+B+" found from main: "+b),this.videoTrackCC=B,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(S){if(!this.levels){this.startPosition=S,this.state=j.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,f>0&&S===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()},w.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var S,f=this.levels,C=this.trackId,y=f==null||((S=f[C])===null||S===void 0)?void 0:S.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,B=performance.now(),F=this.retryDate;(!F||B>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var N=x.frag,I=x.part,g=x.cache,W=x.complete;if(this.initPTS[N.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var J=g.flush(),ie={frag:N,part:I,payload:J,networkDetails:null};this._handleFragmentLoadProgress(ie),W&&D.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+N.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Re=z.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),ve=Object(l.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,N);ve<0&&(h.logger.log("Waiting fragment cc ("+N.cc+") @ "+N.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var S=this.waitingData;S&&(this.fragmentTracker.removeFragment(S.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},w.onTickEnd=function(){var S=this.media;if(!S||!S.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:S,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=S.currentTime},w.doTickIdle=function(){var S,f,C=this.hls,y=this.levels,b=this.media,B=this.trackId,F=C.config;if(!y||!y[B])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var x=y[B],N=x.details;if(!N||N.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(N)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,W=this.getMaxBufferLength(),J=this.audioSwitch;if(g>=W&&!J)return;if(!J&&this._streamEnded(I,N)){C.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ie=N.fragments,ue=ie[0].start,Re=I.end;if(J){var ve=this.getLoadPosition();Re=ve,N.PTSKnown&&ve<ue&&((I.end>ue||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ue+.05))}var Se=this.getNextFragment(Re,N);if(!Se){this.bufferFlushed=!0;return}((S=Se.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((f=Se.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Se,N):this.loadFragment(Se,N,Re)},w.getMaxBufferLength=function(){var S=D.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return f===null?S:Math.max(S,f.len)},w.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(S,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(y){return new n.Level(y)})},w.onAudioTrackSwitching=function(S,f){var C=!!f.url;this.trackId=f.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(E):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(S,f){this.mainDetails=f.details},w.onAudioTrackLoaded=function(S,f){var C,y=this.levels,b=f.details,B=f.id;if(!y){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[B],x=0;if(b.live||(C=F.details)!==null&&C!==void 0&&C.live){var N=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!N)return;!F.details&&b.hasProgramDateTime&&N.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(b,N),x=b.fragments[0].start):x=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,x),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(S){var f,C=S.frag,y=S.part,b=S.payload,B=this.config,F=this.trackId,x=this.levels;if(!x){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var N=x[F];console.assert(N,"Audio track is defined on fragment load progress");var I=N.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=B.defaultAudioCodec||N.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new p.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[C.cc],ie=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(J!==void 0){var ue=!1,Re=y?y.index:-1,ve=Re!==-1,Se=new u.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,b.byteLength,Re,ve);W.push(b,ie,g,"",C,y,I.totalduration,ue,Se,J)}else{h.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var Le=this.waitingData=this.waitingData||{frag:C,part:y,cache:new m.default,complete:!1},be=Le.cache;be.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(S){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,S)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(S,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},w.onFragBuffered=function(S,f){var C=f.frag,y=f.part;if(C.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(y?" p: "+y.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,y)},w.onError=function(S,f){switch(f.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,f);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=f.fatal?j.State.ERROR:j.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var C=!0,y=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);y&&y.len>.5&&(C=!this.reduceMaxBufferLength(y.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},w.onBufferFlushed=function(S,f){var C=f.type;C===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(S){var f,C="audio",y=this.hls,b=S.remuxResult,B=S.chunkMeta,F=this.getCurrentContext(B);if(!F){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var x=F.frag,N=F.part,I=b.audio,g=b.text,W=b.id3,J=b.initSegment;if(this.fragContextChanged(x))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,x,B),y.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:C,tracks:J.tracks})),I){var ie=I.startPTS,ue=I.endPTS,Re=I.startDTS,ve=I.endDTS;N&&(N.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:ue,startDTS:Re,endDTS:ve}),x.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ie,ue,Re,ve),this.bufferFragmentData(I,x,N,B)}if(W!=null&&(f=W.samples)!==null&&f!==void 0&&f.length){var Se=s({frag:x,id:C},W);y.trigger(U.Events.FRAG_PARSING_METADATA,Se)}if(g){var Le=s({frag:x,id:C},g);y.trigger(U.Events.FRAG_PARSING_USERDATA,Le)}},w._bufferInitSegment=function(S,f,C){if(this.state!==j.State.PARSING)return;S.video&&delete S.video;var y=S.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,S);var b=y.initSegment;if(b!=null&&b.byteLength){var B={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:b};this.hls.trigger(U.Events.BUFFER_APPENDING,B)}this.tick()},w.loadFragment=function(S,f,C){var y=this.fragmentTracker.getState(S);this.fragCurrent=S,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(S.sn==="initSegment"?this._loadInitSegment(S):f.live&&!Object(Y.isFiniteNumber)(this.initPTS[S.cc])?(this.log("Waiting for video PTS in continuity counter "+S.cc+" of live stream before loading audio fragment "+S.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,S,f,C)))},w.completeAudioSwitch=function(){var S=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,S.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:C})},L}(j.default);$.default=T},"./src/controller/audio-track-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function G(p,u){for(var l=0;l<u.length;l++){var d=u[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function n(p,u,l){return u&&G(p.prototype,u),l&&G(p,l),p}function R(p,u){p.prototype=Object.create(u.prototype),p.prototype.constructor=p,v(p,u)}function v(p,u){return v=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},v(p,u)}var m=function(p){R(u,p);function u(d){var o;return o=p.call(this,d,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var l=u.prototype;return l.registerListeners=function(){var o=this.hls;o.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(Y.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(Y.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(o,h){this.tracks=h.audioTracks||[]},l.onAudioTrackLoaded=function(o,h){var s=h.id,a=h.details,A=this.tracksInGroup[s];if(!A){this.warn("Invalid audio track id "+s);return}var E=A.details;A.details=h.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,h,E))},l.onLevelLoading=function(o,h){this.switchLevel(h.level)},l.onLevelSwitching=function(o,h){this.switchLevel(h.level)},l.switchLevel=function(o){var h=this.hls.levels[o];if(!(h!=null&&h.audioGroupIds))return;var s=h.audioGroupIds[h.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(E){return!s||E.groupId===s});this.selectDefaultTrack&&!a.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var A={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},l.onError=function(o,h){if(p.prototype.onError.call(this,o,h),h.fatal||!h.context)return;h.context.type===z.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},l.setAudioTrack=function(o){var h=this.tracksInGroup;if(o<0||o>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=h[this.trackId];this.log("Now switching to audio-track index "+o);var a=h[o],A=a.id,E=a.groupId,T=E===void 0?"":E,D=a.name,L=a.type,w=a.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:T,name:D,type:L,url:w}),a.details&&!a.details.live)return;var O=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(O)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,s=this.findTrackId(h)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var h=this.tracksInGroup,s=0;s<h.length;s++){var a=h[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},l.loadPlaylist=function(o){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var s=h.id,a=h.groupId,A=h.url;if(o)try{A=o.addDirectives(A)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:A,id:s,groupId:a,deliveryDirectives:o||null})}},n(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),u}(U.default);$.default=m},"./src/controller/base-playlist-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var Y=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),U=P("./src/controller/level-helper.ts"),z=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),n=function(){function R(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=z.logger.log.bind(z.logger,p+":"),this.warn=z.logger.warn.bind(z.logger,p+":"),this.hls=m}var v=R.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,u){u.fatal&&u.type===G.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,u){var l=u==null?void 0:u.renditionReports;if(l)for(var d=0;d<l.length;d++){var o=l[d],h=""+o.URI;if(h===p.substr(-h.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var A=Math.min(u.age-u.partTarget,u.targetduration);a!==void 0&&A>u.partTarget&&(a+=1)}if(Object(Y.isFiniteNumber)(s))return new j.HlsUrlParameters(s,Object(Y.isFiniteNumber)(a)?a:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,u,l){var d=this,o=u.details,h=u.stats,s=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(U.mergeDetails)(l,o),!this.canLoad||!o.live)return;var a,A=void 0,E=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var T=this.hls.config.lowLatencyMode,D=o.lastPartSn,L=o.endSN,w=o.lastPartIndex,O=w!==-1,S=D===L,f=T?0:w;O?(A=S?L+1:D,E=S?f:w+1):A=L+1;var C=o.age,y=C+o.ageHeader,b=Math.min(y-o.partTarget,o.targetduration*1.5);if(b>0){if(l&&b>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+b+" with playlist age: "+o.age),b=0;else{var B=Math.floor(b/o.targetduration);if(A+=B,E!==void 0){var F=Math.round(b%o.targetduration/o.partTarget);E+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+b+" skip sn "+B+" to part "+E)}o.tuneInGoal=b}if(a=this.getDeliveryDirectives(o,u.deliveryDirectives,A,E),T||!S){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,u.deliveryDirectives,A,E);var x=Object(U.computeReloadInterval)(o,h);A!==void 0&&o.canBlockReload&&(x-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(a)},x)}else this.clearTimer()},v.getDeliveryDirectives=function(p,u,l,d){var o=Object(j.getSkipValue)(p,l);return u!=null&&u.skip&&p.deltaUpdateFailed&&(l=u.msn,d=u.part,o=j.HlsSkip.No),new j.HlsUrlParameters(l,d,o)},v.retryLoadingOrFail=function(p){var u=this,l=this.hls.config,d=this.retryCount<l.levelLoadingMaxRetry;if(d){var o;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return d},R}()},"./src/controller/base-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"State",function(){return L}),P.d($,"default",function(){return w});var Y=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),U=P("./src/controller/fragment-tracker.ts"),z=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts"),n=P("./src/events.ts"),R=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),u=P("./src/controller/fragment-finders.ts"),l=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),h=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(O,S){for(var f=0;f<S.length;f++){var C=S[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(O,C.key,C)}}function A(O,S,f){return S&&a(O.prototype,S),f&&a(O,f),O}function E(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function T(O,S){O.prototype=Object.create(S.prototype),O.prototype.constructor=O,D(O,S)}function D(O,S){return D=Object.setPrototypeOf||function(C,y){return C.__proto__=y,C},D(O,S)}var L={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},w=function(O){T(S,O);function S(C,y,b){var B;return B=O.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=L.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=b,B.log=G.logger.log.bind(G.logger,b+":"),B.warn=G.logger.warn.bind(G.logger,b+":"),B.hls=C,B.fragmentLoader=new d.default(C.config),B.fragmentTracker=y,B.config=C.config,B.decrypter=new o.default(C,C.config),C.on(n.Events.KEY_LOADED,B.onKeyLoaded,E(B)),B}var f=S.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(y){},f.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=L.STOPPED},f._streamEnded=function(y,b){var B=this.fragCurrent,F=this.fragmentTracker;if(!b.live&&B&&B.sn===b.endSN&&!y.nextStart){var x=F.getState(B);return x===U.FragmentState.PARTIAL||x===U.FragmentState.OK}return!1},f.onMediaAttached=function(y,b){var B=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===L.STOPPED&&this.startLoad(F.startPosition)},f.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var y=this.config,b=this.fragCurrent,B=this.media,F=this.mediaBuffer,x=this.state,N=B?B.currentTime:0,I=z.BufferHelper.bufferInfo(F||B,N,y.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(N)?N.toFixed(3):N)+", state: "+x),x===L.ENDED)this.resetLoadingState();else if(b&&!I.len){var g=y.maxFragLookUpTolerance,W=b.start-g,J=b.start+b.duration+g,ie=N>J;(N<W||ie)&&(ie&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=N),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=N),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(y,b){if(this.state!==L.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=L.IDLE;var B=this.levels[b.frag.level].details;B&&this.loadFragment(b.frag,B,b.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),O.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=L.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,O.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(y,b){this.log("Loading key for "+y.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=L.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(n.Events.KEY_LOADING,{frag:y})},f.loadFragment=function(y,b,B){this._loadFragForPlayback(y,b,B)},f._loadFragForPlayback=function(y,b,B){var F=this,x=function(I){if(F.fragContextChanged(y)){F.warn("Fragment "+y.sn+(I.part?" p: "+I.part.index:"")+" of level "+y.level+" was dropped during download."),F.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,F._handleFragmentLoadProgress(I)};this._doFragLoad(y,b,B,x).then(function(N){if(!N)return;F.fragLoadError=0;var I=F.state;if(F.fragContextChanged(y)){(I===L.FRAG_LOADING||I===L.BACKTRACKING||!F.fragCurrent&&I===L.PARSING)&&(F.fragmentTracker.removeFragment(y),F.state=L.IDLE);return}if("payload"in N&&(F.log("Loaded fragment "+y.sn+" of level "+y.level),F.hls.trigger(n.Events.FRAG_LOADED,N),F.state===L.BACKTRACKING)){F.fragmentTracker.backtrack(y,N),F.resetFragmentLoading(y);return}F._handleFragmentLoadComplete(N)}).catch(function(N){F.warn(N),F.resetFragmentLoading(y)})},f.flushMainBuffer=function(y,b,B){if(B===void 0&&(B=null),!(y-b))return;var F={startOffset:y,endOffset:b,type:B};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},f._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(B){if(!B||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return B}).then(function(B){var F=b.hls,x=B.payload,N=y.decryptdata;if(x&&x.byteLength>0&&N&&N.key&&N.iv&&N.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(x),N.key.buffer,N.iv.buffer).then(function(g){var W=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:W}}),B.payload=g,B})}return B}).then(function(B){var F=b.fragCurrent,x=b.hls,N=b.levels;if(!N)throw new Error("init load aborted, missing levels");var I=N[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=L.IDLE,b.fragLoadError=0,y.data=new Uint8Array(B.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),B.frag===F&&x.trigger(n.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(B){b.warn(B),b.resetFragmentLoading(y)})},f.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},f.fragBufferedComplete=function(y,b){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+h.default.toString(z.BufferHelper.getBuffered(B))),this.state=L.IDLE,this.tick()},f._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var B=y.frag,F=y.part,x=y.partsLoaded,N=!x||x.length===0||x.some(function(g){return!g}),I=new v.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,F?F.index:-1,!N);b.flush(I)},f._handleFragmentLoadProgress=function(y){},f._doFragLoad=function(y,b,B,F){var x=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(y.start,B||0),this.config.lowLatencyMode&&b){var N=b.partList;if(N&&F){B>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(N,y,B);if(I>-1){var g=N[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(N.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=L.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:y,part:N[I],targetBufferTime:B}),this.doFragPartsLoad(y,N,I,F).catch(function(W){return x.handleFragLoadError(W)})}else if(!y.url||this.loadedEndOfParts(N,B))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),Object(Y.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=L.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:y,targetBufferTime:B}),this.fragmentLoader.load(y,F).catch(function(W){return x.handleFragLoadError(W)})},f.doFragPartsLoad=function(y,b,B,F){var x=this;return new Promise(function(N,I){var g=[],W=function J(ie){var ue=b[ie];x.fragmentLoader.loadPart(y,ue,F).then(function(Re){g[ue.index]=Re;var ve=Re.part;x.hls.trigger(n.Events.FRAG_LOADED,Re);var Se=b[ie+1];if(Se&&Se.fragment===y)J(ie+1);else return N({frag:y,part:ve,partsLoaded:g})}).catch(I)};W(B)})},f.handleFragLoadError=function(y){var b=y.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(n.Events.ERROR,b),null},f._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==L.PARSING){this.fragCurrent||(this.state=L.IDLE);return}var B=b.frag,F=b.part,x=b.level,N=self.performance.now();B.stats.parsing.end=N,F&&(F.stats.parsing.end=N),this.updateLevelTiming(B,F,x,y.partial)},f.getCurrentContext=function(y){var b=this.levels,B=y.level,F=y.sn,x=y.part;if(!b||!b[B])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+B+". The current chunk will not be buffered."),null;var N=b[B],I=x>-1?Object(l.getPartWith)(N,F,x):null,g=I?I.fragment:Object(l.getFragmentWithSN)(N,F,this.fragCurrent);return g?{frag:g,part:I,level:N}:null},f.bufferFragmentData=function(y,b,B,F){if(!y||this.state!==L.PARSING)return;var x=y.data1,N=y.data2,I=x;if(x&&N&&(I=Object(m.appendUint8Array)(x,N)),!I||!I.length)return;var g={type:y.type,frag:b,part:B,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(n.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!B&&this.flushBufferGap(b)},f.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!z.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var B=b.currentTime,F=z.BufferHelper.bufferInfo(b,B,0),x=y.duration,N=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),I=Math.max(Math.min(y.start-N,F.end-N),B+N);y.start-I>N&&this.flushMainBuffer(I,y.start)},f.getFwdBufferInfo=function(y,b){var B=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var x=z.BufferHelper.bufferInfo(y,F,B.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var N=this.fragmentTracker.getBufferedFrag(F,b);if(N&&x.nextStart<N.end)return z.BufferHelper.bufferInfo(y,F,Math.max(x.nextStart,B.maxBufferHole))}return x},f.getMaxBufferLength=function(y){var b=this.config,B;return y?B=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):B=b.maxBufferLength,Math.min(B,b.maxMaxBufferLength)},f.reduceMaxBufferLength=function(y){var b=this.config,B=y||b.maxBufferLength;return b.maxMaxBufferLength>=B?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(y,b){var B,F,x=b.fragments,N=x.length;if(!N)return null;var I=this.config,g=x[0].start,W;if(b.live){var J=I.initialLiveManifestSize;if(N<J)return this.warn("Not enough fragments to start playback (have: "+N+", need: "+J+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(b,x),this.startPosition=W?this.hls.liveSyncPosition||W.start:y)}else y<=g&&(W=x[0]);if(!W){var ie=I.lowLatencyMode?b.partEnd:b.fragmentEnd;W=this.getFragmentAtPosition(y,ie,b)}return(B=W)!==null&&B!==void 0&&B.initSegment&&!((F=W)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},f.getNextPart=function(y,b,B){for(var F=-1,x=!1,N=!0,I=0,g=y.length;I<g;I++){var W=y[I];if(N=N&&!W.independent,F>-1&&B<W.start)break;var J=W.loaded;!J&&(x||W.independent||N)&&W.fragment===b&&(F=I),x=J}return F},f.loadedEndOfParts=function(y,b){var B=y[y.length-1];return B&&b>B.start&&B.loaded},f.getInitialLiveFragment=function(y,b){var B=this.fragPrevious,F=null;if(B){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),F=Object(u.findFragmentByPDT)(b,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var x=B.sn+1;if(x>=y.startSN&&x<=y.endSN){var N=b[x-y.startSN];B.cc===N.cc&&(F=N,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(u.findFragWithCC)(b,B.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},f.getFragmentAtPosition=function(y,b,B){var F=this.config,x=this.fragPrevious,N=B.fragments,I=B.endSN,g=B.fragmentHint,W=F.maxFragLookUpTolerance,J=!!(F.lowLatencyMode&&B.partList&&g);J&&g&&!this.bitrateTest&&(N=N.concat(g),I=g.sn);var ie;if(y<b){var ue=y>b-W?0:W;ie=Object(u.findFragmentByPTS)(x,N,y,ue)}else ie=N[N.length-1];if(ie){var Re=ie.sn-B.startSN,ve=x&&ie.level===x.level,Se=N[Re+1],Le=this.fragmentTracker.getState(ie);if(Le===U.FragmentState.BACKTRACKED){ie=null;for(var be=Re;N[be]&&this.fragmentTracker.getState(N[be])===U.FragmentState.BACKTRACKED;)x?ie=N[be--]:ie=N[--be];ie||(ie=Se)}else x&&ie.sn===x.sn&&!J&&(ve&&(ie.sn<I&&this.fragmentTracker.getState(Se)!==U.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+Se.sn),ie=Se):ie=null))}return ie},f.synchronizeToLiveEdge=function(y){var b=this.config,B=this.media;if(!B)return;var F=this.hls.liveSyncPosition,x=B.currentTime,N=y.fragments[0].start,I=y.edge,g=x>=N-b.maxFragLookUpTolerance&&x<=I;if(F!==null&&B.duration>F&&(x<F||!g)){var W=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!g&&B.readyState<4||x<I-W)&&(this.loadedmetadata||(this.nextLoadPosition=F),B.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+F.toFixed(3)),B.currentTime=F))}},f.alignPlaylists=function(y,b){var B=this.levels,F=this.levelLastLoaded,x=this.fragPrevious,N=F!==null?B[F]:null,I=y.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,W=!b,J=y.alignedSliding&&Object(Y.isFiniteNumber)(g);if(W||!J&&!g){Object(p.alignStream)(x,N,y);var ie=y.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+I),ie}return g},f.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},f.setStartPosition=function(y,b){var B=this.startPosition;if(B<b&&(B=-1),B===-1||this.lastCurrentTime===-1){var F=y.startTimeOffset;Object(Y.isFiniteNumber)(F)?(B=b+F,F<0&&(B+=y.totalduration),B=Math.min(Math.max(b,B),b+y.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+B),this.startPosition=B):y.live?B=this.hls.liveSyncPosition||b:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},f.getLoadPosition=function(){var y=this.media,b=0;return this.loadedmetadata&&y?b=y.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},f.handleFragLoadAborted=function(y,b){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(b?" part"+b.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},f.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=L.IDLE)},f.onFragmentOrKeyLoadError=function(y,b){if(b.fatal)return;var B=b.frag;if(!B||B.type!==y)return;var F=this.fragCurrent;console.assert(F&&B.sn===F.sn&&B.level===F.level&&B.urlId===F.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var N=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+y+" "+B.level+" failed to load, retrying in "+N+"ms"),this.retryDate=self.performance.now()+N,this.fragLoadError++,this.state=L.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=L.IDLE):(G.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=L.ERROR)},f.afterBufferFlushed=function(y,b,B){if(!y)return;var F=z.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,F,B),this.state===L.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=L.IDLE},f.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[y].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(y,b,B,F){var x=this,N=B.details;console.assert(!!N,"level.details must be defined");var I=Object.keys(y.elementaryStreams).reduce(function(g,W){var J=y.elementaryStreams[W];if(J){var ie=J.endPTS-J.startPTS;if(ie<=0)return x.warn("Could not parse fragment "+y.sn+" "+W+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),g||!1;var ue=F?0:Object(l.updateFragPTSDTS)(N,y,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return x.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:N,level:B,drift:ue,type:W,frag:y,start:J.startPTS,end:J.endPTS}),!0}return g},!1);I?(this.state=L.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:y,part:b})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(S,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),S}(j.default)},"./src/controller/buffer-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./src/errors.ts"),G=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),R=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(n.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function l(o){var h=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=h.hls,a=h.media,A=h.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),a&&(h.updateMediaElementDuration(),s.trigger(j.Events.MEDIA_ATTACHED,{media:a})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var d=l.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var h=this.hls;h.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(j.Events.BUFFER_RESET,this.onBufferReset,this),h.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(j.Events.BUFFER_EOS,this.onBufferEos,this),h.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(j.Events.FRAG_PARSED,this.onFragParsed,this),h.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var h=this.hls;h.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(j.Events.BUFFER_RESET,this.onBufferReset,this),h.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(j.Events.BUFFER_EOS,this.onBufferEos,this),h.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(j.Events.FRAG_PARSED,this.onFragParsed,this),h.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(h,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(h,s){var a=this.media=s.media;if(a&&m){var A=this.mediaSource=new m;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(A),this._objectUrl=a.src}},d.onMediaDetaching=function(){var h=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(U.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(A){U.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(a&&self.URL.revokeObjectURL(a),h.src===a?(h.removeAttribute("src"),h.load()):U.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(j.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(s){var a=h.sourceBuffer[s];try{a&&(h.removeBufferListeners(s),h.mediaSource&&h.mediaSource.removeSourceBuffer(a),h.sourceBuffer[s]=void 0)}catch(A){U.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",A)}}),this._initSourceBuffer()},d.onBufferCodecs=function(h,s){var a=this,A=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(A){var T=a.tracks[E];if(T&&typeof T.buffer.changeType=="function"){var D=s[E],L=D.codec,w=D.levelCodec,O=D.container,S=(T.levelCodec||T.codec).replace(p,"$1"),f=(w||L).replace(p,"$1");if(S!==f){var C=O+";codecs="+(w||L);a.appendChangeType(E,C)}}}else a.pendingTracks[E]=s[E]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(h,s){var a=this,A=this.operationQueue,E={execute:function(){var D=a.sourceBuffer[h];D&&(U.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+s),D.changeType(s)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(D){U.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",D)}};A.append(E,h)},d.onBufferAppending=function(h,s){var a=this,A=this.hls,E=this.operationQueue,T=this.tracks,D=s.data,L=s.type,w=s.frag,O=s.part,S=s.chunkMeta,f=S.buffering[L],C=self.performance.now();f.start=C;var y=w.stats.buffering,b=O?O.stats.buffering:null;y.start===0&&(y.start=C),b&&b.start===0&&(b.start=C);var B=T.audio,F=L==="audio"&&S.id===1&&(B==null?void 0:B.container)==="audio/mpeg",x={execute:function(){if(f.executeStart=self.performance.now(),F){var I=a.sourceBuffer[L];if(I){var g=w.start-I.timestampOffset;Math.abs(g)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+g+") sn: "+w.sn+")"),I.timestampOffset=w.start)}}a.appendExecutor(D,L)},onStart:function(){},onComplete:function(){var I=self.performance.now();f.executeEnd=f.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=a.sourceBuffer,W={};for(var J in g)W[J]=G.BufferHelper.getBuffered(g[J]);a.appendError=0,a.hls.trigger(j.Events.BUFFER_APPENDED,{type:L,frag:w,part:O,chunkMeta:S,parent:w.type,timeRanges:W})},onError:function(I){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",I);var g={type:z.ErrorTypes.MEDIA_ERROR,parent:w.type,details:z.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=z.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=z.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>A.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),A.trigger(j.Events.ERROR,g)}};E.append(x,L)},d.onBufferFlushing=function(h,s){var a=this,A=this.operationQueue,E=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(w){U.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",w)}}};s.type?A.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(T){A.append(E(T),T)})},d.onFragParsed=function(h,s){var a=this,A=s.frag,E=s.part,T=[],D=E?E.elementaryStreams:A.elementaryStreams;D[R.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(D[R.ElementaryStreamTypes.AUDIO]&&T.push("audio"),D[R.ElementaryStreamTypes.VIDEO]&&T.push("video"));var L=function(){var O=self.performance.now();A.stats.buffering.end=O,E&&(E.stats.buffering.end=O);var S=E?E.stats:A.stats;a.hls.trigger(j.Events.FRAG_BUFFERED,{frag:A,part:E,stats:S,id:A.type})};T.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(L,T)},d.onFragChanged=function(h,s){this.flushBackBuffer()},d.onBufferEos=function(h,s){var a=this,A=this.getSourceBufferTypes().reduce(function(E,T){var D=a.sourceBuffer[T];return(!s.type||s.type===T)&&(D&&!D.ended&&(D.ended=!0,U.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),E&&!!(!D||D.ended)},!0);A&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},d.onLevelUpdated=function(h,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var h=this.hls,s=this.details,a=this.media,A=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var T=s.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(Y.isFiniteNumber)(T)||T<0)return;var D=a.currentTime,L=s.levelTargetDuration,w=Math.max(T,L),O=Math.floor(D/L)*L-w;E.forEach(function(S){var f=A[S];if(f){var C=G.BufferHelper.getBuffered(f);C.length>0&&O>C.start(0)&&(h.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:O}),s.live&&h.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:O}),h.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:O,type:S}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,s=this.hls,a=this.media,A=this.mediaSource,E=h.fragments[0].start+h.totalduration,T=a.duration,D=Object(Y.isFiniteNumber)(A.duration)?A.duration:0;h.live&&s.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(E>D&&E>T||!Object(Y.isFiniteNumber)(T))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),A.duration=E)},d.updateSeekableRange=function(h){var s=this.mediaSource,a=h.fragments,A=a.length;if(A&&h.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),T=Math.max(E,E+h.totalduration);s.setLiveSeekableRange(E,T)}},d.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,A=Object.keys(a).length;if(A&&!h||A===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(T){s.executeNext(T)})}},d.createSourceBuffers=function(h){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var E in h)if(!s[E]){var T=h[E];if(!T)throw Error("source buffer exists for track "+E+", however track does not");var D=T.levelCodec||T.codec,L=T.container+";codecs="+D;U.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var w=s[E]=a.addSourceBuffer(L),O=E;this.addBufferListener(O,"updatestart",this._onSBUpdateStart),this.addBufferListener(O,"updateend",this._onSBUpdateEnd),this.addBufferListener(O,"error",this._onSBUpdateError),this.tracks[E]={buffer:w,codec:D,container:T.container,levelCodec:T.levelCodec,id:T.id},A++}catch(S){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+S.message),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:S,mimeType:L})}}A&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(h){var s=this.operationQueue,a=s.current(h);a.onStart()},d._onSBUpdateEnd=function(h){var s=this.operationQueue,a=s.current(h);a.onComplete(),s.shiftAndExecuteNext(h)},d._onSBUpdateError=function(h,s){U.logger.error("[buffer-controller]: "+h+" SourceBuffer error",s),this.hls.trigger(j.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(h);a&&a.onError(s)},d.removeExecutor=function(h,s,a){var A=this.media,E=this.mediaSource,T=this.operationQueue,D=this.sourceBuffer,L=D[h];if(!A||!E||!L){U.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(h);return}var w=Object(Y.isFiniteNumber)(A.duration)?A.duration:Infinity,O=Object(Y.isFiniteNumber)(E.duration)?E.duration:Infinity,S=Math.max(0,s),f=Math.min(a,w,O);f>S?(U.logger.log("[buffer-controller]: Removing ["+S+","+f+"] from the "+h+" SourceBuffer"),console.assert(!L.updating,h+" sourceBuffer must not be updating"),L.remove(S,f)):T.shiftAndExecuteNext(h)},d.appendExecutor=function(h,s){var a=this.operationQueue,A=this.sourceBuffer,E=A[s];if(!E){U.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(h)},d.blockBuffers=function(h,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,E=s.map(function(T){return A.appendBlocker(T)});Promise.all(E).then(function(){h(),s.forEach(function(T){var D=a.sourceBuffer[T];(!D||!D.updating)&&A.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(h,s,a){var A=this.sourceBuffer[h];if(!A)return;var E=a.bind(this,h);this.listeners[h].push({event:s,listener:E}),A.addEventListener(s,E)},d.removeBufferListeners=function(h){var s=this.sourceBuffer[h];if(!s)return;this.listeners[h].forEach(function(a){s.removeEventListener(a.event,a.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return j});var Y=P("./src/utils/logger.ts"),j=function(){function U(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var z=U.prototype;return z.append=function(n,R){var v=this.queues[R];v.push(n),v.length===1&&this.buffers[R]&&this.executeNext(R)},z.insertAbort=function(n,R){var v=this.queues[R];v.unshift(n),this.executeNext(R)},z.appendBlocker=function(n){var R,v=new Promise(function(p){R=p}),m={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,n),v},z.executeNext=function(n){var R=this.buffers,v=this.queues,m=R[n],p=v[n];if(p.length){var u=p[0];try{u.execute()}catch(l){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(l),(!m||!m.updating)&&(p.shift(),this.executeNext(n))}}},z.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},z.current=function(n){return this.queues[n][0]},U}()},"./src/controller/cap-level-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts");function j(G,n){for(var R=0;R<n.length;R++){var v=n[R];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(G,v.key,v)}}function U(G,n,R){return n&&j(G.prototype,n),R&&j(G,R),G}var z=function(){function G(R){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=G.prototype;return n.setStreamController=function(v){this.streamController=v},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var v=this.hls;v.on(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var v=this.hls;v.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(v,m){G.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},n.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},n.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},n.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var u=p.filter(function(l,d){return G.isLevelAllowed(d,m.restrictedLevels)&&d<=v});return this.clientRect=null,G.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},G.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},G.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var u=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},l=v.length-1,d=0;d<v.length;d+=1){var o=v[d];if((o.width>=m||o.height>=p)&&u(o,v[d+1])){l=d;break}}return l},U(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),G}();$.default=z},"./src/controller/cmcd-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var Y=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/utils/logger.ts");function G(l,d){for(var o=0;o<d.length;o++){var h=d[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}function n(l,d,o){return d&&G(l.prototype,d),o&&G(l,o),l}function R(l,d){var o=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(o)return(o=o.call(l)).next.bind(o);if(Array.isArray(l)||(o=v(l))||d&&l&&typeof l.length=="number"){o&&(l=o);var h=0;return function(){return h>=l.length?{done:!0}:{done:!1,value:l[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(l,d){if(!l)return;if(typeof l=="string")return m(l,d);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(l,d)}function m(l,d){(d==null||d>l.length)&&(d=l.length);for(var o=0,h=new Array(d);o<d;o++)h[o]=l[o];return h}function p(){return p=Object.assign||function(l){for(var d=1;d<arguments.length;d++){var o=arguments[d];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(l[h]=o[h])}return l},p.apply(this,arguments)}var u=function(){function l(o){var h=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(A){try{h.apply(A,{ot:j.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(E){z.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(A){try{var E=A.frag,T=h.hls.levels[E.level],D=h.getObjectType(E),L={d:E.duration*1e3,ot:D};(D===j.CMCDObjectType.VIDEO||D===j.CMCDObjectType.AUDIO||D==j.CMCDObjectType.MUXED)&&(L.br=T.bitrate/1e3,L.tb=h.getTopBandwidth(D),L.bl=h.getBufferLength(D)),h.apply(A,L)}catch(w){z.logger.warn("Could not generate segment CMCD data.",w)}},this.hls=o;var s=this.config=o.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||l.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var d=l.prototype;return d.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(h,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(h,s){var a,A;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(A=s.tracks.video)===null||A===void 0?void 0:A.buffer},d.createData=function(){var h;return{v:j.CMCDVersion,sf:j.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(h,s){s===void 0&&(s={}),p(s,this.createData());var a=s.ot===j.CMCDObjectType.INIT||s.ot===j.CMCDObjectType.VIDEO||s.ot===j.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var A=l.toHeaders(s);if(!Object.keys(A).length)return;h.headers||(h.headers={}),p(h.headers,A)}else{var E=l.toQuery(s);if(!E)return;h.url=l.appendQueryToUri(h.url,E)}},d.getObjectType=function(h){var s=h.type;return s==="subtitle"?j.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?j.CMCDObjectType.INIT:s==="audio"?j.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(h){for(var s=0,a=h===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=R(a),E;!(E=A()).done;){var T=E.value;T.bitrate>s&&(s=T.bitrate)}return s>0?s:NaN},d.getBufferLength=function(h){var s=this.hls.media,a=h===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var A=U.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return A.len*1e3},d.createPlaylistLoader=function(){var h=this.config.pLoader,s=this.applyPlaylistData,a=h||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new a(T)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,L,w){s(D),this.loader.load(D,L,w)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},d.createFragmentLoader=function(){var h=this.config.fLoader,s=this.applyFragmentData,a=h||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new a(T)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,L,w){s(D),this.loader.load(D,L,w)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},l.uuid=function(){var h=URL.createObjectURL(new Blob),s=h.toString();return URL.revokeObjectURL(h),s.substr(s.lastIndexOf("/")+1)},l.serialize=function(h){for(var s=[],a=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},A=function(F){return Math.round(F)},E=function(F){return A(F/100)*100},T=function(F){return encodeURIComponent(F)},D={br:A,d:A,bl:E,dl:E,mtp:E,nor:T,rtp:E,tb:A},L=Object.keys(h||{}).sort(),w=R(L),O;!(O=w()).done;){var S=O.value,f=h[S];if(!a(f))continue;if(S==="v"&&f===1)continue;if(S=="pr"&&f===1)continue;var C=D[S];C&&(f=C(f));var y=typeof f,b=void 0;S==="ot"||S==="sf"||S==="st"?b=S+"="+f:y==="boolean"?b=S:y==="number"?b=S+"="+f:b=S+"="+JSON.stringify(f),s.push(b)}return s.join(",")},l.toHeaders=function(h){for(var s=Object.keys(h),a={},A=["Object","Request","Session","Status"],E=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,L=s;D<L.length;D++){var w=L[D],O=T[w]!=null?T[w]:1;E[O][w]=h[w]}for(var S=0;S<E.length;S++){var f=l.serialize(E[S]);f&&(a["CMCD-"+A[S]]=f)}return a},l.toQuery=function(h){return"CMCD="+encodeURIComponent(l.serialize(h))},l.appendQueryToUri=function(h,s){if(!s)return h;var a=h.includes("?")?"&":"?";return""+h+a+s},l}()},"./src/controller/eme-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=P("./src/utils/mediakeys-helper.ts");function G(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function n(u,l,d){return l&&G(u.prototype,l),d&&G(u,d),u}var R=3,v=function(l,d,o){var h={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(s){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),d.forEach(function(s){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[h]},m=function(l,d,o,h){switch(l){case z.KeySystems.WIDEVINE:return v(d,o,h);default:throw new Error("Unknown key-system: "+l)}},p=function(){function u(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var l=u.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(o){switch(o){case z.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},l._attemptKeySystemAccess=function(o,h,s){var a=this,A=m(o,h,s,this._drmSystemOptions);U.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(o,A);this.mediaKeysPromise=E.then(function(T){return a._onMediaKeySystemAccessObtained(o,T)}),E.catch(function(T){U.logger.error('Failed to obtain key-system "'+o+'" access:',T)})},l._onMediaKeySystemAccessObtained=function(o,h){var s=this;U.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(E){return a.mediaKeys=E,U.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),E});return A.catch(function(E){U.logger.error("Failed to create media-keys:",E)}),A},l._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),o._onNewMediaKeySession(h.mediaKeysSession))})},l._onNewMediaKeySession=function(o){var h=this;U.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){h._onKeySessionMessage(o,s.message)},!1)},l._onKeySessionMessage=function(o,h){U.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(s){U.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},l.onMediaEncrypted=function(o){var h=this;if(U.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},l._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var h=this._mediaKeysList[0];if(!h||!h.mediaKeys){U.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}U.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(o,h){var s=this,a=this._mediaKeysList[0];if(!a){U.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){U.logger.warn("Key-Session already initialized but requested again");return}var A=a.mediaKeysSession;if(!A){U.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!h){U.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}U.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,A.generateRequest(o,h).then(function(){U.logger.debug("Key-session generation succeeded")}).catch(function(E){U.logger.error("Error generating key-session request:",E),s.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(o,h,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,h,s);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,a,o),A=void 0}catch(E){U.logger.error(E)}try{a.readyState||a.open("POST",o,!0),A&&A.call(this.hls,a,o)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return a},l._onLicenseRequestReadyStageChange=function(o,h,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,U.logger.log("License request succeeded");var A=o.response,E=this._licenseResponseCallback;if(E)try{A=E.call(this.hls,o,h)}catch(D){U.logger.error(D)}a(A)}else{if(U.logger.error("License Request XHR failed ("+h+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=R-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(s,a)}break}},l._generateLicenseRequestChallenge=function(o,h){switch(o.mediaKeySystemDomain){case z.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,h){U.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),A=this._createLicenseXhr(a,o,h);U.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,o);A.send(E)}catch(T){U.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,h){if(!this._emeEnabled)return;var s=h.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,h=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,h){if(!this._emeEnabled)return;var s=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),a=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(z.KeySystems.WIDEVINE,s,a)},n(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();$.default=p},"./src/controller/fps-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=function(){function z(n){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=n,this.registerListeners()}var G=z.prototype;return G.setStreamController=function(R){this.streamController=R},G.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(R,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},G.checkFPS=function(R,v,m){var p=performance.now();if(v){if(this.lastTime){var u=p-this.lastTime,l=m-this.lastDroppedFrames,d=v-this.lastDecodedFrames,o=1e3*l/u,h=this.hls;if(h.trigger(Y.Events.FPS_DROP,{currentDropped:l,currentDecoded:d,totalDroppedFrames:m}),o>0&&l>h.config.fpsDroppedMonitoringThreshold*d){var s=h.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=s)&&(s=s-1,h.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:h.currentLevel}),h.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},G.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var v=R.getVideoPlaybackQuality();this.checkFPS(R,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},z}();$.default=U},"./src/controller/fragment-finders.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFragmentByPDT",function(){return U}),P.d($,"findFragmentByPTS",function(){return z}),P.d($,"fragmentWithinToleranceTest",function(){return G}),P.d($,"pdtWithinToleranceTest",function(){return n}),P.d($,"findFragWithCC",function(){return R});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function U(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(Y.isFiniteNumber)(m))return null;var u=v[0].programDateTime;if(m<(u||0))return null;var l=v[v.length-1].endProgramDateTime;if(m>=(l||0))return null;p=p||0;for(var d=0;d<v.length;++d){var o=v[d];if(n(m,p,o))return o}return null}function z(v,m,p,u){p===void 0&&(p=0),u===void 0&&(u=0);var l=null;if(v?l=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(l=m[0]),l&&G(p,u,l)===0)return l;var d=j.default.search(m,G.bind(null,p,u));return d||l}function G(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var u=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-u<=v?1:p.start-u>v&&p.start?-1:0}function n(v,m,p){var u=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,l=p.endProgramDateTime||0;return l-u>v}function R(v,m){return j.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,$,P){"use strict";P.r($),P.d($,"FragmentState",function(){return U}),P.d($,"FragmentTracker",function(){return z});var Y=P("./src/events.ts"),j=P("./src/types/loader.ts"),U;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(U||(U={}));var z=function(){function R(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var v=R.prototype;return v._registerListeners=function(){var p=this.hls;p.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,u){if(u===j.PlaylistLevelType.MAIN){var l=this.activeFragment,d=this.activeParts;if(!l)return null;if(d)for(var o=d.length;o--;){var h=d[o],s=h?h.end:l.appendedPTS;if(h.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=d.slice(o-9)),h}else if(l.start<=p&&l.appendedPTS!==void 0&&p<=l.appendedPTS)return l}return this.getBufferedFrag(p,u)},v.getBufferedFrag=function(p,u){for(var l=this.fragments,d=Object.keys(l),o=d.length;o--;){var h=l[d[o]];if((h==null?void 0:h.body.type)===u&&h.buffered){var s=h.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,u,l){var d=this;Object.keys(this.fragments).forEach(function(o){var h=d.fragments[o];if(!h)return;if(!h.buffered){h.body.type===l&&d.removeFragment(h.body);return}var s=h.range[p];if(!s)return;s.time.some(function(a){var A=!d.isTimeBuffered(a.startPTS,a.endPTS,u);return A&&d.removeFragment(h.body),A})})},v.detectPartialFragments=function(p){var u=this,l=this.timeRanges,d=p.frag,o=p.part;if(!l||d.sn==="initSegment")return;var h=n(d),s=this.fragments[h];if(!s)return;Object.keys(l).forEach(function(a){var A=d.elementaryStreams[a];if(!A)return;var E=l[a],T=o!==null||A.partial===!0;s.range[a]=u.getBufferedTimes(d,o,T,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var u=n(p),l=this.fragments[u];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},v.getBufferedTimes=function(p,u,l,d){for(var o={time:[],partial:l},h=u?u.start:p.start,s=u?u.end:p.end,a=p.minEndPTS||s,A=p.maxStartPTS||h,E=0;E<d.length;E++){var T=d.start(E)-this.bufferPadding,D=d.end(E)+this.bufferPadding;if(A>=T&&a<=D){o.time.push({startPTS:Math.max(h,d.start(E)),endPTS:Math.min(s,d.end(E))});break}else if(h<D&&s>T)o.partial=!0,o.time.push({startPTS:Math.max(h,d.start(E)),endPTS:Math.min(s,d.end(E))});else if(s<=T)break}return o},v.getPartialFragment=function(p){var u=null,l,d,o,h=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(A){var E=a[A];if(!E)return;G(E)&&(d=E.body.start-s,o=E.body.end+s,p>=d&&p<=o&&(l=Math.min(p-d,o-p),h<=l&&(u=E.body,h=l)))}),u},v.getState=function(p){var u=n(p),l=this.fragments[u];return l?l.buffered?G(l)?U.PARTIAL:U.OK:l.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},v.backtrack=function(p,u){var l=n(p),d=this.fragments[l];if(!d||d.backtrack)return null;var o=d.backtrack=u||d.loaded;return d.loaded=null,o},v.getBacktrackData=function(p){var u=n(p),l=this.fragments[u];if(l){var d,o=l.backtrack;if(o!=null&&(d=o.payload)!==null&&d!==void 0&&d.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,u,l){for(var d,o,h=0;h<l.length;h++){if(d=l.start(h)-this.bufferPadding,o=l.end(h)+this.bufferPadding,p>=d&&u<=o)return!0;if(u<=d)return!1}return!1},v.onFragLoaded=function(p,u){var l=u.frag,d=u.part;if(l.sn==="initSegment"||l.bitrateTest||d)return;var o=n(l);this.fragments[o]={body:l,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,u){var l=this,d=u.frag,o=u.part,h=u.timeRanges;if(d.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=d,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(a){var A=h[a];if(l.detectEvictedFragments(a,A),!o)for(var E=0;E<A.length;E++)d.appendedPTS=Math.max(A.end(E),d.appendedPTS||0)})},v.onFragBuffered=function(p,u){this.detectPartialFragments(u)},v.hasFragment=function(p){var u=n(p);return!!this.fragments[u]},v.removeFragmentsInRange=function(p,u,l){var d=this;Object.keys(this.fragments).forEach(function(o){var h=d.fragments[o];if(!h)return;if(h.buffered){var s=h.body;s.type===l&&s.start<u&&s.end>p&&d.removeFragment(s)}})},v.removeFragment=function(p){var u=n(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[u]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function G(R){var v,m;return R.buffered&&(((v=R.range.video)===null||v===void 0?void 0:v.partial)||((m=R.range.audio)===null||m===void 0?void 0:m.partial))}function n(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"STALL_MINIMUM_DURATION_MS",function(){return G}),P.d($,"MAX_START_GAP_JUMP",function(){return n}),P.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),P.d($,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d($,"default",function(){return m});var Y=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts"),z=P("./src/utils/logger.ts"),G=250,n=2,R=.1,v=.05,m=function(){function p(l,d,o,h){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=l,this.media=d,this.fragmentTracker=o,this.hls=h}var u=p.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(d){var o=this.config,h=this.media,s=this.stalled,a=h.currentTime,A=h.seeking,E=this.seeking&&!A,T=!this.seeking&&A;if(this.seeking=A,a!==d){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;z.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||E)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!Y.BufferHelper.getBuffered(h).length)return;var L=Y.BufferHelper.bufferInfo(h,a,0),w=L.len>0,O=L.nextStart||0;if(!w&&!O)return;if(A){var S=L.len>n,f=!O||O-a>n&&!this.fragmentTracker.getPartialFragment(a);if(S||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,y=Math.max(O,L.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=b==null||((C=b.details)===null||C===void 0)?void 0:C.live,F=B?b.details.targetduration*2:n;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(s===null){this.stalled=x;return}var N=x-s;!A&&N>=G&&this._reportStall(L.len);var I=Y.BufferHelper.bufferInfo(h,a,o.maxBufferHole);this._tryFixBufferStall(I,N)},u._tryFixBufferStall=function(d,o){var h=this.config,s=this.fragmentTracker,a=this.media,A=a.currentTime,E=s.getPartialFragment(A);if(E){var T=this._trySkipBufferHole(E);if(T)return}d.len>h.maxBufferHole&&o>h.highBufferWatchdogPeriod*1e3&&(z.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(d){var o=this.hls,h=this.media,s=this.stallReported;s||(this.stallReported=!0,z.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+d+")"),o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},u._trySkipBufferHole=function(d){for(var o=this.config,h=this.hls,s=this.media,a=s.currentTime,A=0,E=Y.BufferHelper.getBuffered(s),T=0;T<E.length;T++){var D=E.start(T);if(a+o.maxBufferHole>=A&&a<D){var L=Math.max(D+v,s.currentTime+R);return z.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+L),this.moved=!0,this.stalled=null,s.currentTime=L,d&&h.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+L,frag:d}),L}A=E.end(T)}return 0},u._tryNudgeBuffer=function(){var d=this.config,o=this.hls,h=this.media,s=h.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<d.nudgeMaxRetry){var A=s+a*d.nudgeOffset;z.logger.warn("Nudging 'currentTime' from "+s+" to "+A),h.currentTime=A,o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else z.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+d.nudgeMaxRetry+" nudges"),o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/demux/id3.ts"),z=.25,G=function(){function n(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var R=n.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var m=this.hls;m.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var m=this.hls;m.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(m,p){this.media=p.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var u=m[p];if(u.kind==="metadata"&&u.label==="id3")return Object(j.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(m,p){if(!this.media)return;var u=p.frag,l=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<l.length;o++){var h=U.getID3Frames(l[o].data);if(h){var s=l[o].pts,a=o<l.length-1?l[o+1].pts:u.end,A=a-s;A<=0&&(a=s+z);for(var E=0;E<h.length;E++){var T=h[E];if(!U.isTimeStampFrame(T)){var D=new d(s,a,"");D.value=T,this.id3Track.addCue(D)}}}}},R.onBufferFlushing=function(m,p){var u=p.startOffset,l=p.endOffset,d=p.type;if(!d||d==="audio"){var o=this.id3Track;o&&Object(j.removeCuesInRange)(o,u,l)}},n}();$.default=G},"./src/controller/latency-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var Y=P("./src/errors.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts");function z(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function G(R,v,m){return v&&z(R.prototype,v),m&&z(R,m),R}var n=function(){function R(m){var p=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=R.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.Events.ERROR,this.onError)},v.onMediaAttached=function(p,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,u){var l=u.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,u){if(u.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,U.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,u=this.levelDetails;if(!p||!u)return;this.currentTime=p.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var d=this.config,o=d.lowLatencyMode,h=d.maxLiveSyncPlaybackRate;if(!o||h===1)return;var s=this.targetLatency;if(s===null)return;var a=l-s,A=Math.min(this.maxLatency,s+u.targetduration),E=a<A;if(u.live&&E&&a>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,h)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(T,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},G(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,u=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:u?p.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var u=p.holdBack,l=p.partHoldBack,d=p.targetduration,o=this.config,h=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,A=this.hls.userConfig,E=a&&l||u;(A.liveSyncDuration||A.liveSyncDurationCount||E===0)&&(E=h!==void 0?h:s*d);var T=d,D=1;return E+Math.min(this.stallCount*D,T)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),u=this.targetLatency,l=this.levelDetails;if(p===null||u===null||l===null)return null;var d=l.edge,o=p-u-this.edgeStalled,h=d-l.totalduration,s=d-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(h,o),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var u=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-u,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,u=this.levelDetails;if(!p||!u)return 0;var l=p.buffered.length;return l?p.buffered.end(l-1):u.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return o});var Y=P("./src/types/level.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/codecs.ts"),G=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),R=P("./src/types/loader.ts");function v(){return v=Object.assign||function(h){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var A in a)Object.prototype.hasOwnProperty.call(a,A)&&(h[A]=a[A])}return h},v.apply(this,arguments)}function m(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function p(h,s,a){return s&&m(h.prototype,s),a&&m(h,a),h}function u(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,l(h,s)}function l(h,s){return l=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},l(h,s)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(h){u(s,h);function s(A){var E;return E=h.call(this,A,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var a=s.prototype;return a._registerListeners=function(){var E=this.hls;E.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(j.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var E=this.hls;E.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(j.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},a.startLoad=function(){var E=this._levels;E.forEach(function(T){T.loadError=0}),h.prototype.startLoad.call(this)},a.onManifestLoaded=function(E,T){var D=[],L=[],w=[],O,S={},f,C=!1,y=!1,b=!1;if(T.levels.forEach(function(N){var I=N.attrs;C=C||!!(N.width&&N.height),y=y||!!N.videoCodec,b=b||!!N.audioCodec,d&&N.audioCodec&&N.audioCodec.indexOf("mp4a.40.34")!==-1&&(N.audioCodec=void 0);var g=N.bitrate+"-"+N.attrs.RESOLUTION+"-"+N.attrs.CODECS;f=S[g],f?f.url.push(N.url):(f=new Y.Level(N),S[g]=f,D.push(f)),I&&(I.AUDIO&&Object(G.addGroupId)(f,"audio",I.AUDIO),I.SUBTITLES&&Object(G.addGroupId)(f,"text",I.SUBTITLES))}),(C||y)&&b&&(D=D.filter(function(N){var I=N.videoCodec,g=N.width,W=N.height;return!!I||!!(g&&W)})),D=D.filter(function(N){var I=N.audioCodec,g=N.videoCodec;return(!I||Object(z.isCodecSupportedInMp4)(I,"audio"))&&(!g||Object(z.isCodecSupportedInMp4)(g,"video"))}),T.audioTracks&&(L=T.audioTracks.filter(function(N){return!N.audioCodec||Object(z.isCodecSupportedInMp4)(N.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(L)),T.subtitles&&(w=T.subtitles,Object(G.assignTrackIdsByGroup)(w)),D.length>0){O=D[0].bitrate,D.sort(function(N,I){return N.bitrate-I.bitrate}),this._levels=D;for(var B=0;B<D.length;B++)if(D[B].bitrate===O){this._firstLevel=B,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+O);break}var F=b&&!y,x={levels:D,audioTracks:L,subtitleTracks:w,firstLevel:this._firstLevel,stats:T.stats,audio:b,video:y,altAudio:!F&&L.some(function(N){return!!N.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(E,T){if(h.prototype.onError.call(this,E,T),T.fatal)return;var D=T.context,L=this._levels[this.currentLevelIndex];if(D&&(D.type===R.PlaylistContextType.AUDIO_TRACK&&L.audioGroupIds&&D.groupId===L.audioGroupIds[L.urlId]||D.type===R.PlaylistContextType.SUBTITLE_TRACK&&L.textGroupIds&&D.groupId===L.textGroupIds[L.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,O=!0,S;switch(T.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:case U.ErrorDetails.KEY_LOAD_ERROR:case U.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var f=this._levels[T.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(S=T.frag.level)):S=T.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(O=!1),S=D.level),w=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:S=T.level,w=!0;break}S!==void 0&&this.recoverLevel(T,S,w,O)},a.recoverLevel=function(E,T,D,L){var w=E.details,O=this._levels[T];if(O.loadError++,D){var S=this.retryLoadingOrFail(E);if(S)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(L){var f=O.url.length;if(f>1&&O.loadError<f)E.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var C=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(w+": switch to "+C),E.levelRetry=!0,this.hls.nextAutoLevel=C)}}},a.redundantFailover=function(E){var T=this._levels[E],D=T.url.length;if(D>1){var L=(T.urlId+1)%D;this.warn("Switching to redundant URL-id "+L),this._levels.forEach(function(w){w.urlId=L}),this.level=E}},a.onFragLoaded=function(E,T){var D=T.frag;if(D!==void 0&&D.type===R.PlaylistLevelType.MAIN){var L=this._levels[D.level];L!==void 0&&(L.fragmentError=0,L.loadError=0)}},a.onLevelLoaded=function(E,T){var D,L=T.level,w=T.details,O=this._levels[L];if(!O){var S;this.warn("Invalid level index "+L),(S=T.deliveryDirectives)!==null&&S!==void 0&&S.skip&&(w.deltaUpdateFailed=!0);return}L===this.currentLevelIndex?(O.fragmentError===0&&(O.loadError=0,this.retryCount=0),this.playlistLoaded(L,T,O.details)):(D=T.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(w.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,T){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var L=-1,w=this.hls.audioTracks[T.id].groupId,O=0;O<D.audioGroupIds.length;O++)if(D.audioGroupIds[O]===w){L=O;break}L!==D.urlId&&(D.urlId=L,this.startLoad())}},a.loadPlaylist=function(E){var T=this.currentLevelIndex,D=this._levels[T];if(this.canLoad&&D&&D.url.length>0){var L=D.urlId,w=D.url[L];if(E)try{w=E.addDirectives(w)}catch(O){this.warn("Could not construct new URL with HLS Delivery Directives: "+O)}this.log("Attempt loading level index "+T+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+L+" "+w),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:w,level:T,id:L,deliveryDirectives:E||null})}},a.removeLevel=function(E,T){var D=function(O,S){return S!==T},L=this._levels.filter(function(w,O){return O!==E?!0:w.url.length>1&&T!==void 0?(w.url=w.url.filter(D),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(D)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(D)),w.urlId=0,!0):!1}).map(function(w,O){var S=w.details;return S!=null&&S.fragments&&S.fragments.forEach(function(f){f.level=O}),w});this._levels=L,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:L})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var T,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===E&&(T=D[E])!==null&&T!==void 0&&T.details)return;if(E<0||E>=D.length){var L=E<0;if(this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:L,reason:"invalid level idx"}),L)return;E=Math.min(E,D.length-1)}this.clearTimer();var w=this.currentLevelIndex,O=D[w],S=D[E];this.log("switching to level "+E+" from "+w),this.currentLevelIndex=E;var f=v({},S,{level:E,maxBitrate:S.maxBitrate,uri:S.uri,urlId:S.urlId});delete f._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,f);var C=S.details;if(!C||C.live){var y=this.switchParams(S.uri,O==null?void 0:O.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"addGroupId",function(){return U}),P.d($,"assignTrackIdsByGroup",function(){return z}),P.d($,"updatePTS",function(){return G}),P.d($,"updateFragPTSDTS",function(){return R}),P.d($,"mergeDetails",function(){return v}),P.d($,"mapPartIntersection",function(){return m}),P.d($,"mapFragmentIntersection",function(){return p}),P.d($,"adjustSliding",function(){return u}),P.d($,"addSliding",function(){return l}),P.d($,"computeReloadInterval",function(){return d}),P.d($,"getFragmentWithSN",function(){return o}),P.d($,"getPartWith",function(){return h});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function U(s,a,A){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(A);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(A);break}}function z(s){var a={};s.forEach(function(A){var E=A.groupId||"";A.id=a[E]=a[E]||0,a[E]++})}function G(s,a,A){var E=s[a],T=s[A];n(E,T)}function n(s,a){var A=a.startPTS;if(Object(Y.isFiniteNumber)(A)){var E=0,T;a.sn>s.sn?(E=A-s.start,T=s):(E=s.start-A,T=a),T.duration!==E&&(T.duration=E)}else if(a.sn>s.sn){var D=s.cc===a.cc;D&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function R(s,a,A,E,T,D){var L=E-A;L<=0&&(j.logger.warn("Fragment should have a positive duration",a),E=A+a.duration,D=T+a.duration);var w=A,O=E,S=a.startPTS,f=a.endPTS;if(Object(Y.isFiniteNumber)(S)){var C=Math.abs(S-A);Object(Y.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(C,a.deltaPTS):a.deltaPTS=C,w=Math.max(A,S),A=Math.min(A,S),T=Math.min(T,a.startDTS),O=Math.min(E,f),E=Math.max(E,f),D=Math.max(D,a.endDTS)}a.duration=E-A;var y=A-a.start;a.appendedPTS=E,a.start=a.startPTS=A,a.maxStartPTS=w,a.startDTS=T,a.endPTS=E,a.minEndPTS=O,a.endDTS=D;var b=a.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var B,F=b-s.startSN,x=s.fragments;for(x[F]=a,B=F;B>0;B--)n(x[B],x[B-1]);for(B=F;B<x.length-1;B++)n(x[B],x[B+1]);return s.fragmentHint&&n(x[x.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var A=null,E=s.fragments,T=E.length-1;T>=0;T--){var D=E[T].initSegment;if(D){A=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var L=0,w;if(p(s,a,function(B,F){B.relurl&&(L=B.cc-F.cc),Object(Y.isFiniteNumber)(B.startPTS)&&Object(Y.isFiniteNumber)(B.endPTS)&&(F.start=F.startPTS=B.startPTS,F.startDTS=B.startDTS,F.appendedPTS=B.appendedPTS,F.maxStartPTS=B.maxStartPTS,F.endPTS=B.endPTS,F.endDTS=B.endDTS,F.minEndPTS=B.minEndPTS,F.duration=B.endPTS-B.startPTS,F.duration&&(w=F),a.PTSKnown=a.alignedSliding=!0),F.elementaryStreams=B.elementaryStreams,F.loader=B.loader,F.stats=B.stats,F.urlId=B.urlId,B.initSegment&&(F.initSegment=B.initSegment,A=B.initSegment)}),A){var O=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;O.forEach(function(B){var F;(!B.initSegment||B.initSegment.relurl===((F=A)===null||F===void 0?void 0:F.relurl))&&(B.initSegment=A)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(B){return!B}),a.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var S=a.skippedSegments;S--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var f=a.fragments;if(L){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<f.length;C++)f[C].cc+=L}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(B,F){F.elementaryStreams=B.elementaryStreams,F.stats=B.stats}),w?R(a,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):u(s,a),f.length&&(a.totalduration=a.edge-f[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var b=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=b),a.driftEndTime=y,a.driftEnd=b}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,A){if(s&&a)for(var E=0,T=0,D=s.length;T<=D;T++){var L=s[T],w=a[T+E];L&&w&&L.index===w.index&&L.fragment.sn===w.fragment.sn?A(L,w):E--}}function p(s,a,A){for(var E=a.skippedSegments,T=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(E?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,L=a.startSN-s.startSN,w=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,O=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,S=T;S<=D;S++){var f=O[L+S],C=w[S];E&&!C&&S<E&&(C=a.fragments[S]=f),f&&C&&A(f,C)}}function u(s,a){var A=a.startSN+a.skippedSegments-s.startSN,E=s.fragments;if(A<0||A>=E.length)return;l(a,E[A].start)}function l(s,a){if(a){for(var A=s.fragments,E=s.skippedSegments;E<A.length;E++)A[E].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function d(s,a){var A=1e3*s.levelTargetDuration,E=A/2,T=s.age,D=T>0&&T<A*3,L=a.loading.end-a.loading.start,w,O=s.availabilityDelay;if(s.updated===!1)if(D){var S=333*s.misses;w=Math.max(Math.min(E,L*2),S),s.availabilityDelay=(s.availabilityDelay||0)+w}else w=E;else D?(O=Math.min(O||A/2,T),s.availabilityDelay=O,w=O+A-T):w=A-L;return Math.round(w)}function o(s,a,A){if(!s||!s.details)return null;var E=s.details,T=E.fragments[a-E.startSN];return T||(T=E.fragmentHint,T&&T.sn===a?T:a<E.startSN&&A&&A.sn===a?A:null)}function h(s,a,A){if(!s||!s.details)return null;var E=s.details.partList;if(E)for(var T=E.length;T--;){var D=E[T];if(D.index===A&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return E});var Y=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),U=P("./src/is-supported.ts"),z=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),R=P("./src/types/loader.ts"),v=P("./src/loader/fragment.ts"),m=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),u=P("./src/controller/gap-controller.ts"),l=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function o(T,D){for(var L=0;L<D.length;L++){var w=D[L];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function h(T,D,L){return D&&o(T.prototype,D),L&&o(T,L),T}function s(T,D){T.prototype=Object.create(D.prototype),T.prototype.constructor=T,a(T,D)}function a(T,D){return a=Object.setPrototypeOf||function(w,O){return w.__proto__=O,w},a(T,D)}var A=100,E=function(T){s(D,T);function D(w,O){var S;return S=T.call(this,w,O,"[stream-controller]")||this,S.audioCodecSwap=!1,S.gapController=null,S.level=-1,S._forceStartLoad=!1,S.altAudio=!1,S.audioOnly=!1,S.fragPlaying=null,S.onvplaying=null,S.onvseeked=null,S.fragLastKbps=0,S.stalled=!1,S.couldBacktrack=!1,S.audioCodecSwitch=!1,S.videoBuffer=null,S._registerListeners(),S}var L=D.prototype;return L._registerListeners=function(){var O=this.hls;O.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),O.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),O.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),O.on(z.Events.ERROR,this.onError,this),O.on(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),O.on(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),O.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this),O.on(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),O.on(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),O.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L._unregisterListeners=function(){var O=this.hls;O.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),O.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),O.off(z.Events.ERROR,this.onError,this),O.off(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),O.off(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),O.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),O.off(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),O.off(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),O.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},L.startLoad=function(O){if(this.levels){var S=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}S>0&&O===-1&&(this.log("Override startPosition with lastCurrentTime @"+S.toFixed(3)),O=S),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=O,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},L.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},L.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var O,S=this.levels,f=this.level,C=S==null||((O=S[f])===null||O===void 0)?void 0:O.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),B=this.retryDate;(!B||b>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},L.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},L.doTickIdle=function(){var O,S,f=this.hls,C=this.levelLastLoaded,y=this.levels,b=this.media,B=f.config,F=f.nextLoadLevel;if(C===null||!b&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var x=y[F];this.level=f.nextLoadLevel=F;var N=x.details;if(!N||this.state===j.State.WAITING_LEVEL||N.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,W=this.getMaxBufferLength(x.maxBitrate);if(g>=W)return;if(this._streamEnded(I,N)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(z.Events.BUFFER_EOS,J),this.state=j.State.ENDED;return}var ie=I.end,ue=this.getNextFragment(ie,N);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Re=ue.sn-N.startSN;Re>1&&(ue=N.fragments[Re-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===n.FragmentState.OK&&this.nextLoadPosition>ie){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ve,R.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,N)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((O=ue.decryptdata)===null||O===void 0?void 0:O.keyFormat)==="identity"&&!((S=ue.decryptdata)!==null&&S!==void 0&&S.key)?this.loadKey(ue,N):this.loadFragment(ue,N,ie)},L.loadFragment=function(O,S,f){var C,y=this.fragmentTracker.getState(O);if(this.fragCurrent=O,y===n.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(O);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=n.FragmentState.NOT_LOADED}y===n.FragmentState.NOT_LOADED||y===n.FragmentState.PARTIAL?O.sn==="initSegment"?this._loadInitSegment(O):this.bitrateTest?(O.bitrateTest=!0,this.log("Fragment "+O.sn+" of level "+O.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(O)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,O,S,f)):y===n.FragmentState.APPENDING?this.reduceMaxBufferLength(O.duration)&&this.fragmentTracker.removeFragment(O):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},L.getAppendedFrag=function(O){var S=this.fragmentTracker.getAppendedFrag(O,R.PlaylistLevelType.MAIN);return S&&"fragment"in S?S.fragment:S},L.getBufferedFrag=function(O){return this.fragmentTracker.getBufferedFrag(O,R.PlaylistLevelType.MAIN)},L.followingBufferedFrag=function(O){return O?this.getBufferedFrag(O.end+.5):null},L.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},L.nextLevelSwitch=function(){var O=this.levels,S=this.media;if(S!=null&&S.readyState){var f,C=this.getAppendedFrag(S.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!S.paused&&O){var y=this.hls.nextLoadLevel,b=O[y],B=this.fragLastKbps;B&&this.fragCurrent?f=this.fragCurrent.duration*b.maxBitrate/(1e3*B)+1:f=0}else f=0;var F=this.getBufferedFrag(S.currentTime+f);if(F){var x=this.followingBufferedFrag(F);if(x){this.abortCurrentFrag();var N=x.maxStartPTS?x.maxStartPTS:x.start,I=x.duration,g=Math.max(F.end,N+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},L.abortCurrentFrag=function(){var O=this.fragCurrent;this.fragCurrent=null,O!=null&&O.loader&&O.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},L.flushMainBuffer=function(O,S){T.prototype.flushMainBuffer.call(this,O,S,this.altAudio?"video":null)},L.onMediaAttached=function(O,S){T.prototype.onMediaAttached.call(this,O,S);var f=S.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,f,this.fragmentTracker,this.hls)},L.onMediaDetaching=function(){var O=this.media;O&&(O.removeEventListener("playing",this.onvplaying),O.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},L.onMediaPlaying=function(){this.tick()},L.onMediaSeeked=function(){var O=this.media,S=O?O.currentTime:null;Object(Y.isFiniteNumber)(S)&&this.log("Media seeked to "+S.toFixed(3)),this.tick()},L.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(z.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},L.onManifestParsed=function(O,S){var f=!1,C=!1,y;S.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(f=!0),y.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=S.levels,this.startFragRequested=!1},L.onLevelLoading=function(O,S){var f=this.levels;if(!f||this.state!==j.State.IDLE)return;var C=f[S.level];(!C.details||C.details.live&&this.levelLastLoaded!==S.level||this.waitForCdnTuneIn(C.details))&&(this.state=j.State.WAITING_LEVEL)},L.onLevelLoaded=function(O,S){var f,C=this.levels,y=S.level,b=S.details,B=b.totalduration;if(!C){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+B);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==S.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var x=C[y],N=0;if(b.live||(f=x.details)!==null&&f!==void 0&&f.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;N=this.alignPlaylists(b,x.details)}if(x.details=b,this.levelLastLoaded=y,this.hls.trigger(z.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,N),this.tick()},L._handleFragmentLoadProgress=function(O){var S,f=O.frag,C=O.part,y=O.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var B=b[f.level],F=B.details;if(!F){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var x=B.videoCodec,N=F.PTSKnown||!F.live,I=(S=f.initSegment)===null||S===void 0?void 0:S.data,g=this._getAudioCodec(B),W=this.transmuxer=this.transmuxer||new m.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=C?C.index:-1,ie=J!==-1,ue=new p.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,y.byteLength,J,ie),Re=this.initPTS[f.cc];W.push(y,I,g,x,f,C,F.totalduration,N,ue,Re)},L.onAudioTrackSwitching=function(O,S){var f=this.altAudio,C=!!S.url,y=S.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;f&&B.trigger(z.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(z.Events.AUDIO_TRACK_SWITCHED,{id:y})}},L.onAudioTrackSwitched=function(O,S){var f=S.id,C=!!this.hls.audioTracks[f].url;if(C){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=C,this.tick()},L.onBufferCreated=function(O,S){var f=S.tracks,C,y,b=!1;for(var B in f){var F=f[B];if(F.id==="main"){if(y=B,C=F,B==="video"){var x=f[B];x&&(this.videoBuffer=x.buffer)}}else b=!0}b&&C?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},L.onFragBuffered=function(O,S){var f=S.frag,C=S.part;if(f&&f.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},L.onError=function(O,S){switch(S.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,S);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(S.fatal?(this.warn(""+S.details),this.state=j.State.ERROR):!S.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(S.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},L.checkBuffer=function(){var O=this.media,S=this.gapController;if(!O||!S||!O.readyState)return;var f=G.BufferHelper.getBuffered(O);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):S.poll(this.lastCurrentTime),this.lastCurrentTime=O.currentTime},L.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},L.onBufferFlushed=function(O,S){var f=S.type;if(f!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,R.PlaylistLevelType.MAIN)}},L.onLevelsUpdated=function(O,S){this.levels=S.levels},L.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},L.seekToStartPos=function(){var O=this.media,S=O.currentTime,f=this.startPosition;if(f>=0&&S<f){if(O.seeking){d.logger.log("could not seek to "+f+", already seeking at "+S);return}var C=G.BufferHelper.getBuffered(O),y=C.length?C.start(0):0,b=y-f;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+b+" to match buffer start"),f+=b,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+S),O.currentTime=f}},L._getAudioCodec=function(O){var S=this.config.defaultAudioCodec||O.audioCodec;return this.audioCodecSwap&&S&&(this.log("Swapping audio codec"),S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),S},L._loadBitrateTestFrag=function(O){var S=this;this._doFragLoad(O).then(function(f){var C=S.hls;if(!f||C.nextLoadLevel||S.fragContextChanged(O))return;S.fragLoadError=0,S.state=j.State.IDLE,S.startFragRequested=!1,S.bitrateTest=!1;var y=O.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),C.trigger(z.Events.FRAG_LOADED,f)})},L._handleTransmuxComplete=function(O){var S,f="main",C=this.hls,y=O.remuxResult,b=O.chunkMeta,B=this.getCurrentContext(b);if(!B){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var F=B.frag,x=B.part,N=B.level,I=y.video,g=y.text,W=y.id3,J=y.initSegment,ie=this.altAudio?void 0:y.audio;if(this.fragContextChanged(F))return;if(this.state=j.State.PARSING,J){J.tracks&&(this._bufferInitSegment(N,J.tracks,F,b),C.trigger(z.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:f,tracks:J.tracks}));var ue=J.initPTS,Re=J.timescale;Object(Y.isFiniteNumber)(ue)&&(this.initPTS[F.cc]=ue,C.trigger(z.Events.INIT_PTS_FOUND,{frag:F,id:f,initPTS:ue,timescale:Re}))}if(I&&y.independent!==!1){if(N.details){var ve=I.startPTS,Se=I.endPTS,Le=I.startDTS,be=I.endDTS;if(x)x.elementaryStreams[I.type]={startPTS:ve,endPTS:Se,startDTS:Le,endDTS:be};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var ce=this.getLoadPosition()+this.config.maxBufferHole;if(ce<ve){this.backtrack(F);return}F.setElementaryStreamInfo(I.type,F.start,Se,F.start,be,!0)}F.setElementaryStreamInfo(I.type,ve,Se,Le,be),this.bufferFragmentData(I,F,x,b)}}else if(y.independent===!1){this.backtrack(F);return}if(ie){var he=ie.startPTS,ne=ie.endPTS,de=ie.startDTS,se=ie.endDTS;x&&(x.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:ne,startDTS:de,endDTS:se}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,he,ne,de,se),this.bufferFragmentData(ie,F,x,b)}if(W!=null&&(S=W.samples)!==null&&S!==void 0&&S.length){var De={frag:F,id:f,samples:W.samples};C.trigger(z.Events.FRAG_PARSING_METADATA,De)}if(g){var Ne={frag:F,id:f,samples:g.samples};C.trigger(z.Events.FRAG_PARSING_USERDATA,Ne)}},L._bufferInitSegment=function(O,S,f,C){var y=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!S.audio&&!S.video,this.altAudio&&!this.audioOnly&&delete S.audio;var b=S.audio,B=S.video,F=S.audiovideo;if(b){var x=O.audioCodec,N=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),b.metadata.channelCount!==1&&N.indexOf("firefox")===-1&&(x="mp4a.40.5")),N.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),O.audioCodec&&O.audioCodec!==x&&this.log('Swapping manifest audio codec "'+O.audioCodec+'" for "'+x+'"'),b.levelCodec=x,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(O.audioCodec||"")+"/"+b.codec+"]")}B&&(B.levelCodec=O.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(O.videoCodec||"")+"/"+B.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(O.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(z.Events.BUFFER_CODECS,S),Object.keys(S).forEach(function(I){var g=S[I],W=g.initSegment;W!=null&&W.byteLength&&y.hls.trigger(z.Events.BUFFER_APPENDING,{type:I,data:W,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},L.backtrack=function(O){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(O);var S=this.fragmentTracker.backtrack(O);this.fragPrevious=null,this.nextLoadPosition=O.start,S?this.resetFragmentLoading(O):this.state=j.State.BACKTRACKING},L.checkFragmentChanged=function(){var O=this.media,S=null;if(O&&O.readyState>1&&O.seeking===!1){var f=O.currentTime;if(G.BufferHelper.isBuffered(O,f)?S=this.getAppendedFrag(f):G.BufferHelper.isBuffered(O,f+.1)&&(S=this.getAppendedFrag(f+.1)),S){var C=this.fragPlaying,y=S.level;(!C||S.sn!==C.sn||C.level!==y||S.urlId!==C.urlId)&&(this.hls.trigger(z.Events.FRAG_CHANGED,{frag:S}),(!C||C.level!==y)&&this.hls.trigger(z.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=S)}}},h(D,[{key:"nextLevel",get:function(){var O=this.nextBufferedFrag;return O?O.level:-1}},{key:"currentLevel",get:function(){var O=this.media;if(O){var S=this.getAppendedFrag(O.currentTime);if(S)return S.level}return-1}},{key:"nextBufferedFrag",get:function(){var O=this.media;if(O){var S=this.getAppendedFrag(O.currentTime);return this.followingBufferedFrag(S)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"SubtitleStreamController",function(){return s});var Y=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/buffer-helper.ts"),z=P("./src/controller/fragment-finders.ts"),G=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),R=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function u(a,A){for(var E=0;E<A.length;E++){var T=A[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function l(a,A,E){return A&&u(a.prototype,A),E&&u(a,E),a}function d(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,o(a,A)}function o(a,A){return o=Object.setPrototypeOf||function(T,D){return T.__proto__=D,T},o(a,A)}var h=500,s=function(a){d(A,a);function A(T,D){var L;return L=a.call(this,T,D,"[subtitle-stream-controller]")||this,L.levels=[],L.currentTrackId=-1,L.tracksBuffered=[],L.mainDetails=null,L._registerListeners(),L}var E=A.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var D=this.hls;D.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(Y.Events.ERROR,this.onError,this),D.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var D=this.hls;D.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(Y.Events.ERROR,this.onError,this),D.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(h),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(D,L){this.mainDetails=L.details},E.onSubtitleFragProcessed=function(D,L){var w=L.frag,O=L.success;if(this.fragPrevious=w,this.state=v.State.IDLE,!O)return;var S=this.tracksBuffered[this.currentTrackId];if(!S)return;for(var f,C=w.start,y=0;y<S.length;y++)if(C>=S[y].start&&C<=S[y].end){f=S[y];break}var b=w.start+w.duration;f?f.end=b:(f={start:C,end:b},S.push(f)),this.fragmentTracker.fragBuffered(w)},E.onBufferFlushing=function(D,L){var w=L.startOffset,O=L.endOffset;if(w===0&&O!==Number.POSITIVE_INFINITY){var S=this.currentTrackId,f=this.levels;if(!f.length||!f[S]||!f[S].details)return;var C=f[S].details,y=C.targetduration,b=O-y;if(b<=0)return;L.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(B){for(var F=0;F<B.length;){if(B[F].end<=b){B.shift();continue}else if(B[F].start<b)B[F].start=b;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(w,b,m.PlaylistLevelType.SUBTITLE)}},E.onError=function(D,L){var w,O=L.frag;if(!O||O.type!==m.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},E.onSubtitleTracksUpdated=function(D,L){var w=this,O=L.subtitleTracks;this.tracksBuffered=[],this.levels=O.map(function(S){return new p.Level(S)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(S){w.tracksBuffered[S.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(D,L){if(this.currentTrackId=L.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(h)},E.onSubtitleTrackLoaded=function(D,L){var w,O=L.details,S=L.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var y=C[f];if(S>=C.length||S!==f||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,O.live||(w=y.details)!==null&&w!==void 0&&w.live){var b=this.mainDetails;if(O.deltaUpdateFailed||!b)return;var B=b.fragments[0];if(!y.details)O.hasProgramDateTime&&b.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(O,b):B&&Object(n.addSliding)(O,B.start);else{var F=this.alignPlaylists(O,y.details);F===0&&B&&Object(n.addSliding)(O,B.start)}}if(y.details=O,this.levelLastLoaded=S,this.tick(),O.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var x=Object(z.findFragmentByPTS)(null,O.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},E._handleFragmentLoadComplete=function(D){var L=D.frag,w=D.payload,O=L.decryptdata,S=this.hls;if(this.fragContextChanged(L))return;if(w&&w.byteLength>0&&O&&O.key&&O.iv&&O.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),O.key.buffer,O.iv.buffer).then(function(C){var y=performance.now();S.trigger(Y.Events.FRAG_DECRYPTED,{frag:L,payload:C,stats:{tstart:f,tdecrypt:y}})})}},E.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,L=this.currentTrackId,w=this.levels;if(!w.length||!w[L]||!w[L].details)return;var O=w[L].details,S=O.targetduration,f=this.config,C=this.media,y=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-S,f.maxBufferHole),b=y.end,B=y.len,F=this.getMaxBufferLength()+S;if(B>F)return;console.assert(O,"Subtitle track details are defined on idle subtitle stream controller tick");var x=O.fragments,N=x.length,I=O.edge,g,W=this.fragPrevious;if(b<I){var J=f.maxFragLookUpTolerance;W&&O.hasProgramDateTime&&(g=Object(z.findFragmentByPDT)(x,W.endProgramDateTime,J)),g||(g=Object(z.findFragmentByPTS)(W,x,b,J),!g&&W&&W.start<x[0].start&&(g=x[0]))}else g=x[N-1];(D=g)!==null&&D!==void 0&&D.encrypted?(j.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===R.FragmentState.NOT_LOADED&&this.loadFragment(g,O,b)}},E.loadFragment=function(D,L,w){this.fragCurrent=D,a.prototype.loadFragment.call(this,D,L,w)},l(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(v.default)},"./src/controller/subtitle-track-controller.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),U=P("./src/controller/base-playlist-controller.ts"),z=P("./src/types/loader.ts");function G(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function n(u,l,d){return l&&G(u.prototype,l),d&&G(u,d),u}function R(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,v(u,l)}function v(u,l){return v=Object.setPrototypeOf||function(o,h){return o.__proto__=h,o},v(u,l)}var m=function(u){R(l,u);function l(o){var h;return h=u.call(this,o,"[subtitle-track-controller]")||this,h.media=null,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.selectDefaultTrack=!0,h.queuedDefaultTrack=-1,h.trackChangeListener=function(){return h.onTextTracksChanged()},h.asyncPollTrackChange=function(){return h.pollTrackChange(0)},h.useTextTrackPolling=!1,h.subtitlePollingInterval=-1,h.subtitleDisplay=!0,h.registerListeners(),h}var d=l.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},d.registerListeners=function(){var h=this.hls;h.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on(Y.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var h=this.hls;h.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off(Y.Events.ERROR,this.onError,this)},d.onMediaAttached=function(h,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},d.pollTrackChange=function(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},d.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var h=p(this.media.textTracks);h.forEach(function(s){Object(j.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(h,s){this.tracks=s.subtitleTracks},d.onSubtitleTrackLoaded=function(h,s){var a=s.id,A=s.details,E=this.trackId,T=this.tracksInGroup[E];if(!T){this.warn("Invalid subtitle track id "+a);return}var D=T.details;T.details=s.details,this.log("subtitle track "+a+" loaded ["+A.startSN+"-"+A.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},d.onLevelLoading=function(h,s){this.switchLevel(s.level)},d.onLevelSwitching=function(h,s){this.switchLevel(s.level)},d.switchLevel=function(h){var s=this.hls.levels[h];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(L){return!a||L.groupId===a});this.tracksInGroup=E;var T=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,D),T!==-1&&this.setSubtitleTrack(T,A)}},d.findTrackId=function(h){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var A=s[a];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},d.onError=function(h,s){if(u.prototype.onError.call(this,h,s),s.fatal||!s.context)return;s.context.type===z.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},d.loadPlaylist=function(h){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,A=s.groupId,E=s.url;if(h)try{E=h.addDirectives(E)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:E,id:a,groupId:A,deliveryDirectives:h||null})}},d.toggleTrackModes=function(h){var s=this,a=this.media,A=this.subtitleDisplay,E=this.trackId;if(!a)return;var T=p(a.textTracks),D=T.filter(function(O){return O.groupId===s.groupId});if(h===-1)[].slice.call(T).forEach(function(O){O.mode="disabled"});else{var L=D[E];L&&(L.mode="disabled")}var w=D[h];w&&(w.mode=A?"showing":"hidden")},d.setSubtitleTrack=function(h,s){var a,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(a=A[h])!==null&&a!==void 0&&a.details)||h<-1||h>=A.length)return;this.clearTimer();var E=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,E){var T=E.id,D=E.groupId,L=D===void 0?"":D,w=E.name,O=E.type,S=E.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:L,name:w,type:O,url:S});var f=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(f)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:h})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,s=p(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")h=a;else if(s[a].mode==="showing"){h=a;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},n(l,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,s)}}]),l}(U.default);function p(u){for(var l=[],d=0;d<u.length;d++){var o=u[d];o.kind==="subtitles"&&o.label&&l.push(u[d])}return l}$.default=m},"./src/controller/timeline-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"TimelineController",function(){return p});var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/cea-608-parser.ts"),z=P("./src/utils/output-filter.ts"),G=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),R=P("./src/utils/imsc1-ttml-parser.ts"),v=P("./src/types/loader.ts"),m=P("./src/utils/logger.ts"),p=function(){function o(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new z.default(this,"textTrack1"),A=new z.default(this,"textTrack2"),E=new z.default(this,"textTrack3"),T=new z.default(this,"textTrack4");this.cea608Parser1=new U.default(1,a,A),this.cea608Parser2=new U.default(3,E,T)}s.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(j.Events.FRAG_LOADING,this.onFragLoading,this),s.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=o.prototype;return h.destroy=function(){var a=this.hls;a.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(j.Events.FRAG_LOADING,this.onFragLoading,this),a.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(a,A,E,T,D){for(var L=!1,w=D.length;w--;){var O=D[w],S=l(O[0],O[1],A,E);if(S>=0&&(O[0]=Math.min(O[0],A),O[1]=Math.max(O[1],E),L=!0,S/(E-A)>.5))return}if(L||D.push([A,E]),this.config.renderTextTracksNatively){var f=this.captionsTracks[a];this.Cues.newCue(f,A,E,T)}else{var C=this.Cues.newCue(null,A,E,T);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:C,track:a})}},h.onInitPtsFound=function(a,A){var E=this,T=A.frag,D=A.id,L=A.initPTS,w=A.timescale,O=this.unparsedVttFrags;D==="main"&&(this.initPTS[T.cc]=L,this.timescale[T.cc]=w),O.length&&(this.unparsedVttFrags=[],O.forEach(function(S){E.onFragLoaded(j.Events.FRAG_LOADED,S)}))},h.getExistingTrack=function(a){var A=this.media;if(A)for(var E=0;E<A.textTracks.length;E++){var T=A.textTracks[E];if(T[a])return T}return null},h.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},h.createNativeTrack=function(a){if(this.captionsTracks[a])return;var A=this.captionsProperties,E=this.captionsTracks,T=this.media,D=A[a],L=D.label,w=D.languageCode,O=this.getExistingTrack(a);if(O)E[a]=O,Object(n.clearCurrentCues)(E[a]),Object(n.sendAddTrackEvent)(E[a],T);else{var S=this.createTextTrack("captions",L,w);S&&(S[a]=!0,E[a]=S)}},h.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var A=this.captionsProperties[a];if(!A)return;var E=A.label,T={_id:a,label:E,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[a]=T,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},h.createTextTrack=function(a,A,E){var T=this.media;return T?T.addTextTrack(a,A,E):void 0},h.onMediaAttaching=function(a,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(A){Object(n.clearCurrentCues)(a[A]),delete a[A]}),this.nonNativeCaptionsTracks={}},h.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},h._cleanTracks=function(){var a=this.media;if(!a)return;var A=a.textTracks;if(A)for(var E=0;E<A.length;E++)Object(n.clearCurrentCues)(A[E])},h.onSubtitleTracksUpdated=function(a,A){var E=this;this.textTracks=[];var T=A.subtitleTracks||[],D=T.some(function(S){return S.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var L=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(S,f){var C;if(f<w.length){for(var y=null,b=0;b<w.length;b++)if(u(w[b],S)){y=w[b];break}y&&(C=y)}C?Object(n.clearCurrentCues)(C):(C=E.createTextTrack("subtitles",S.name,S.lang),C&&(C.mode="disabled")),C&&(C.groupId=S.groupId,E.textTracks.push(C))})}else if(!L&&this.tracks&&this.tracks.length){var O=this.tracks.map(function(S){return{label:S.name,kind:S.type.toLowerCase(),default:S.default,subtitleTrack:S}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:O})}}},h.onManifestLoaded=function(a,A){var E=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(T){var D=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!D)return;var L="textTrack"+D[1],w=E.captionsProperties[L];if(!w)return;w.label=T.name,T.lang&&(w.languageCode=T.lang),w.media=T})},h.onFragLoading=function(a,A){var E=this.cea608Parser1,T=this.cea608Parser2,D=this.lastSn,L=this.lastPartIndex;if(!this.enabled||!(E&&T))return;if(A.frag.type===v.PlaylistLevelType.MAIN){var w,O,S=A.frag.sn,f=(w=A==null||((O=A.part)===null||O===void 0)?void 0:O.index)!=null?w:-1;S===D+1||S===D&&f===L+1||(E.reset(),T.reset()),this.lastSn=S,this.lastPartIndex=f}},h.onFragLoaded=function(a,A){var E=A.frag,T=A.payload,D=this.initPTS,L=this.unparsedVttFrags;if(E.type===v.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(Y.isFiniteNumber)(D[E.cc])){L.push(A),D.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var w=E.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var O=this.tracks[E.level],S=this.vttCCs;S[E.cc]||(S[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),O&&O.textCodec===R.IMSC1_CODEC?this._parseIMSC1(E,T):this._parseVTTs(E,T,S)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(a,A){var E=this,T=this.hls;Object(R.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(D){E._appendCues(D,a.level),T.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){m.logger.log("Failed to parse IMSC1: "+D),T.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},h._parseVTTs=function(a,A,E){var T=this,D=this.hls;Object(G.parseWebVTT)(A,this.initPTS[a.cc],this.timescale[a.cc],E,a.cc,a.start,function(L){T._appendCues(L,a.level),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(L){T._fallbackToIMSC1(a,A),m.logger.log("Failed to parse VTT cue: "+L),D.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},h._fallbackToIMSC1=function(a,A){var E=this,T=this.tracks[a.level];T.textCodec||Object(R.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(){T.textCodec=R.IMSC1_CODEC,E._parseIMSC1(a,A)},function(){T.textCodec="wvtt"})},h._appendCues=function(a,A){var E=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[A];if(T.mode==="disabled")return;a.forEach(function(w){return Object(n.addCueToTrack)(T,w)})}else{var D=this.tracks[A],L=D.default?"default":"subtitles"+A;E.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:a,track:L})}},h.onFragDecrypted=function(a,A){var E=A.frag;if(E.type===v.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(j.Events.FRAG_LOADED,A)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(a,A){var E=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(E&&T))return;for(var D=0;D<A.samples.length;D++){var L=A.samples[D].bytes;if(L){var w=this.extractCea608Data(L);E.addData(A.samples[D].pts,w[0]),T.addData(A.samples[D].pts,w[1])}}},h.onBufferFlushing=function(a,A){var E=A.startOffset,T=A.endOffset,D=A.endOffsetSubtitles,L=A.type,w=this.media;if(!w||w.currentTime<T)return;if(!L||L==="video"){var O=this.captionsTracks;Object.keys(O).forEach(function(f){return Object(n.removeCuesInRange)(O[f],E,T)})}if(this.config.renderTextTracksNatively&&(E===0&&D!==void 0)){var S=this.textTracks;Object.keys(S).forEach(function(f){return Object(n.removeCuesInRange)(S[f],E,D)})}},h.extractCea608Data=function(a){for(var A=a[0]&31,E=2,T=[[],[]],D=0;D<A;D++){var L=a[E++],w=127&a[E++],O=127&a[E++],S=(4&L)!==0,f=3&L;if(w===0&&O===0)continue;S&&((f===0||f===1)&&(T[f].push(w),T[f].push(O)))}return T},o}();function u(o,h){return o&&o.label===h.name&&!(o.textTrack1||o.textTrack2)}function l(o,h,s,a){return Math.min(h,a)-Math.max(o,s)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return Y});var Y=function(){function j(z,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=z,this.aesIV=G}var U=j.prototype;return U.decrypt=function(G,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,G)},j}()},"./src/crypt/aes-decryptor.ts":function(re,$,P){"use strict";P.r($),P.d($,"removePadding",function(){return j}),P.d($,"default",function(){return U});var Y=P("./src/utils/typed-array.ts");function j(z){var G=z.byteLength,n=G&&new DataView(z.buffer).getUint8(G-1);return n?Object(Y.sliceUint8)(z,0,G-n):z}var U=function(){function z(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var G=z.prototype;return G.uint8ArrayToUint32Array_=function(R){for(var v=new DataView(R),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},G.initTable=function(){var R=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],u=m[1],l=m[2],d=m[3],o=this.invSubMix,h=o[0],s=o[1],a=o[2],A=o[3],E=new Uint32Array(256),T=0,D=0,L=0;for(L=0;L<256;L++)L<128?E[L]=L<<1:E[L]=L<<1^283;for(L=0;L<256;L++){var w=D^D<<1^D<<2^D<<3^D<<4;w=w>>>8^w&255^99,R[T]=w,v[w]=T;var O=E[T],S=E[O],f=E[S],C=E[w]*257^w*16843008;p[T]=C<<24|C>>>8,u[T]=C<<16|C>>>16,l[T]=C<<8|C>>>24,d[T]=C,C=f*16843009^S*65537^O*257^T*16843008,h[w]=C<<24|C>>>8,s[w]=C<<16|C>>>16,a[w]=C<<8|C>>>24,A[w]=C,T?(T=O^E[E[E[f^O]]],D^=E[E[D]]):T=D=1}},G.expandKey=function(R){for(var v=this.uint8ArrayToUint32Array_(R),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var u=this.keySize=v.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var l=this.ksRows=(u+6+1)*4,d,o,h=this.keySchedule=new Uint32Array(l),s=this.invKeySchedule=new Uint32Array(l),a=this.sBox,A=this.rcon,E=this.invSubMix,T=E[0],D=E[1],L=E[2],w=E[3],O,S;for(d=0;d<l;d++){if(d<u){O=h[d]=v[d];continue}S=O,d%u===0?(S=S<<8|S>>>24,S=a[S>>>24]<<24|a[S>>>16&255]<<16|a[S>>>8&255]<<8|a[S&255],S^=A[d/u|0]<<24):u>6&&d%u===4&&(S=a[S>>>24]<<24|a[S>>>16&255]<<16|a[S>>>8&255]<<8|a[S&255]),h[d]=O=(h[d-u]^S)>>>0}for(o=0;o<l;o++)d=l-o,o&3?S=h[d]:S=h[d-4],o<4||d<=4?s[o]=S:s[o]=T[a[S>>>24]]^D[a[S>>>16&255]]^L[a[S>>>8&255]]^w[a[S&255]],s[o]=s[o]>>>0},G.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},G.decrypt=function(R,v,m){for(var p=this.keySize+6,u=this.invKeySchedule,l=this.invSBox,d=this.invSubMix,o=d[0],h=d[1],s=d[2],a=d[3],A=this.uint8ArrayToUint32Array_(m),E=A[0],T=A[1],D=A[2],L=A[3],w=new Int32Array(R),O=new Int32Array(w.length),S,f,C,y,b,B,F,x,N,I,g,W,J,ie,ue=this.networkToHostOrderSwap;v<w.length;){for(N=ue(w[v]),I=ue(w[v+1]),g=ue(w[v+2]),W=ue(w[v+3]),b=N^u[0],B=W^u[1],F=g^u[2],x=I^u[3],J=4,ie=1;ie<p;ie++)S=o[b>>>24]^h[B>>16&255]^s[F>>8&255]^a[x&255]^u[J],f=o[B>>>24]^h[F>>16&255]^s[x>>8&255]^a[b&255]^u[J+1],C=o[F>>>24]^h[x>>16&255]^s[b>>8&255]^a[B&255]^u[J+2],y=o[x>>>24]^h[b>>16&255]^s[B>>8&255]^a[F&255]^u[J+3],b=S,B=f,F=C,x=y,J=J+4;S=l[b>>>24]<<24^l[B>>16&255]<<16^l[F>>8&255]<<8^l[x&255]^u[J],f=l[B>>>24]<<24^l[F>>16&255]<<16^l[x>>8&255]<<8^l[b&255]^u[J+1],C=l[F>>>24]<<24^l[x>>16&255]<<16^l[b>>8&255]<<8^l[B&255]^u[J+2],y=l[x>>>24]<<24^l[b>>16&255]<<16^l[B>>8&255]<<8^l[F&255]^u[J+3],O[v]=ue(S^E),O[v+1]=ue(y^T),O[v+2]=ue(C^D),O[v+3]=ue(f^L),E=N,T=I,D=g,L=W,v=v+4}return O.buffer},z}()},"./src/crypt/decrypter.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return v});var Y=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),U=P("./src/crypt/aes-decryptor.ts"),z=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),R=16,v=function(){function m(u,l,d){var o=d===void 0?{}:d,h=o.removePKCS7Padding,s=h===void 0?!0:h;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=l,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var d=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(U.removePadding)(d):d},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(l,d,o,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),d,o);var s=this.flush();s&&h(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),d,o).then(h)},p.softwareDecrypt=function(l,d,o){var h=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(l=Object(G.appendUint8Array)(a,l),this.remainderData=null);var A=this.getValidChunk(l);if(!A.length)return null;h&&(o=h);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new U.default),E.expandKey(d);var T=s;return this.currentResult=E.decrypt(A.buffer,0,o),this.currentIV=Object(n.sliceUint8)(A,-16).buffer,T||null},p.webCryptoDecrypt=function(l,d,o){var h=this,s=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new j.default(s,d)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var A=new Y.default(s,o);return A.decrypt(l.buffer,a)}).catch(function(a){return h.onWebCryptoError(a,l,d,o)})},p.onWebCryptoError=function(l,d,o,h){return z.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,o,h)},p.getValidChunk=function(l){var d=l,o=l.length-l.length%R;return o!==l.length&&(d=Object(n.sliceUint8)(l,0,o),this.remainderData=Object(n.sliceUint8)(l,o)),d},p.logOnce=function(l){if(!this.logEnabled)return;z.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return Y});var Y=function(){function j(z,G){this.subtle=void 0,this.key=void 0,this.subtle=z,this.key=G}var U=j.prototype;return U.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/id3.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,n(v,m)}function n(v,m){return n=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},n(v,m)}var R=function(v){G(m,v);function m(u,l){var d;return d=v.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=u,d.config=l,d}var p=m.prototype;return p.resetInitSegment=function(l,d,o){v.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var d=z.getID3Data(l,0)||[],o=d.length,h=l.length;o<h;o++)if(j.probe(l,o))return U.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(l,d){return j.canParse(l,d)},p.appendFrame=function(l,d,o){j.initTrackConfig(l,this.observer,d,o,l.manifestCodec);var h=j.appendFrame(l,d,o,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},m}(Y.default);R.minProbeByteLength=9,$.default=R},"./src/demux/adts.ts":function(re,$,P){"use strict";P.r($),P.d($,"getAudioConfig",function(){return z}),P.d($,"isHeaderPattern",function(){return G}),P.d($,"getHeaderLength",function(){return n}),P.d($,"getFullFrameLength",function(){return R}),P.d($,"canGetFrameLength",function(){return v}),P.d($,"isHeader",function(){return m}),P.d($,"canParse",function(){return p}),P.d($,"probe",function(){return u}),P.d($,"initTrackConfig",function(){return l}),P.d($,"getFrameDuration",function(){return d}),P.d($,"parseFrameHeader",function(){return o}),P.d($,"appendFrame",function(){return h});var Y=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts");function z(s,a,A,E){var T,D,L,w,O=navigator.userAgent.toLowerCase(),S=E,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((a[A+2]&192)>>>6)+1;var C=(a[A+2]&60)>>>2;if(C>f.length-1){s.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return L=(a[A+2]&1)<<2,L|=(a[A+3]&192)>>>6,Y.logger.log("manifest codec:"+E+", ADTS type:"+T+", samplingIndex:"+C),/firefox/i.test(O)?C>=6?(T=5,w=new Array(4),D=C-3):(T=2,w=new Array(2),D=C):O.indexOf("android")!==-1?(T=2,w=new Array(2),D=C):(T=5,w=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&C>=6?D=C-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(C>=6&&L===1||/vivaldi/i.test(O))||!E&&L===1)&&(T=2,w=new Array(2)),D=C)),w[0]=T<<3,w[0]|=(C&14)>>1,w[1]|=(C&1)<<7,w[1]|=L<<3,T===5&&(w[1]|=(D&14)>>1,w[2]=(D&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:f[C],channelCount:L,codec:"mp4a.40."+T,manifestCodec:S}}function G(s,a){return s[a]===255&&(s[a+1]&246)===240}function n(s,a){return s[a+1]&1?7:9}function R(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&G(s,a)}function p(s,a){return v(s,a)&&G(s,a)&&R(s,a)<=s.length-a}function u(s,a){if(m(s,a)){var A=n(s,a);if(a+A>=s.length)return!1;var E=R(s,a);if(E<=A)return!1;var T=a+E;return T===s.length||m(s,T)}return!1}function l(s,a,A,E,T){if(!s.samplerate){var D=z(a,A,E,T);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,Y.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function d(s){return 1024*9e4/s}function o(s,a,A,E,T){var D=n(s,a),L=R(s,a);if(L-=D,L>0){var w=A+E*T;return{headerLength:D,frameLength:L,stamp:w}}}function h(s,a,A,E,T){var D=d(s.samplerate),L=o(a,A,E,T,D);if(L){var w=L.frameLength,O=L.headerLength,S=L.stamp,f=O+w,C=Math.max(0,A+f-a.length),y;C?(y=new Uint8Array(f-O),y.set(a.subarray(A+O,a.length),0)):y=a.subarray(A+O,A+f);var b={unit:y,pts:S};return C||s.samples.push(b),{sample:b,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"initPTSFn",function(){return R});var Y=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),z=P("./src/utils/mp4-tools.ts"),G=P("./src/utils/typed-array.ts"),n=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(u,l,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(u,l){return!1},m.appendFrame=function(u,l,d){},m.demux=function(u,l){this.cachedData&&(u=Object(z.appendUint8Array)(this.cachedData,u),this.cachedData=null);var d=j.getID3Data(u,0),o=d?d.length:0,h,s,a=this._audioTrack,A=this._id3Track,E=d?j.getTimeStamp(d):void 0,T=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(E,l)),d&&d.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),s=this.initPTS;o<T;){if(this.canParse(u,o)){var D=this.appendFrame(a,u,o);D?(this.frameIndex++,s=D.sample.pts,o+=D.length,h=o):o=T}else j.canParse(u,o)?(d=j.getID3Data(u,o),A.samples.push({pts:s,dts:s,data:d}),o+=d.length,h=o):o++;if(o===T&&h!==T){var L=Object(G.sliceUint8)(u,h);this.cachedData?this.cachedData=Object(z.appendUint8Array)(this.cachedData,L):this.cachedData=L}}return{audioTrack:a,avcTrack:Object(U.dummyTrack)(),id3Track:A,textTrack:Object(U.dummyTrack)()}},m.demuxSampleAes=function(u,l,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(u){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(U.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(U.dummyTrack)()}},m.destroy=function(){},v}(),R=function(m,p){return Object(Y.isFiniteNumber)(m)?m*90:p*9e4};$.default=n},"./src/demux/chunk-cache.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return Y});var Y=function(){function U(){this.chunks=[],this.dataLength=0}var z=U.prototype;return z.push=function(n){this.chunks.push(n),this.dataLength+=n.length},z.flush=function(){var n=this.chunks,R=this.dataLength,v;if(n.length)n.length===1?v=n[0]:v=j(n,R);else return new Uint8Array(0);return this.reset(),v},z.reset=function(){this.chunks.length=0,this.dataLength=0},U}();function j(U,z){for(var G=new Uint8Array(z),n=0,R=0;R<U.length;R++){var v=U[R];G.set(v,n),n+=v.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(re,$,P){"use strict";P.r($),P.d($,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/utils/logger.ts"),j=function(){function U(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var z=U.prototype;return z.loadWord=function(){var n=this.data,R=this.bytesAvailable,v=n.byteLength-R,m=new Uint8Array(4),p=Math.min(4,R);if(p===0)throw new Error("no bytes available");m.set(n.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},z.skipBits=function(n){var R;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,R=n>>3,n-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},z.readBits=function(n){var R=Math.min(this.bitsAvailable,n),v=this.word>>>32-R;return n>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=n-R,R>0&&this.bitsAvailable?v<<R|this.readBits(R):v},z.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},z.skipUEG=function(){this.skipBits(1+this.skipLZ())},z.skipEG=function(){this.skipBits(1+this.skipLZ())},z.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},z.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},z.readBoolean=function(){return this.readBits(1)===1},z.readUByte=function(){return this.readBits(8)},z.readUShort=function(){return this.readBits(16)},z.readUInt=function(){return this.readBits(32)},z.skipScalingList=function(n){for(var R=8,v=8,m,p=0;p<n;p++)v!==0&&(m=this.readEG(),v=(R+m+256)%256),R=v===0?R:v},z.readSPS=function(){var n=0,R=0,v=0,m=0,p,u,l,d=this.readUByte.bind(this),o=this.readBits.bind(this),h=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),A=this.skipEG.bind(this),E=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var D=d();if(o(5),a(3),d(),E(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var L=h();if(L===3&&a(1),E(),E(),a(1),s())for(u=L!==3?8:12,l=0;l<u;l++)s()&&(l<6?T(16):T(64))}E();var w=h();if(w===0)h();else if(w===1)for(a(1),A(),A(),p=h(),l=0;l<p;l++)A();E(),a(1);var O=h(),S=h(),f=o(1);f===0&&a(1),a(1),s()&&(n=h(),R=h(),v=h(),m=h());var C=[1,1];if(s()&&s()){var y=d();switch(y){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((O+1)*16-n*2-R*2),height:(2-f)*(S+1)*16-(f?2:4)*(v+m),pixelRatio:C}},z.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},U}();$.default=j},"./src/demux/id3.ts":function(re,$,P){"use strict";P.r($),P.d($,"isHeader",function(){return Y}),P.d($,"isFooter",function(){return j}),P.d($,"getID3Data",function(){return U}),P.d($,"canParse",function(){return G}),P.d($,"getTimeStamp",function(){return n}),P.d($,"isTimeStampFrame",function(){return R}),P.d($,"getID3Frames",function(){return m}),P.d($,"decodeFrame",function(){return p}),P.d($,"utf8ArrayToStr",function(){return h}),P.d($,"testables",function(){return s});var Y=function(T,D){return D+10<=T.length&&(T[D]===73&&T[D+1]===68&&T[D+2]===51&&(T[D+3]<255&&T[D+4]<255&&(T[D+6]<128&&T[D+7]<128&&T[D+8]<128&&T[D+9]<128)))},j=function(T,D){return D+10<=T.length&&(T[D]===51&&T[D+1]===68&&T[D+2]===73&&(T[D+3]<255&&T[D+4]<255&&(T[D+6]<128&&T[D+7]<128&&T[D+8]<128&&T[D+9]<128)))},U=function(T,D){for(var L=D,w=0;Y(T,D);){w+=10;var O=z(T,D+6);w+=O,j(T,D+10)&&(w+=10),D+=w}return w>0?T.subarray(L,L+w):void 0},z=function(T,D){var L=0;return L=(T[D]&127)<<21,L|=(T[D+1]&127)<<14,L|=(T[D+2]&127)<<7,L|=T[D+3]&127,L},G=function(T,D){return Y(T,D)&&z(T,D+6)+10<=T.length-D},n=function(T){for(var D=m(T),L=0;L<D.length;L++){var w=D[L];if(R(w))return o(w)}return},R=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},v=function(T){var D=String.fromCharCode(T[0],T[1],T[2],T[3]),L=z(T,4),w=10;return{type:D,size:L,data:T.subarray(w,w+L)}},m=function(T){for(var D=0,L=[];Y(T,D);){var w=z(T,D+6);D+=10;for(var O=D+w;D+8<O;){var S=v(T.subarray(D)),f=p(S);f&&L.push(f),D+=S.size+10}j(T,D)&&(D+=10)}return L},p=function(T){return T.type==="PRIV"?u(T):T.type[0]==="W"?d(T):l(T)},u=function(T){if(T.size<2)return;var D=h(T.data,!0),L=new Uint8Array(T.data.subarray(D.length+1));return{key:T.type,info:D,data:L.buffer}},l=function(T){if(T.size<2)return;if(T.type==="TXXX"){var D=1,L=h(T.data.subarray(D),!0);D+=L.length+1;var w=h(T.data.subarray(D));return{key:T.type,info:L,data:w}}var O=h(T.data.subarray(1));return{key:T.type,data:O}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var D=1,L=h(T.data.subarray(D),!0);D+=L.length+1;var w=h(T.data.subarray(D));return{key:T.type,info:L,data:w}}var O=h(T.data);return{key:T.type,data:O}},o=function(T){if(T.data.byteLength===8){var D=new Uint8Array(T.data),L=D[3]&1,w=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return w/=45,L&&(w+=4772185884e-2),Math.round(w)}return},h=function(T,D){D===void 0&&(D=!1);var L=A();if(L){var w=L.decode(T);if(D){var O=w.indexOf("\0");return O!==-1?w.substring(0,O):w}return w.replace(/\0/g,"")}for(var S=T.length,f,C,y,b="",B=0;B<S;){if(f=T[B++],f===0&&D)return b;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(f);break;case 12:case 13:C=T[B++],b+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=T[B++],y=T[B++],b+=String.fromCharCode((f&15)<<12|(C&63)<<6|(y&63)<<0);break;default:}}return b},s={decodeTextFrame:l},a;function A(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),U=P("./src/utils/logger.ts"),z=P("./src/demux/mpegaudio.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,n(v,m)}function n(v,m){return n=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},n(v,m)}var R=function(v){G(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(l,d,o){v.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var d=j.getID3Data(l,0)||[],o=d.length,h=l.length;o<h;o++)if(z.probe(l,o))return U.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(l,d){return z.canParse(l,d)},p.appendFrame=function(l,d,o){return this.initPTS===null?void 0:z.appendFrame(l,d,o,this.initPTS,this.frameIndex)},m}(Y.default);R.minProbeByteLength=4,$.default=R},"./src/demux/mp4demuxer.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),U=function(){function z(n,R){this.remainderData=null,this.config=void 0,this.config=R}var G=z.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},z.probe=function(R){return Object(Y.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},G.demux=function(R){var v=R,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(Y.appendUint8Array)(this.remainderData,R));var p=Object(Y.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.flush=function(){var R=Object(j.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:R,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.demuxSampleAes=function(R,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},z}();U.minProbeByteLength=1024,$.default=U},"./src/demux/mpegaudio.ts":function(re,$,P){"use strict";P.r($),P.d($,"appendFrame",function(){return n}),P.d($,"parseHeader",function(){return R}),P.d($,"isHeaderPattern",function(){return v}),P.d($,"isHeader",function(){return m}),P.d($,"canParse",function(){return p}),P.d($,"probe",function(){return u});var Y=null,j=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],U=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],z=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function n(l,d,o,h,s){if(o+24>d.length)return;var a=R(d,o);if(a&&o+a.frameLength<=d.length){var A=a.samplesPerFrame*9e4/a.sampleRate,E=h+s*A,T={unit:d.subarray(o,o+a.frameLength),pts:E,dts:E};return l.config=[],l.channelCount=a.channelCount,l.samplerate=a.sampleRate,l.samples.push(T),{sample:T,length:a.frameLength,missing:0}}}function R(l,d){var o=l[d+1]>>3&3,h=l[d+1]>>1&3,s=l[d+2]>>4&15,a=l[d+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var A=l[d+2]>>1&1,E=l[d+3]>>6,T=o===3?3-h:h===3?3:4,D=j[T*14+s-1]*1e3,L=o===3?0:o===2?1:2,w=U[L*3+a],O=E===3?1:2,S=z[o][h],f=G[h],C=S*8*f,y=Math.floor(S*D/w+A)*f;if(Y===null){var b=navigator.userAgent||"",B=b.match(/Chrome\/(\d+)/i);Y=B?parseInt(B[1]):0}var F=!!Y&&Y<=87;return F&&h===2&&D>=224e3&&E===0&&(l[d+3]=l[d+3]|128),{sampleRate:w,channelCount:O,frameLength:y,samplesPerFrame:C}}}function v(l,d){return l[d]===255&&(l[d+1]&224)===224&&(l[d+1]&6)!==0}function m(l,d){return d+1<l.length&&v(l,d)}function p(l,d){var o=4;return v(l,d)&&o<=l.length-d}function u(l,d){if(d+1<l.length&&v(l,d)){var o=4,h=R(l,d),s=o;h!=null&&h.frameLength&&(s=h.frameLength);var a=d+s;return a===l.length||m(l,a)}return!1}},"./src/demux/sample-aes.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),U=function(){function z(n,R,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new Y.default(n,R,{removePKCS7Padding:!1})}var G=z.prototype;return G.decryptBuffer=function(R,v){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,v)},G.decryptAacSample=function(R,v,m,p){var u=R[v].unit,l=u.subarray(16,u.length-u.length%16),d=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),o=this;this.decryptBuffer(d,function(h){var s=new Uint8Array(h);u.set(s,16),p||o.decryptAacSamples(R,v+1,m)})},G.decryptAacSamples=function(R,v,m){for(;;v++){if(v>=R.length){m();return}if(R[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(R,v,m,p),!p)return}},G.getAvcEncryptedData=function(R){for(var v=Math.floor((R.length-48)/160)*16+16,m=new Int8Array(v),p=0,u=32;u<=R.length-16;u+=160,p+=16)m.set(R.subarray(u,u+16),p);return m},G.getAvcDecryptedUnit=function(R,v){for(var m=new Uint8Array(v),p=0,u=32;u<=R.length-16;u+=160,p+=16)R.set(m.subarray(p,p+16),u);return R},G.decryptAvcSample=function(R,v,m,p,u,l){var d=Object(j.discardEPB)(u.data),o=this.getAvcEncryptedData(d),h=this;this.decryptBuffer(o.buffer,function(s){u.data=h.getAvcDecryptedUnit(d,s),l||h.decryptAvcSamples(R,v,m+1,p)})},G.decryptAvcSamples=function(R,v,m,p){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=R.length){p();return}for(var u=R[v].units;!(m>=u.length);m++){var l=u[m];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(R,v,m,p,l,d),!d)return}}},z}();$.default=U},"./src/demux/transmuxer-interface.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var Y=P("./node_modules/webworkify-webpack/index.js"),j=P.n(Y),U=P("./src/events.ts"),z=P("./src/demux/transmuxer.ts"),G=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),R=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function l(o,h,s,a){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=h,this.onTransmuxComplete=s,this.onFlush=a;var E=o.config,T=function(S,f){f=f||{},f.frag=A.frag,f.id=A.id,o.trigger(S,f)};this.observer=new v.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,T),this.observer.on(U.Events.ERROR,T);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},L=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var w;try{w=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(O){o.trigger(U.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(O.message+" ("+O.filename+":"+O.lineno+")")})},w.postMessage({cmd:"init",typeSupported:D,vendor:L,id:h,config:JSON.stringify(E)})}catch(O){G.logger.warn("Error in worker:",O),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new z.default(this.observer,D,E,L,h),this.worker=null}}else this.transmuxer=new z.default(this.observer,D,E,L,h)}var d=l.prototype;return d.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},d.push=function(h,s,a,A,E,T,D,L,w,O){var S=this;w.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,y=T?T.start:E.start,b=E.decryptdata,B=this.frag,F=!(B&&E.cc===B.cc),x=!(B&&w.level===B.level),N=B?w.sn-B.sn:-1,I=this.part?w.part-this.part.index:1,g=!x&&(N===1||N===0&&I===1),W=self.performance.now();(x||N||E.stats.parsing.start===0)&&(E.stats.parsing.start=W),T&&(I||!g)&&(T.stats.parsing.start=W);var J=new z.TransmuxState(F,g,L,x,y);if(!g||F){G.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+x+`
|
|
contiguous: `+g+`
|
|
accurateTimeOffset: `+L+`
|
|
timeOffset: `+y);var ie=new z.TransmuxConfig(a,A,s,D,O);this.configureTransmuxer(ie)}if(this.frag=E,this.part=T,C)C.postMessage({cmd:"demux",data:h,decryptdata:b,chunkMeta:w,state:J},h instanceof ArrayBuffer?[h]:[]);else if(f){var ue=f.push(h,b,w,J);Object(z.isPromise)(ue)?ue.then(function(Re){S.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(ue)}},d.flush=function(h){var s=this;h.transmuxing.start=self.performance.now();var a=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(a){var E=a.flush(h);Object(z.isPromise)(E)?E.then(function(T){s.handleFlushResult(T,h)}):this.handleFlushResult(E,h)}},d.handleFlushResult=function(h,s){var a=this;h.forEach(function(A){a.handleTransmuxComplete(A)}),this.onFlush(s)},d.onWorkerMessage=function(h){var s=h.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},d.configureTransmuxer=function(h){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:h}):a&&a.configure(h)},d.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},l}()},"./src/demux/transmuxer-worker.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var Y=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),z=P("./node_modules/eventemitter3/index.js"),G=P.n(z);function n(u){var l=new z.EventEmitter,d=function(h,s){u.postMessage({event:h,data:s})};l.on(j.Events.FRAG_DECRYPTED,d),l.on(j.Events.ERROR,d),u.addEventListener("message",function(o){var h=o.data;switch(h.cmd){case"init":{var s=JSON.parse(h.config);u.transmuxer=new Y.default(l,h.typeSupported,s,h.vendor,h.id),Object(U.enableLogs)(s.debug),d("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var a=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(Y.isPromise)(a)?a.then(function(T){R(u,T)}):R(u,a);break}case"flush":{var A=h.chunkMeta,E=u.transmuxer.flush(A);Object(Y.isPromise)(E)?E.then(function(T){m(u,T,A)}):m(u,E,A);break}default:break}})}function R(u,l){if(p(l.remuxResult))return;var d=[],o=l.remuxResult,h=o.audio,s=o.video;h&&v(d,h),s&&v(d,s),u.postMessage({event:"transmuxComplete",data:l},d)}function v(u,l){l.data1&&u.push(l.data1.buffer),l.data2&&u.push(l.data2.buffer)}function m(u,l,d){l.forEach(function(o){R(u,o)}),u.postMessage({event:"flush",data:d})}function p(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s}),P.d($,"isPromise",function(){return E}),P.d($,"TransmuxConfig",function(){return T}),P.d($,"TransmuxState",function(){return D});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/crypt/decrypter.ts"),z=P("./src/demux/aacdemuxer.ts"),G=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),R=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),u=P("./src/utils/mp4-tools.ts"),l=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(L){l.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var o=[{demux:n.default,remux:v.default},{demux:G.default,remux:m.default},{demux:z.default,remux:v.default},{demux:R.default,remux:v.default}],h=1024;o.forEach(function(L){var w=L.demux;h=Math.max(h,w.minProbeByteLength)});var s=function(){function L(O,S,f,C,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=O,this.typeSupported=S,this.config=f,this.vendor=C,this.id=y}var w=L.prototype;return w.configure=function(S){this.transmuxConfig=S,this.decrypter&&this.decrypter.reset()},w.push=function(S,f,C,y){var b=this,B=C.transmuxing;B.executeStart=d();var F=new Uint8Array(S),x=this.cache,N=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var W=a(F,f);if(W&&W.method==="AES-128"){var J=this.getDecrypter();if(N.enableSoftwareAES){var ie=J.softwareDecrypt(F,W.key.buffer,W.iv.buffer);if(!ie)return B.executeEnd=d(),A(C);F=new Uint8Array(ie)}else return this.decryptionPromise=J.webCryptoDecrypt(F,W.key.buffer,W.iv.buffer).then(function(Pe){var Be=b.push(Pe,null,C);return b.decryptionPromise=null,Be}),this.decryptionPromise}var ue=y||I,Re=ue.contiguous,ve=ue.discontinuity,Se=ue.trackSwitch,Le=ue.accurateTimeOffset,be=ue.timeOffset,ce=g.audioCodec,he=g.videoCodec,ne=g.defaultInitPts,de=g.duration,se=g.initSegmentData;if((ve||Se)&&this.resetInitSegment(se,ce,he,de),ve&&this.resetInitialTimestamp(ne),Re||this.resetContiguity(),this.needsProbing(F,ve,Se)){if(x.dataLength){var De=x.flush();F=Object(u.appendUint8Array)(De,F)}this.configureTransmuxer(F,g)}var Ne=this.transmux(F,W,be,Le,C),Ae=this.currentTransmuxState;return Ae.contiguous=!0,Ae.discontinuity=!1,Ae.trackSwitch=!1,B.executeEnd=d(),Ne},w.flush=function(S){var f=this,C=S.transmuxing;C.executeStart=d();var y=this.decrypter,b=this.cache,B=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return f.flush(S)});var x=[],N=B.timeOffset;if(y){var I=y.flush();I&&x.push(this.push(I,null,S))}var g=b.dataLength;b.reset();var W=this.demuxer,J=this.remuxer;if(!W||!J)return g>=h&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=d(),[A(S)];var ie=W.flush(N);return E(ie)?ie.then(function(ue){return f.flushRemux(x,ue,S),x}):(this.flushRemux(x,ie,S),x)},w.flushRemux=function(S,f,C){var y=f.audioTrack,b=f.avcTrack,B=f.id3Track,F=f.textTrack,x=this.currentTransmuxState,N=x.accurateTimeOffset,I=x.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var g=this.remuxer.remux(y,b,B,F,I,N,!0,this.id);S.push({remuxResult:g,chunkMeta:C}),C.transmuxing.executeEnd=d()},w.resetInitialTimestamp=function(S){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(S),C.resetTimeStamp(S)},w.resetContiguity=function(){var S=this.demuxer,f=this.remuxer;if(!S||!f)return;S.resetContiguity(),f.resetNextTimestamp()},w.resetInitSegment=function(S,f,C,y){var b=this.demuxer,B=this.remuxer;if(!b||!B)return;b.resetInitSegment(f,C,y),B.resetInitSegment(S,f,C)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(S,f,C,y,b){var B;return f&&f.method==="SAMPLE-AES"?B=this.transmuxSampleAes(S,f,C,y,b):B=this.transmuxUnencrypted(S,C,y,b),B},w.transmuxUnencrypted=function(S,f,C,y){var b=this.demuxer.demux(S,f,!1,!this.config.progressive),B=b.audioTrack,F=b.avcTrack,x=b.id3Track,N=b.textTrack,I=this.remuxer.remux(B,F,x,N,f,C,!1,this.id);return{remuxResult:I,chunkMeta:y}},w.transmuxSampleAes=function(S,f,C,y,b){var B=this;return this.demuxer.demuxSampleAes(S,f,C).then(function(F){var x=B.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,C,y,!1,B.id);return{remuxResult:x,chunkMeta:b}})},w.configureTransmuxer=function(S,f){for(var C=this.config,y=this.observer,b=this.typeSupported,B=this.vendor,F=f.audioCodec,x=f.defaultInitPts,N=f.duration,I=f.initSegmentData,g=f.videoCodec,W,J=0,ie=o.length;J<ie;J++)if(o[J].demux.probe(S)){W=o[J];break}W||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:G.default,remux:m.default});var ue=this.demuxer,Re=this.remuxer,ve=W.remux,Se=W.demux;(!Re||!(Re instanceof ve))&&(this.remuxer=new ve(y,C,b,B)),(!ue||!(ue instanceof Se))&&(this.demuxer=new Se(y,C,b),this.probe=Se.probe),this.resetInitSegment(I,F,g,N),this.resetInitialTimestamp(x)},w.needsProbing=function(S,f,C){return!this.demuxer||!this.remuxer||f||C},w.getDecrypter=function(){var S=this.decrypter;return S||(S=this.decrypter=new U.default(this.observer,this.config)),S},L}();function a(L,w){var O=null;return L.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(O=w),O}var A=function(w){return{remuxResult:{},chunkMeta:w}};function E(L){return"then"in L&&L.then instanceof Function}var T=function(w,O,S,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=O,this.initSegmentData=S,this.duration=f,this.defaultInitPts=C},D=function(w,O,S,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=O,this.accurateTimeOffset=S,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"discardEPB",function(){return A});var Y=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),U=P("./src/demux/exp-golomb.ts"),z=P("./src/demux/id3.ts"),G=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),R=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},u=function(){function E(D,L,w){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=L,this.typeSupported=w}E.probe=function(L){var w=E.syncOffset(L);return w<0?!1:(w&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},E.syncOffset=function(L){for(var w=Math.min(1e3,L.length-3*188),O=0;O<w;){if(L[O]===71&&L[O+188]===71&&L[O+2*188]===71)return O;O++}return-1},E.createTrack=function(L,w){return{container:L==="video"||L==="audio"?"video/mp2t":void 0,type:L,id:p[L],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:L==="audio"?w:void 0}};var T=E.prototype;return T.resetInitSegment=function(L,w,O){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",O),this._audioTrack=E.createTrack("audio",O),this._id3Track=E.createTrack("id3",O),this._txtTrack=E.createTrack("text",O),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=L,this.videoCodec=w,this._duration=O},T.resetTimeStamp=function(){},T.resetContiguity=function(){var L=this._audioTrack,w=this._avcTrack,O=this._id3Track;L&&(L.pesData=null),w&&(w.pesData=null),O&&(O.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(L,w,O,S){O===void 0&&(O=!1),S===void 0&&(S=!1),O||(this.sampleAes=null);var f,C=this._avcTrack,y=this._audioTrack,b=this._id3Track,B=C.pid,F=C.pesData,x=y.pid,N=b.pid,I=y.pesData,g=b.pesData,W=!1,J=this.pmtParsed,ie=this._pmtId,ue=L.length;if(this.remainderData&&(L=Object(R.appendUint8Array)(this.remainderData,L),ue=L.length,this.remainderData=null),ue<188&&!S)return this.remainderData=L,{audioTrack:y,avcTrack:C,id3Track:b,textTrack:this._txtTrack};var Re=Math.max(0,E.syncOffset(L));ue-=(ue+Re)%188,ue<L.byteLength&&!S&&(this.remainderData=new Uint8Array(L.buffer,ue,L.buffer.byteLength-ue));for(var ve=Re;ve<ue;ve+=188)if(L[ve]===71){var Se=!!(L[ve+1]&64),Le=((L[ve+1]&31)<<8)+L[ve+2],be=(L[ve+3]&48)>>4,ce=void 0;if(be>1){if(ce=ve+5+L[ve+4],ce===ve+188)continue}else ce=ve+4;switch(Le){case B:Se&&(F&&(f=h(F))&&this.parseAVCPES(f,!1),F={data:[],size:0}),F&&(F.data.push(L.subarray(ce,ve+188)),F.size+=ve+188-ce);break;case x:Se&&(I&&(f=h(I))&&(y.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),I={data:[],size:0}),I&&(I.data.push(L.subarray(ce,ve+188)),I.size+=ve+188-ce);break;case N:Se&&(g&&(f=h(g))&&this.parseID3PES(f),g={data:[],size:0}),g&&(g.data.push(L.subarray(ce,ve+188)),g.size+=ve+188-ce);break;case 0:Se&&(ce+=L[ce]+1),ie=this._pmtId=d(L,ce);break;case ie:{Se&&(ce+=L[ce]+1);var he=o(L,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,O);B=he.avc,B>0&&(C.pid=B),x=he.audio,x>0&&(y.pid=x,y.isAAC=he.isAAC),N=he.id3,N>0&&(b.pid=N),W&&!J&&(v.logger.log("reparse from beginning"),W=!1,ve=Re-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=F,y.pesData=I,b.pesData=g;var ne={audioTrack:y,avcTrack:C,id3Track:b,textTrack:this._txtTrack};return S&&this.extractRemainingSamples(ne),ne},T.flush=function(){var L=this.remainderData;this.remainderData=null;var w;return L?w=this.demux(L,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},T.extractRemainingSamples=function(L){var w=L.audioTrack,O=L.avcTrack,S=L.id3Track,f=O.pesData,C=w.pesData,y=S.pesData,b;f&&(b=h(f))?(this.parseAVCPES(b,!0),O.pesData=null):O.pesData=f,C&&(b=h(C))?(w.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),w.pesData=null):(C!=null&&C.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=C),y&&(b=h(y))?(this.parseID3PES(b),S.pesData=null):S.pesData=y},T.demuxSampleAes=function(L,w,O){var S=this.demux(L,O,!0,!this.config.progressive),f=this.sampleAes=new G.default(this.observer,this.config,w);return this.decrypt(S,f)},T.decrypt=function(L,w){return new Promise(function(O){var S=L.audioTrack,f=L.avcTrack;S.samples&&S.isAAC?w.decryptAacSamples(S.samples,0,function(){f.samples?w.decryptAvcSamples(f.samples,0,0,function(){O(L)}):O(L)}):f.samples&&w.decryptAvcSamples(f.samples,0,0,function(){O(L)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(L,w){var O=this,S=this._avcTrack,f=this.parseAVCNALu(L.data),C=!1,y=this.avcSample,b,B=!1;L.data=null,y&&f.length&&!S.audFound&&(s(y,S),y=this.avcSample=l(!1,L.pts,L.dts,"")),f.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=O.avcSample=l(!0,L.pts,L.dts,"")),C&&(y.debug+="NDR "),y.frame=!0;var x=F.data;if(B&&x.length>4){var N=new U.default(x).readSliceType();(N===2||N===4||N===7||N===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=O.avcSample=l(!0,L.pts,L.dts,"")),C&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,C&&y&&(y.debug+="SEI ");var I=new U.default(A(F.data));I.readUByte();for(var g=0,W=0,J=!1,ie=0;!J&&I.bytesAvailable>1;){g=0;do ie=I.readUByte(),g+=ie;while(ie===255);W=0;do ie=I.readUByte(),W+=ie;while(ie===255);if(g===4&&I.bytesAvailable!==0){J=!0;var ue=I.readUByte();if(ue===181){var Re=I.readUShort();if(Re===49){var ve=I.readUInt();if(ve===1195456820){var Se=I.readUByte();if(Se===3){for(var Le=I.readUByte(),be=I.readUByte(),ce=31&Le,he=[Le,be],ne=0;ne<ce;ne++)he.push(I.readUByte()),he.push(I.readUByte()),he.push(I.readUByte());a(O._txtTrack.samples,{type:3,pts:L.pts,bytes:he})}}}}}else if(g===5&&I.bytesAvailable!==0){if(J=!0,W>16){for(var de=[],se=0;se<16;se++)de.push(I.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&de.push("-");for(var De=W-16,Ne=new Uint8Array(De),Ae=0;Ae<De;Ae++)Ne[Ae]=I.readUByte();a(O._txtTrack.samples,{pts:L.pts,payloadType:g,uuid:de.join(""),userData:Object(z.utf8ArrayToStr)(Ne),userDataBytes:Ne})}}else if(W<I.bytesAvailable)for(var Pe=0;Pe<W;Pe++)I.readUByte()}break}case 7:if(b=!0,B=!0,C&&y&&(y.debug+="SPS "),!S.sps){var Be=new U.default(F.data),oe=Be.readSPS();S.width=oe.width,S.height=oe.height,S.pixelRatio=oe.pixelRatio,S.sps=[F.data],S.duration=O._duration;for(var ge=F.data.subarray(1,4),Oe="avc1.",Ie=0;Ie<3;Ie++){var He=ge[Ie].toString(16);He.length<2&&(He="0"+He),Oe+=He}S.codec=Oe}break;case 8:b=!0,C&&y&&(y.debug+="PPS "),S.pps||(S.pps=[F.data]);break;case 9:b=!1,S.audFound=!0,y&&s(y,S),y=O.avcSample=l(!1,L.pts,L.dts,C?"AUD ":"");break;case 12:b=!1;break;default:b=!1,y&&(y.debug+="unknown NAL "+F.type+" ");break}if(y&&b){var Xe=y.units;Xe.push(F)}}),w&&y&&(s(y,S),this.avcSample=null)},T.getLastNalUnit=function(){var L,w=this.avcSample,O;if(!w||w.units.length===0){var S=this._avcTrack.samples;w=S[S.length-1]}if((L=w)!==null&&L!==void 0&&L.units){var f=w.units;O=f[f.length-1]}return O},T.parseAVCNALu=function(L){var w=L.byteLength,O=this._avcTrack,S=O.naluState||0,f=S,C=[],y=0,b,B,F,x=-1,N=0;for(S===-1&&(x=0,N=L[0]&31,S=0,y=1);y<w;){if(b=L[y++],!S){S=b?0:1;continue}if(S===1){S=b?0:2;continue}if(!b)S=3;else if(b===1){if(x>=0){var I={data:L.subarray(x,y-S-1),type:N};C.push(I)}else{var g=this.getLastNalUnit();if(g&&(f&&y<=4-f&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-f))),B=y-S-1,B>0)){var W=new Uint8Array(g.data.byteLength+B);W.set(g.data,0),W.set(L.subarray(0,B),g.data.byteLength),g.data=W,g.state=0}}y<w?(F=L[y]&31,x=y,N=F,S=0):S=-1}else S=0}if(x>=0&&S>=0){var J={data:L.subarray(x,w),type:N,state:S};C.push(J)}if(C.length===0){var ie=this.getLastNalUnit();if(ie){var ue=new Uint8Array(ie.data.byteLength+L.byteLength);ue.set(ie.data,0),ue.set(L,ie.data.byteLength),ie.data=ue}}return O.naluState=S,C},T.parseAACPES=function(L){var w=0,O=this._audioTrack,S=this.aacOverFlow,f=L.data;if(S){this.aacOverFlow=null;var C=S.sample.unit.byteLength,y=Math.min(S.missing,C),b=C-y;S.sample.unit.set(f.subarray(0,y),b),O.samples.push(S.sample),w=S.missing}var B,F;for(B=w,F=f.length;B<F-1&&!Y.isHeader(f,B);B++);if(B!==w){var x,N;if(B<F-1?(x="AAC PES did not start with ADTS header,offset:"+B,N=!1):(x="no ADTS header found in AAC PES",N=!0),v.logger.warn("parsing error:"+x),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:N,reason:x}),N)return}Y.initTrackConfig(O,this.observer,f,B,this.audioCodec);var I;if(L.pts!==void 0)I=L.pts;else if(S){var g=Y.getFrameDuration(O.samplerate);I=S.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;B<F;)if(Y.isHeader(f,B)){if(B+5<F){var J=Y.appendFrame(O,f,B,I,W);if(J)if(J.missing)this.aacOverFlow=J;else{B+=J.length,W++;continue}}break}else B++},T.parseMPEGPES=function(L){var w=L.data,O=w.length,S=0,f=0,C=L.pts;if(C===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<O;)if(j.isHeader(w,f)){var y=j.appendFrame(this._audioTrack,w,f,C,S);if(y)f+=y.length,S++;else break}else f++},T.parseID3PES=function(L){if(L.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(L)},E}();u.minProbeByteLength=188;function l(E,T,D,L){return{key:E,frame:!1,pts:T,dts:D,units:[],debug:L,length:0}}function d(E,T){return(E[T+10]&31)<<8|E[T+11]}function o(E,T,D,L){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},O=(E[T+1]&15)<<8|E[T+2],S=T+3+O-4,f=(E[T+10]&15)<<8|E[T+11];for(T+=12+f;T<S;){var C=(E[T+1]&31)<<8|E[T+2];switch(E[T]){case 207:if(!L){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=C);break;case 21:w.id3===-1&&(w.id3=C);break;case 219:if(!L){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=C);break;case 3:case 4:D?w.audio===-1&&(w.audio=C,w.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((E[T+3]&15)<<8|E[T+4])+5}return w}function h(E){var T=0,D,L,w,O,S,f=E.data;if(!E||E.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}D=f[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(L=(D[4]<<8)+D[5],L&&L>E.size-6)return null;var b=D[7];b&192&&(O=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(S=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,O-S>60*9e4&&(v.logger.warn(Math.round((O-S)/9e4)+"s delta between PTS and DTS, align them"),O=S)):S=O),w=D[8];var B=w+9;if(E.size<=B)return null;E.size-=B;for(var F=new Uint8Array(E.size),x=0,N=f.length;x<N;x++){D=f[x];var I=D.byteLength;if(B)if(B>I){B-=I;continue}else D=D.subarray(B),I-=B,B=0;F.set(D,T),T+=I}return L&&(L-=w+3),{data:F,pts:O,dts:S,len:L}}return null}function s(E,T){if(E.units.length&&E.frame){if(E.pts===void 0){var D=T.samples,L=D.length;if(L){var w=D[L-1];E.pts=w.pts,E.dts=w.dts}else{T.dropped++;return}}T.samples.push(E)}E.debug.length&&v.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,T){var D=E.length;if(D>0){if(T.pts>=E[D-1].pts)E.push(T);else for(var L=D-1;L>=0;L--)if(T.pts<E[L].pts){E.splice(L,0,T);break}}else E.push(T)}function A(E){for(var T=E.byteLength,D=[],L=1;L<T-2;)E[L]===0&&E[L+1]===0&&E[L+2]===3?(D.push(L+2),L+=2):L++;if(D.length===0)return E;var w=T-D.length,O=new Uint8Array(w),S=0;for(L=0;L<w;S++,L++)S===D[0]&&(S++,D.shift()),O[L]=E[S];return O}$.default=u},"./src/errors.ts":function(re,$,P){"use strict";P.r($),P.d($,"ErrorTypes",function(){return Y}),P.d($,"ErrorDetails",function(){return j});var Y;(function(U){U.NETWORK_ERROR="networkError",U.MEDIA_ERROR="mediaError",U.KEY_SYSTEM_ERROR="keySystemError",U.MUX_ERROR="muxError",U.OTHER_ERROR="otherError"})(Y||(Y={}));var j;(function(U){U.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",U.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",U.KEY_SYSTEM_NO_SESSION="keySystemNoSession",U.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",U.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",U.MANIFEST_LOAD_ERROR="manifestLoadError",U.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",U.MANIFEST_PARSING_ERROR="manifestParsingError",U.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",U.LEVEL_EMPTY_ERROR="levelEmptyError",U.LEVEL_LOAD_ERROR="levelLoadError",U.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",U.LEVEL_SWITCH_ERROR="levelSwitchError",U.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",U.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",U.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",U.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",U.FRAG_LOAD_ERROR="fragLoadError",U.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",U.FRAG_DECRYPT_ERROR="fragDecryptError",U.FRAG_PARSING_ERROR="fragParsingError",U.REMUX_ALLOC_ERROR="remuxAllocError",U.KEY_LOAD_ERROR="keyLoadError",U.KEY_LOAD_TIMEOUT="keyLoadTimeOut",U.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",U.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",U.BUFFER_APPEND_ERROR="bufferAppendError",U.BUFFER_APPENDING_ERROR="bufferAppendingError",U.BUFFER_STALLED_ERROR="bufferStalledError",U.BUFFER_FULL_ERROR="bufferFullError",U.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",U.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",U.INTERNAL_EXCEPTION="internalException",U.INTERNAL_ABORTED="aborted",U.UNKNOWN="unknown"})(j||(j={}))},"./src/events.ts":function(re,$,P){"use strict";P.r($),P.d($,"Events",function(){return Y});var Y;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Y||(Y={}))},"./src/hls.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return E});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y),U=P("./src/loader/playlist-loader.ts"),z=P("./src/loader/key-loader.ts"),G=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),R=P("./src/controller/level-controller.ts"),v=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),u=P("./src/utils/logger.ts"),l=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),o=P.n(d),h=P("./src/events.ts"),s=P("./src/errors.ts");function a(T,D){for(var L=0;L<D.length;L++){var w=D[L];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function A(T,D,L){return D&&a(T.prototype,D),L&&a(T,L),T}var E=function(){T.isSupported=function(){return Object(p.isSupported)()};function T(L){L===void 0&&(L={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var w=this.config=Object(l.mergeConfig)(T.DefaultConfig,L);this.userConfig=L,Object(u.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(l.enableStreamingMode)(w);var O=w.abrController,S=w.bufferController,f=w.capLevelController,C=w.fpsController,y=this.abrController=new O(this),b=this.bufferController=new S(this),B=this.capLevelController=new f(this),F=new C(this),x=new U.default(this),N=new z.default(this),I=new G.default(this),g=this.levelController=new R.default(this),W=new v.FragmentTracker(this),J=this.streamController=new m.default(this,W);B.setStreamController(J),F.setStreamController(J);var ie=[g,J];this.networkControllers=ie;var ue=[x,N,y,b,B,F,I,W];this.audioTrackController=this.createController(w.audioTrackController,null,ie),this.createController(w.audioStreamController,W,ie),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,ie),this.createController(w.subtitleStreamController,W,ie),this.createController(w.timelineController,null,ue),this.emeController=this.createController(w.emeController,null,ue),this.cmcdController=this.createController(w.cmcdController,null,ue),this.latencyController=this.createController(n.default,null,ue),this.coreComponents=ue}var D=T.prototype;return D.createController=function(w,O,S){if(w){var f=O?new w(this,O):new w(this);return S&&S.push(f),f}return null},D.on=function(w,O,S){S===void 0&&(S=this),this._emitter.on(w,O,S)},D.once=function(w,O,S){S===void 0&&(S=this),this._emitter.once(w,O,S)},D.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},D.off=function(w,O,S,f){S===void 0&&(S=this),this._emitter.off(w,O,S,f)},D.listeners=function(w){return this._emitter.listeners(w)},D.emit=function(w,O,S){return this._emitter.emit(w,O,S)},D.trigger=function(w,O){if(this.config.debug)return this.emit(w,w,O);try{return this.emit(w,w,O)}catch(S){u.logger.error("An internal error happened while handling event "+w+'. Error message: "'+S.message+'". Here is a stacktrace:',S),this.trigger(h.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:w,error:S})}return!1},D.listenerCount=function(w){return this._emitter.listenerCount(w)},D.destroy=function(){u.logger.log("destroy"),this.trigger(h.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},D.attachMedia=function(w){u.logger.log("attachMedia"),this._media=w,this.trigger(h.Events.MEDIA_ATTACHING,{media:w})},D.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(w){this.stopLoad();var O=this.media,S=this.url,f=this.url=Y.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});u.logger.log("loadSource:"+f),O&&S&&S!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(O)),this.trigger(h.Events.MANIFEST_LOADING,{url:w})},D.startLoad=function(w){w===void 0&&(w=-1),u.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(O){O.startLoad(w)})},D.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},D.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){u.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},D.removeLevel=function(w,O){O===void 0&&(O=0),this.levelController.removeLevel(w,O)},A(T,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){u.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){u.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){u.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){u.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){u.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var O=!!w;O!==this.config.capLevelToPlayerSize&&(O?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=O)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(u.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,O=this.config.minAutoBitrate;if(!w)return 0;for(var S=w.length,f=0;f<S;f++)if(w[f].maxBitrate>O)return f;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,O=this.autoLevelCapping,S;return O===-1&&w&&w.length?S=w.length-1:S=O,S}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var O=this.audioTrackController;O&&(O.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var O=this.subtitleTrackController;O&&(O.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var O=this.subtitleTrackController;O&&(O.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return h.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:l.hlsDefaultConfig},set:function(w){T.defaultConfig=w}}]),T}();E.defaultConfig=void 0},"./src/is-supported.ts":function(re,$,P){"use strict";P.r($),P.d($,"isSupported",function(){return U}),P.d($,"changeTypeSupported",function(){return z});var Y=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var G=Object(Y.getMediaSource)();if(!G)return!1;var n=j(),R=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!R&&!!v}function z(){var G,n=j();return typeof(n==null||((G=n.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u}),P.d($,"LoadError",function(){return d});var Y=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function U(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,v(o,h)}function z(o){var h=typeof Map=="function"?new Map:void 0;return z=function(a){if(a===null||!R(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(a))return h.get(a);h.set(a,A)}function A(){return G(a,arguments,m(this).constructor)}return A.prototype=Object.create(a.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),v(A,a)},z(o)}function G(o,h,s){return n()?G=Reflect.construct:G=function(A,E,T){var D=[null];D.push.apply(D,E);var L=Function.bind.apply(A,D),w=new L;return T&&v(w,T.prototype),w},G.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function R(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,h){return v=Object.setPrototypeOf||function(a,A){return a.__proto__=A,a},v(o,h)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(o)}var p=Math.pow(2,17),u=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var h=o.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(a,A){var E=this,T=a.url;if(!T)return Promise.reject(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var D=this.config,L=D.fLoader,w=D.loader;return new Promise(function(O,S){E.loader&&E.loader.destroy();var f=E.loader=a.loader=L?new L(D):new w(D),C=l(a),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=f.stats,f.load(C,y,{onSuccess:function(B,F,x,N){E.resetLoader(a,f),O({frag:a,part:null,payload:B.data,networkDetails:N})},onError:function(B,F,x){E.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:B,networkDetails:x}))},onAbort:function(B,F,x){E.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:x}))},onTimeout:function(B,F,x){E.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:x}))},onProgress:function(B,F,x,N){A&&A({frag:a,part:null,payload:x,networkDetails:N})}})})},h.loadPart=function(a,A,E){var T=this;this.abort();var D=this.config,L=D.fLoader,w=D.loader;return new Promise(function(O,S){T.loader&&T.loader.destroy();var f=T.loader=a.loader=L?new L(D):new w(D),C=l(a,A),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};A.stats=f.stats,f.load(C,y,{onSuccess:function(B,F,x,N){T.resetLoader(a,f),T.updateStatsFromPart(a,A);var I={frag:a,part:A,payload:B.data,networkDetails:N};E(I),O(I)},onError:function(B,F,x){T.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:A,response:B,networkDetails:x}))},onAbort:function(B,F,x){a.stats.aborted=A.stats.aborted,T.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:A,networkDetails:x}))},onTimeout:function(B,F,x){T.resetLoader(a,f),S(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:A,networkDetails:x}))}})})},h.updateStatsFromPart=function(a,A){var E=a.stats,T=A.stats,D=T.total;if(E.loaded+=T.loaded,D){var L=Math.round(a.duration/A.duration),w=Math.min(Math.round(E.loaded/D),L),O=L-w,S=O*Math.round(E.loaded/w);E.total=E.loaded+S}else E.total=Math.max(E.loaded,E.total);var f=E.loading,C=T.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},h.resetLoader=function(a,A){a.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},o}();function l(o,h){h===void 0&&(h=null);var s=h||o,a={frag:o,part:h,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},A=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object(Y.isFiniteNumber)(A)&&Object(Y.isFiniteNumber)(E)&&(a.rangeStart=A,a.rangeEnd=E),a}var d=function(o){U(h,o);function h(s){for(var a,A=arguments.length,E=new Array(A>1?A-1:0),T=1;T<A;T++)E[T-1]=arguments[T];return a=o.call.apply(o,[this].concat(E))||this,a.data=void 0,a.data=s,a}return h}(z(Error))},"./src/loader/fragment.ts":function(re,$,P){"use strict";P.r($),P.d($,"ElementaryStreamTypes",function(){return u}),P.d($,"BaseSegment",function(){return l}),P.d($,"Fragment",function(){return d}),P.d($,"Part",function(){return o});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/utils/logger.ts"),G=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function R(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,v(h,s)}function v(h,s){return v=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},v(h,s)}function m(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function p(h,s,a){return s&&m(h.prototype,s),a&&m(h,a),h}var u;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(u||(u={}));var l=function(){function h(a){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[u.AUDIO]=null,A[u.VIDEO]=null,A[u.AUDIOVIDEO]=null,A),this.baseurl=a}var s=h.prototype;return s.setByteRange=function(A,E){var T=A.split("@",2),D=[];T.length===1?D[0]=E?E.byteRangeEndOffset:0:D[0]=parseInt(T[1]),D[1]=parseInt(T[0])+D[0],this._byteRange=D},p(h,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),h}(),d=function(h){R(s,h);function s(A,E){var T;return T=h.call(this,E)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new n.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=A,T}var a=s.prototype;return a.createInitializationVector=function(E){for(var T=new Uint8Array(16),D=12;D<16;D++)T[D]=E>>8*(15-D)&255;return T},a.setDecryptDataFromLevelKey=function(E,T){var D=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(D=G.LevelKey.fromURI(E.uri),D.method=E.method,D.iv=this.createInitializationVector(T),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(E,T,D,L,w,O){O===void 0&&(O=!1);var S=this.elementaryStreams,f=S[E];if(!f){S[E]={startPTS:T,endPTS:D,startDTS:L,endDTS:w,partial:O};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,D),f.startDTS=Math.min(f.startDTS,L),f.endDTS=Math.max(f.endDTS,w)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&z.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Y.isFiniteNumber)(this.programDateTime))return null;var E=Object(Y.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(l),o=function(h){R(s,h);function s(a,A,E,T,D){var L;L=h.call(this,E)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new n.LoadStats,L.duration=a.decimalFloatingPoint("DURATION"),L.gap=a.bool("GAP"),L.independent=a.bool("INDEPENDENT"),L.relurl=a.enumeratedString("URI"),L.fragment=A,L.index=T;var w=a.enumeratedString("BYTERANGE");return w&&L.setByteRange(w,D),D&&(L.fragOffset=D.fragOffset+D.duration),L}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),s}(l)},"./src/loader/key-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return z});var Y=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),z=function(){function G(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var n=G.prototype;return n._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},n.onKeyLoading=function(v,m){var p=m.frag,u=p.type,l=this.loaders[u];if(!p.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=p.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(U.logger.warn("abort previous key loader for type:"+u),l.abort()),!d){U.logger.warn("key uri is falsy");return}var h=o.loader,s=p.loader=this.loaders[u]=new h(o);this.decrypturl=d,this.decryptkey=null;var a={url:d,frag:p,responseType:"arraybuffer"},A={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,A,E)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:p}))},n.loadsuccess=function(v,m,p){var u=p.frag;if(!u.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(v.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:u})},n.loaderror=function(v,m){var p=m.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},n.loadtimeout=function(v,m){var p=m.frag,u=p.loader;u&&u.abort(),delete this.loaders[p.type],this.hls.trigger(Y.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},G}()},"./src/loader/level-details.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelDetails",function(){return G});var Y=P("./src/polyfills/number.ts");function j(n,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function U(n,R,v){return R&&j(n.prototype,R),v&&j(n,v),n}var z=10,G=function(){function n(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var R=n.prototype;return R.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,u=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!u||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},U(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||z}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelKey",function(){return G});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(Y);function U(n,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function z(n,R,v){return R&&U(n.prototype,R),v&&U(n,v),n}var G=function(){n.fromURL=function(v,m){return new n(v,m)},n.fromURI=function(v){return new n(v)};function n(R,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(Y.buildAbsoluteURL)(R,v,{alwaysNormalize:!0}):this._uri=R}return z(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(re,$,P){"use strict";P.r($),P.d($,"LoadStats",function(){return Y});var Y=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s});var Y=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(j),z=P("./src/loader/fragment.ts"),G=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),R=P("./src/utils/attr-list.ts"),v=P("./src/utils/logger.ts"),m=P("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function h(D){var L,w;return o.test((L=(w=j.parseURL(D))===null||w===void 0?void 0:w.path)!=null?L:"")}var s=function(){function D(){}return D.findGroup=function(w,O){for(var S=0;S<w.length;S++){var f=w[S];if(f.id===O)return f}},D.convertAVC1ToAVCOTI=function(w){var O=w.split(".");if(O.length>2){var S=O.shift()+".";return S+=parseInt(O.shift()).toString(16),S+=("000"+parseInt(O.shift()).toString(16)).substr(-4),S}return w},D.resolve=function(w,O){return j.buildAbsoluteURL(O,w,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(w,O){var S=[],f={},C=!1;p.lastIndex=0;for(var y;(y=p.exec(w))!=null;)if(y[1]){var b=new R.AttrList(y[1]),B={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],O)},F=b.decimalResolution("RESOLUTION");F&&(B.width=F.width,B.height=F.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=D.convertAVC1ToAVCOTI(B.videoCodec)),S.push(B)}else if(y[3]){var x=new R.AttrList(y[3]);x["DATA-ID"]&&(C=!0,f[x["DATA-ID"]]=x)}return{levels:S,sessionData:C?f:null}},D.parseMasterPlaylistMedia=function(w,O,S,f){f===void 0&&(f=[]);var C,y=[],b=0;for(u.lastIndex=0;(C=u.exec(w))!==null;){var B=new R.AttrList(C[1]);if(B.TYPE===S){var F={attrs:B,bitrate:0,id:b++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:S,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?D.resolve(B.URI,O):""};if(f.length){var x=D.findGroup(f,F.groupId)||f[0];A(F,x,"audioCodec"),A(F,x,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(w,O,S,f,C){var y=new G.LevelDetails(O),b=y.fragments,B=null,F=0,x=0,N=0,I=0,g=null,W=new z.Fragment(f,O),J,ie,ue,Re=-1,ve=!1;for(l.lastIndex=0,y.m3u8=w;(J=l.exec(w))!==null;){ve&&(ve=!1,W=new z.Fragment(f,O),W.start=N,W.sn=F,W.cc=I,W.level=S,B&&(W.initSegment=B,W.rawProgramDateTime=B.rawProgramDateTime));var Se=J[1];if(Se){W.duration=parseFloat(Se);var Le=(" "+J[2]).slice(1);W.title=Le||null,W.tagList.push(Le?["INF",Se,Le]:["INF",Se])}else if(J[3])Object(Y.isFiniteNumber)(W.duration)&&(W.start=N,ue&&(W.levelkey=ue),W.sn=F,W.level=S,W.cc=I,W.urlId=C,b.push(W),W.relurl=(" "+J[3]).slice(1),T(W,g),g=W,N+=W.duration,F++,x=0,ve=!0);else if(J[4]){var be=(" "+J[4]).slice(1);g?W.setByteRange(be,g):W.setByteRange(be)}else if(J[5])W.rawProgramDateTime=(" "+J[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Re===-1&&(Re=b.length);else{if(J=J[0].match(d),!J){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<J.length&&!(typeof J[ie]!="undefined");ie++);var ce=(" "+J[ie]).slice(1),he=(" "+J[ie+1]).slice(1),ne=J[ie+2]?(" "+J[ie+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":y.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(he);break;case"SKIP":{var de=new R.AttrList(he),se=de.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(se)){y.skippedSegments=se;for(var De=se;De--;)b.unshift(null);F+=se}var Ne=de.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(y.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(he);break;case"VERSION":y.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(he||ne)&&W.tagList.push(ne?[he,ne]:[he]);break;case"DIS":I++;case"GAP":W.tagList.push([ce]);break;case"BITRATE":W.tagList.push([ce,he]);break;case"DISCONTINUITY-SEQ":I=parseInt(he);break;case"KEY":{var Ae,Pe=new R.AttrList(he),Be=Pe.enumeratedString("METHOD"),oe=Pe.URI,ge=Pe.hexadecimalInteger("IV"),Oe=Pe.enumeratedString("KEYFORMATVERSIONS"),Ie=Pe.enumeratedString("KEYID"),He=(Ae=Pe.enumeratedString("KEYFORMAT"))!=null?Ae:"identity",Xe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xe.indexOf(He)>-1){v.logger.warn("Keyformat "+He+" is not supported from the manifest");continue}else if(He!=="identity")continue;Be&&(ue=n.LevelKey.fromURL(O,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Be)>=0&&(ue.method=Be,ue.keyFormat=He,Ie&&(ue.keyID=Ie),Oe&&(ue.keyFormatVersions=Oe),ue.iv=ge));break}case"START":{var qe=new R.AttrList(he),Ze=qe.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(Ze)&&(y.startTimeOffset=Ze);break}case"MAP":{var nt=new R.AttrList(he);W.relurl=nt.URI,nt.BYTERANGE&&W.setByteRange(nt.BYTERANGE),W.level=S,W.sn="initSegment",ue&&(W.levelkey=ue),W.initSegment=null,B=W,ve=!0;break}case"SERVER-CONTROL":{var $e=new R.AttrList(he);y.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),y.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Qe=new R.AttrList(he);y.partTarget=Qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Fe=y.partList;Fe||(Fe=y.partList=[]);var ut=x>0?Fe[Fe.length-1]:void 0,lt=x++,je=new z.Part(new R.AttrList(he),W,O,lt,ut);Fe.push(je),W.duration+=je.duration;break}case"PRELOAD-HINT":{var We=new R.AttrList(he);y.preloadHint=We;break}case"RENDITION-REPORT":{var Ce=new R.AttrList(he);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Ce);break}default:v.logger.warn("line parsed but not handled: "+J);break}}}g&&!g.relurl?(b.pop(),N-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(T(W,g),W.cc=I,y.fragmentHint=W);var _e=b.length,Te=b[0],ae=b[_e-1];if(N+=y.skippedSegments*y.targetduration,N>0&&_e&&ae){y.averagetargetduration=N/_e;var le=ae.sn;y.endSN=le!=="initSegment"?le:0,Te&&(y.startCC=Te.cc,Te.initSegment||y.fragments.every(function(fe){return fe.relurl&&h(fe.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new z.Fragment(f,O),W.relurl=ae.relurl,W.level=S,W.sn="initSegment",Te.initSegment=W,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(N+=y.fragmentHint.duration),y.totalduration=N,y.endCC=I,Re>0&&E(b,Re),y},D}();function a(D,L){["video","audio","text"].forEach(function(w){var O=D.filter(function(f){return Object(m.isCodecType)(f,w)});if(O.length){var S=O.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});L[w+"Codec"]=S.length>0?S[0]:O[0],D=D.filter(function(f){return O.indexOf(f)===-1})}}),L.unknownCodecs=D}function A(D,L,w){var O=L[w];O&&(D[w]=O)}function E(D,L){for(var w=D[L],O=L;O--;){var S=D[O];if(!S)return;S.programDateTime=w.programDateTime-S.duration*1e3,w=S}}function T(D,L){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):L!=null&&L.programDateTime&&(D.programDateTime=L.endProgramDateTime),Object(Y.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),z=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(l){var d=l.type;switch(d){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function p(l,d){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=d.url),o}var u=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var d=l.prototype;return d.registerListeners=function(){var h=this.hls;h.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var h=this.hls;h.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(h){var s=this.hls.config,a=s.pLoader,A=s.loader,E=a||A,T=new E(s);return h.loader=T,this.loaders[h.type]=T,T},d.getInternalLoader=function(h){return this.loaders[h.type]},d.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},d.destroyInternalLoaders=function(){for(var h in this.loaders){var s=this.loaders[h];s&&s.destroy(),this.resetInternalLoader(h)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(h,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},d.onLevelLoading=function(h,s){var a=s.id,A=s.level,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:null,level:A,responseType:"text",type:R.PlaylistContextType.LEVEL,url:E,deliveryDirectives:T})},d.onAudioTrackLoading=function(h,s){var a=s.id,A=s.groupId,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(h,s){var a=s.id,A=s.groupId,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:T})},d.load=function(h){var s,a=this.hls.config,A=this.getInternalLoader(h);if(A){var E=A.context;if(E&&E.url===h.url){z.logger.trace("[playlist-loader]: playlist request ongoing");return}z.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var T,D,L,w;switch(h.type){case R.PlaylistContextType.MANIFEST:T=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,L=a.manifestLoadingRetryDelay,w=a.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:T=0,D=a.levelLoadingTimeOut;break;default:T=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,L=a.levelLoadingRetryDelay,w=a.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.part){var O;if(h.type===R.PlaylistContextType.LEVEL&&h.level!==null?O=this.hls.levels[h.level].details:h.type===R.PlaylistContextType.AUDIO_TRACK&&h.id!==null?O=this.hls.audioTracks[h.id].details:h.type===R.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(O=this.hls.subtitleTracks[h.id].details),O){var S=O.partTarget,f=O.targetduration;S&&f&&(D=Math.min(Math.max(S*3,f*.8)*1e3,D))}}var C={timeout:D,maxRetry:T,retryDelay:L,maxRetryDelay:w,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,C,y)},d.loadsuccess=function(h,s,a,A){if(A===void 0&&(A=null),a.isSidxRequest){this.handleSidxRequest(h,a),this.handlePlaylistLoaded(h,s,a,A);return}this.resetInternalLoader(a.type);var E=h.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,a,"no EXTM3U delimiter",A);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,s,a,A):this.handleMasterPlaylist(h,s,a,A)},d.loaderror=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,h)},d.loadtimeout=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},d.handleMasterPlaylist=function(h,s,a,A){var E=this.hls,T=h.data,D=p(h,a),L=n.default.parseMasterPlaylist(T,D),w=L.levels,O=L.sessionData;if(!w.length){this.handleManifestParsingError(h,a,"no level found in manifest",A);return}var S=w.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),f=w.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),C=n.default.parseMasterPlaylistMedia(T,D,"AUDIO",S),y=n.default.parseMasterPlaylistMedia(T,D,"SUBTITLES",f),b=n.default.parseMasterPlaylistMedia(T,D,"CLOSED-CAPTIONS");if(C.length){var B=C.some(function(F){return!F.url});!B&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(z.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}E.trigger(j.Events.MANIFEST_LOADED,{levels:w,audioTracks:C,subtitles:y,captions:b,url:D,stats:s,networkDetails:A,sessionData:O})},d.handleTrackOrLevelPlaylist=function(h,s,a,A){var E=this.hls,T=a.id,D=a.level,L=a.type,w=p(h,a),O=Object(Y.isFiniteNumber)(T)?T:0,S=Object(Y.isFiniteNumber)(D)?D:O,f=m(a),C=n.default.parseLevelPlaylist(h.data,w,S,f,O);if(!C.fragments.length){E.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(L===R.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:C,name:"",url:w};E.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:w,stats:s,networkDetails:A,sessionData:null})}if(s.parsing.end=performance.now(),C.needSidxRanges){var b,B=(b=C.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:B,isSidxRequest:!0,type:L,level:D,levelDetails:C,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=C,this.handlePlaylistLoaded(h,s,a,A)},d.handleSidxRequest=function(h,s){var a=Object(G.parseSegmentIndex)(new Uint8Array(h.data));if(!a)return;var A=a.references,E=s.levelDetails;A.forEach(function(T,D){var L=T.info,w=E.fragments[D];w.byteRange.length===0&&w.setByteRange(String(1+L.end-L.start)+"@"+String(L.start)),w.initSegment&&w.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(h,s,a,A){this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===R.PlaylistContextType.MANIFEST,url:h.url,reason:a,response:h,context:s,networkDetails:A})},d.handleNetworkError=function(h,s,a,A){a===void 0&&(a=!1),z.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var E=U.ErrorDetails.UNKNOWN,T=!1,D=this.getInternalLoader(h);switch(h.type){case R.PlaylistContextType.MANIFEST:E=a?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case R.PlaylistContextType.LEVEL:E=a?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case R.PlaylistContextType.AUDIO_TRACK:E=a?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:E=a?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}D&&this.resetInternalLoader(h.type);var L={type:U.ErrorTypes.NETWORK_ERROR,details:E,fatal:T,url:h.url,loader:D,context:h,networkDetails:s};A&&(L.response=A),this.hls.trigger(j.Events.ERROR,L)},d.handlePlaylistLoaded=function(h,s,a,A){var E=a.type,T=a.level,D=a.id,L=a.groupId,w=a.loader,O=a.levelDetails,S=a.deliveryDirectives;if(!(O!=null&&O.targetduration)){this.handleManifestParsingError(h,a,"invalid target duration",A);return}if(!w)return;O.live&&(w.getCacheAge&&(O.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(O.ageHeader))&&(O.ageHeader=0));switch(E){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:O,level:T||0,id:D||0,stats:s,networkDetails:A,deliveryDirectives:S});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:O,id:D||0,groupId:L||"",stats:s,networkDetails:A,deliveryDirectives:S});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:O,id:D||0,groupId:L||"",stats:s,networkDetails:A,deliveryDirectives:S});break}},l}();$.default=u},"./src/polyfills/number.ts":function(re,$,P){"use strict";P.r($),P.d($,"isFiniteNumber",function(){return Y}),P.d($,"MAX_SAFE_INTEGER",function(){return j});var Y=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,$,P){"use strict";P.r($);var Y=function(){function j(){}return j.getSilentFrame=function(z,G){switch(z){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(G===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(G===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},j}();$.default=Y},"./src/remux/mp4-generator.ts":function(re,$,P){"use strict";P.r($);var Y=Math.pow(2,32)-1,j=function(){function U(){}return U.init=function(){U.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var G;for(G in U.types)U.types.hasOwnProperty(G)&&(U.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);U.HDLR_TYPES={video:n,audio:R};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=m,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,p,l,p,u),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,v))},U.box=function(G){for(var n=8,R=arguments.length,v=new Array(R>1?R-1:0),m=1;m<R;m++)v[m-1]=arguments[m];for(var p=v.length,u=p;p--;)n+=v[p].byteLength;var l=new Uint8Array(n);for(l[0]=n>>24&255,l[1]=n>>16&255,l[2]=n>>8&255,l[3]=n&255,l.set(G,4),p=0,n=8;p<u;p++)l.set(v[p],n),n+=v[p].byteLength;return l},U.hdlr=function(G){return U.box(U.types.hdlr,U.HDLR_TYPES[G])},U.mdat=function(G){return U.box(U.types.mdat,G)},U.mdhd=function(G,n){n*=G;var R=Math.floor(n/(Y+1)),v=Math.floor(n%(Y+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},U.mdia=function(G){return U.box(U.types.mdia,U.mdhd(G.timescale,G.duration),U.hdlr(G.type),U.minf(G))},U.mfhd=function(G){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},U.minf=function(G){return G.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(G)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(G))},U.moof=function(G,n,R){return U.box(U.types.moof,U.mfhd(G),U.traf(R,n))},U.moov=function(G){for(var n=G.length,R=[];n--;)R[n]=U.trak(G[n]);return U.box.apply(null,[U.types.moov,U.mvhd(G[0].timescale,G[0].duration)].concat(R).concat(U.mvex(G)))},U.mvex=function(G){for(var n=G.length,R=[];n--;)R[n]=U.trex(G[n]);return U.box.apply(null,[U.types.mvex].concat(R))},U.mvhd=function(G,n){n*=G;var R=Math.floor(n/(Y+1)),v=Math.floor(n%(Y+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return U.box(U.types.mvhd,m)},U.sdtp=function(G){var n=G.samples||[],R=new Uint8Array(4+n.length),v,m;for(v=0;v<n.length;v++)m=n[v].flags,R[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return U.box(U.types.sdtp,R)},U.stbl=function(G){return U.box(U.types.stbl,U.stsd(G),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))},U.avc1=function(G){var n=[],R=[],v,m,p;for(v=0;v<G.sps.length;v++)m=G.sps[v],p=m.byteLength,n.push(p>>>8&255),n.push(p&255),n=n.concat(Array.prototype.slice.call(m));for(v=0;v<G.pps.length;v++)m=G.pps[v],p=m.byteLength,R.push(p>>>8&255),R.push(p&255),R=R.concat(Array.prototype.slice.call(m));var u=U.box(U.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|G.sps.length].concat(n).concat([G.pps.length]).concat(R))),l=G.width,d=G.height,o=G.pixelRatio[0],h=G.pixelRatio[1];return U.box(U.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,h>>24,h>>16&255,h>>8&255,h&255])))},U.esds=function(G){var n=G.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(G.config).concat([6,1,2]))},U.mp4a=function(G){var n=G.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),U.box(U.types.esds,U.esds(G)))},U.mp3=function(G){var n=G.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},U.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(G)):U.box(U.types.stsd,U.STSD,U.mp4a(G)):U.box(U.types.stsd,U.STSD,U.avc1(G))},U.tkhd=function(G){var n=G.id,R=G.duration*G.timescale,v=G.width,m=G.height,p=Math.floor(R/(Y+1)),u=Math.floor(R%(Y+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},U.traf=function(G,n){var R=U.sdtp(G),v=G.id,m=Math.floor(n/(Y+1)),p=Math.floor(n%(Y+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),U.trun(G,R.length+16+20+8+16+8+8),R)},U.trak=function(G){return G.duration=G.duration||4294967295,U.box(U.types.trak,U.tkhd(G),U.mdia(G))},U.trex=function(G){var n=G.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(G,n){var R=G.samples||[],v=R.length,m=12+16*v,p=new Uint8Array(m),u,l,d,o,h,s;for(n+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),u=0;u<v;u++)l=R[u],d=l.duration,o=l.size,h=l.flags,s=l.cts,p.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*u);return U.box(U.types.trun,p)},U.initSegment=function(G){U.types||U.init();var n=U.moov(G),R=new Uint8Array(U.FTYP.byteLength+n.byteLength);return R.set(U.FTYP),R.set(n,U.FTYP.byteLength),R},U}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,$.default=j},"./src/remux/mp4-remuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s}),P.d($,"normalizePts",function(){return a});var Y=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),U=P("./src/remux/mp4-generator.ts"),z=P("./src/events.ts"),G=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var w=arguments[L];for(var O in w)Object.prototype.hasOwnProperty.call(w,O)&&(D[O]=w[O])}return D},m.apply(this,arguments)}var p=10*1e3,u=1024,l=1152,d=null,o=null,h=!1,s=function(){function D(w,O,S,f){if(f===void 0&&(f=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=w,this.config=O,this.typeSupported=S,this.ISGenerated=!1,d===null){var C=navigator.userAgent||"",y=C.match(/Chrome\/(\d+)/i);d=y?parseInt(y[1]):0}if(o===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);o=b?parseInt(b[1]):0}h=!!d&&d<75||!!o&&o<600}var L=D.prototype;return L.destroy=function(){},L.resetTimeStamp=function(O){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=O},L.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},L.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},L.getVideoStartPts=function(O){var S=!1,f=O.reduce(function(C,y){var b=y.pts-C;return b<-4294967296?(S=!0,a(C,y.pts)):b>0?C:y.pts},O[0].pts);return S&&n.logger.debug("PTS rollover detected"),f},L.remux=function(O,S,f,C,y,b,B,F){var x,N,I,g,W,J,ie=y,ue=y,Re=O.pid>-1,ve=S.pid>-1,Se=S.samples.length,Le=O.samples.length>0,be=Se>1,ce=(!Re||Le)&&(!ve||be)||this.ISGenerated||B;if(ce){this.ISGenerated||(I=this.generateIS(O,S,y));var he=this.isVideoContiguous,ne=-1;if(be&&(ne=A(S.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,ne>0){n.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Se+" video samples due to a missing keyframe");var de=this.getVideoStartPts(S.samples);S.samples=S.samples.slice(ne),S.dropped+=ne,ue+=(S.samples[0].pts-de)/(S.timescale||9e4)}else ne===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Se+" video samples"),J=!1);if(this.ISGenerated){if(Le&&be){var se=this.getVideoStartPts(S.samples),De=a(O.samples[0].pts,se)-se,Ne=De/S.inputTimeScale;ie+=Math.max(0,Ne),ue+=Math.max(0,-Ne)}if(Le){if(O.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(O,S,y)),N=this.remuxAudio(O,ie,this.isAudioContiguous,b,ve||be||F===R.PlaylistLevelType.AUDIO?ue:void 0),be){var Ae=N?N.endPTS-N.startPTS:0;S.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(O,S,y)),x=this.remuxVideo(S,ue,he,Ae)}}else be&&(x=this.remuxVideo(S,ue,he,0));x&&(x.firstKeyFrame=ne,x.independent=ne!==-1)}}return this.ISGenerated&&(f.samples.length&&(W=this.remuxID3(f,y)),C.samples.length&&(g=this.remuxText(C,y))),{audio:N,video:x,initSegment:I,independent:J,text:g,id3:W}},L.generateIS=function(O,S,f){var C=O.samples,y=S.samples,b=this.typeSupported,B={},F=!Object(Y.isFiniteNumber)(this._initPTS),x="audio/mp4",N,I,g;if(F&&(N=I=Infinity),O.config&&C.length&&(O.timescale=O.samplerate,O.isAAC||(b.mpeg?(x="audio/mpeg",O.codec=""):b.mp3&&(O.codec="mp3")),B.audio={id:"audio",container:x,codec:O.codec,initSegment:!O.isAAC&&b.mpeg?new Uint8Array(0):U.default.initSegment([O]),metadata:{channelCount:O.channelCount}},F&&(g=O.inputTimeScale,N=I=C[0].pts-Math.round(g*f))),S.sps&&S.pps&&y.length&&(S.timescale=S.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:S.codec,initSegment:U.default.initSegment([S]),metadata:{width:S.width,height:S.height}},F)){g=S.inputTimeScale;var W=this.getVideoStartPts(y),J=Math.round(g*f);I=Math.min(I,a(y[0].dts,W)-J),N=Math.min(N,W-J)}if(Object.keys(B).length)return this.ISGenerated=!0,F&&(this._initPTS=N,this._initDTS=I),{tracks:B,initPTS:N,timescale:g}},L.remuxVideo=function(O,S,f,C){var y=O.inputTimeScale,b=O.samples,B=[],F=b.length,x=this._initPTS,N=this.nextAvcDts,I=8,g,W,J,ie=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Re=0,ve=!1;if(!f||N===null){var Se=S*y,Le=b[0].pts-a(b[0].dts,b[0].pts);N=Se-Le}for(var be=0;be<F;be++){var ce=b[be];if(ce.pts=a(ce.pts-x,N),ce.dts=a(ce.dts-x,N),ce.dts>ce.pts){var he=9e4*.2;Re=Math.max(Math.min(Re,ce.pts-ce.dts),-1*he)}ce.dts<b[be>0?be-1:be].dts&&(ve=!0)}ve&&b.sort(function(At,St){var dt=At.dts-St.dts,Ft=At.pts-St.pts;return dt||Ft}),W=b[0].dts,J=b[b.length-1].dts;var ne=Math.round((J-W)/(F-1));if(Re<0){if(Re<ne*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var de=Re,se=0;se<F;se++)b[se].dts=de=Math.max(de,b[se].pts-ne),b[se].pts=Math.max(de,b[se].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var De=0;De<F;De++)b[De].dts=b[De].dts+Re}W=b[0].dts}if(f){var Ne=W-N,Ae=Ne>ne,Pe=Ne<-1;if(Ae||Pe){Ae?n.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),W=N;var Be=b[0].pts-Ne;b[0].dts=W,b[0].pts=Be,n.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Be,!0)+"/"+Object(v.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}h&&(W=Math.max(0,W));for(var oe=0,ge=0,Oe=0;Oe<F;Oe++){for(var Ie=b[Oe],He=Ie.units,Xe=He.length,qe=0,Ze=0;Ze<Xe;Ze++)qe+=He[Ze].data.length;ge+=qe,oe+=Xe,Ie.length=qe,Ie.dts=Math.max(Ie.dts,W),Ie.pts=Math.max(Ie.pts,Ie.dts,0),ie=Math.min(Ie.pts,ie),ue=Math.max(Ie.pts,ue)}J=b[F-1].dts;var nt=ge+4*oe+8,$e;try{$e=new Uint8Array(nt)}catch(At){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:nt,reason:"fail allocating video mdat "+nt});return}var Qe=new DataView($e.buffer);Qe.setUint32(0,nt),$e.set(U.default.types.mdat,4);for(var Fe=0;Fe<F;Fe++){for(var ut=b[Fe],lt=ut.units,je=0,We=0,Ce=lt.length;We<Ce;We++){var _e=lt[We],Te=_e.data,ae=_e.data.byteLength;Qe.setUint32(I,ae),I+=4,$e.set(Te,I),I+=ae,je+=4+ae}if(Fe<F-1)g=b[Fe+1].dts-ut.dts;else{var le=this.config,fe=ut.dts-b[Fe>0?Fe-1:Fe].dts;if(le.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(le.maxBufferHole*y),we=(C?ie+C*y:this.nextAudioPts)-ut.pts;we>me?(g=we-fe,g<0&&(g=fe),n.logger.log("[mp4-remuxer]: It is approximately "+we/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=fe}else g=fe}var Ue=Math.round(ut.pts-ut.dts);B.push(new E(ut.key,g,je,Ue))}if(B.length&&d&&d<70){var ze=B[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=N=J+g,this.isVideoContiguous=!0;var rt=U.default.moof(O.sequenceNumber++,W,m({},O,{samples:B})),pt="video",ct={data1:rt,data2:$e,startPTS:ie/y,endPTS:(ue+g)/y,startDTS:W/y,endDTS:N/y,type:pt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:O.dropped};return O.samples=[],O.dropped=0,console.assert($e.length,"MDAT length must not be zero"),ct},L.remuxAudio=function(O,S,f,C,y){var b=O.inputTimeScale,B=O.samplerate?O.samplerate:b,F=b/B,x=O.isAAC?u:l,N=x*F,I=this._initPTS,g=!O.isAAC&&this.typeSupported.mpeg,W=[],J=O.samples,ie=g?0:8,ue=this.nextAudioPts||-1,Re=S*b;if(this.isAudioContiguous=f=f||J.length&&ue>0&&(C&&Math.abs(Re-ue)<9e3||Math.abs(a(J[0].pts-I,Re)-ue)<20*N),J.forEach(function(Te){Te.pts=a(Te.pts-I,Re)}),!f||ue<0){if(J=J.filter(function(Te){return Te.pts>=0}),!J.length)return;y===0?ue=0:C?ue=Math.max(0,Re):ue=J[0].pts}if(O.isAAC)for(var ve=y!==void 0,Se=this.config.maxAudioFramesDrift,Le=0,be=ue;Le<J.length;Le++){var ce=J[Le],he=ce.pts,ne=he-be,de=Math.abs(1e3*ne/b);if(ne<=-Se*N&&ve)Le===0&&(n.logger.warn("Audio frame @ "+(he/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/b)+" ms."),this.nextAudioPts=ue=be=he);else if(ne>=Se*N&&de<p&&ve){var se=Math.round(ne/N);be=he-se*N,be<0&&(se--,be+=N),Le===0&&(this.nextAudioPts=ue=be),n.logger.warn("[mp4-remuxer]: Injecting "+se+" audio frame @ "+(be/b).toFixed(3)+"s due to "+Math.round(1e3*ne/b)+" ms gap.");for(var De=0;De<se;De++){var Ne=Math.max(be,0),Ae=j.default.getSilentFrame(O.manifestCodec||O.codec,O.channelCount);Ae||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ae=ce.unit.subarray()),J.splice(Le,0,{unit:Ae,pts:Ne}),be+=N,Le++}}ce.pts=be,be+=N}for(var Pe=null,Be=null,oe,ge=0,Oe=J.length;Oe--;)ge+=J[Oe].unit.byteLength;for(var Ie=0,He=J.length;Ie<He;Ie++){var Xe=J[Ie],qe=Xe.unit,Ze=Xe.pts;if(Be!==null){var nt=W[Ie-1];nt.duration=Math.round((Ze-Be)/F)}else if(f&&O.isAAC&&(Ze=ue),Pe=Ze,ge>0){ge+=ie;try{oe=new Uint8Array(ge)}catch(Te){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating audio mdat "+ge});return}if(!g){var $e=new DataView(oe.buffer);$e.setUint32(0,ge),oe.set(U.default.types.mdat,4)}}else return;oe.set(qe,ie);var Qe=qe.byteLength;ie+=Qe,W.push(new E(!0,x,Qe,0)),Be=Ze}var Fe=W.length;if(!Fe)return;var ut=W[W.length-1];this.nextAudioPts=ue=Be+F*ut.duration;var lt=g?new Uint8Array(0):U.default.moof(O.sequenceNumber++,Pe/F,m({},O,{samples:W}));O.samples=[];var je=Pe/b,We=ue/b,Ce="audio",_e={data1:lt,data2:oe,startPTS:je,endPTS:We,startDTS:je,endDTS:We,type:Ce,hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),_e},L.remuxEmptyAudio=function(O,S,f,C){var y=O.inputTimeScale,b=O.samplerate?O.samplerate:y,B=y/b,F=this.nextAudioPts,x=(F!==null?F:C.startDTS*y)+this._initDTS,N=C.endDTS*y+this._initDTS,I=B*u,g=Math.ceil((N-x)/I),W=j.default.getSilentFrame(O.manifestCodec||O.codec,O.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],ie=0;ie<g;ie++){var ue=x+ie*I;J.push({unit:W,pts:ue,dts:ue})}return O.samples=J,this.remuxAudio(O,S,f,!1)},L.remuxID3=function(O,S){var f=O.samples.length;if(!f)return;for(var C=O.inputTimeScale,y=this._initPTS,b=this._initDTS,B=0;B<f;B++){var F=O.samples[B];F.pts=a(F.pts-y,S*C)/C,F.dts=a(F.dts-b,S*C)/C}var x=O.samples;return O.samples=[],{samples:x}},L.remuxText=function(O,S){var f=O.samples.length;if(!f)return;for(var C=O.inputTimeScale,y=this._initPTS,b=0;b<f;b++){var B=O.samples[b];B.pts=a(B.pts-y,S*C)/C}O.samples.sort(function(x,N){return x.pts-N.pts});var F=O.samples;return O.samples=[],{samples:F}},D}();function a(D,L){var w;if(L===null)return D;for(L<D?w=-8589934592:w=8589934592;Math.abs(D-L)>4294967296;)D+=w;return D}function A(D){for(var L=0;L<D.length;L++)if(D[L].key)return L;return-1}var E=function(L,w,O,S){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=O,this.cts=S,this.flags=new T(L)},T=function(L){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=L?2:1,this.isNonSync=L?0:1}},"./src/remux/passthrough-remuxer.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),U=P("./src/loader/fragment.ts"),z=P("./src/utils/logger.ts"),G=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(u,l,d){this.audioCodec=l,this.videoCodec=d,this.generateInitSegment(u),this.emitInitSegment=!0},m.generateInitSegment=function(u){var l=this.audioCodec,d=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(j.parseInitSegment)(u);l||(l=R(o.audio,U.ElementaryStreamTypes.AUDIO)),d||(d=R(o.video,U.ElementaryStreamTypes.VIDEO));var h={};o.audio&&o.video?h.audiovideo={container:"video/mp4",codec:l+","+d,initSegment:u,id:"main"}:o.audio?h.audio={container:"audio/mp4",codec:l,initSegment:u,id:"audio"}:o.video?h.video={container:"video/mp4",codec:d,initSegment:u,id:"main"}:z.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},m.remux=function(u,l,d,o,h){var s=this.initPTS,a=this.lastEndDTS,A={audio:void 0,video:void 0,text:o,id3:d,initSegment:void 0};Object(Y.isFiniteNumber)(a)||(a=this.lastEndDTS=h||0);var E=l.samples;if(!E||!E.length)return A;var T={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(E),D=this.initData),!D||!D.length)return z.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(s)||(this.initPTS=T.initPTS=s=n(D,E,a));var L=Object(j.getDuration)(E,D),w=a,O=L+w;Object(j.offsetStartDTS)(D,E,s),L>0?this.lastEndDTS=O:(z.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var S=!!D.audio,f=!!D.video,C="";S&&(C+="audio"),f&&(C+="video");var y={data1:E,startPTS:w,startDTS:w,endPTS:O,endDTS:O,type:C,hasAudio:S,hasVideo:f,nb:1,dropped:0};return A.audio=y.type==="audio"?y:void 0,A.video=y.type!=="audio"?y:void 0,A.text=o,A.id3=d,A.initSegment=T,A},v}(),n=function(m,p,u){return Object(j.getStartDTS)(m,p)-u};function R(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=G},"./src/task-loop.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return Y});var Y=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=j.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},j}()},"./src/types/cmcd.ts":function(re,$,P){"use strict";P.r($),P.d($,"CMCDVersion",function(){return Y}),P.d($,"CMCDObjectType",function(){return j}),P.d($,"CMCDStreamingFormat",function(){return U}),P.d($,"CMCDStreamType",function(){return z});var Y=1,j;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(j||(j={}));var U;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(U||(U={}));var z;(function(G){G.VOD="v",G.LIVE="l"})(z||(z={}))},"./src/types/level.ts":function(re,$,P){"use strict";P.r($),P.d($,"HlsSkip",function(){return U}),P.d($,"getSkipValue",function(){return z}),P.d($,"HlsUrlParameters",function(){return G}),P.d($,"Level",function(){return n});function Y(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function j(R,v,m){return v&&Y(R.prototype,v),m&&Y(R,m),R}var U;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(U||(U={}));function z(R,v){var m=R.canSkipUntil,p=R.canSkipDateRanges,u=R.endSN,l=v!==void 0?v-u:0;return m&&l<m?p?U.v2:U.Yes:U.No}var G=function(){function R(m,p,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=u}var v=R.prototype;return v.addDirectives=function(p){var u=new self.URL(p);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},R}(),n=function(){function R(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return j(R,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),R}()},"./src/types/loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"PlaylistContextType",function(){return Y}),P.d($,"PlaylistLevelType",function(){return j});var Y;(function(U){U.MANIFEST="manifest",U.LEVEL="level",U.AUDIO_TRACK="audioTrack",U.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var j;(function(U){U.MAIN="main",U.AUDIO="audio",U.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"ChunkMetadata",function(){return Y});var Y=function(z,G,n,R,v,m){R===void 0&&(R=0),v===void 0&&(v=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=z,this.sn=G,this.id=n,this.size=R,this.part=v,this.partial=m};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(re,$,P){"use strict";P.r($),P.d($,"AttrList",function(){return U});var Y=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,U=function(){function z(n){typeof n=="string"&&(n=z.parseAttrList(n));for(var R in n)n.hasOwnProperty(R)&&(this[R]=n[R])}var G=z.prototype;return G.decimalInteger=function(R){var v=parseInt(this[R],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.hexadecimalInteger=function(R){if(this[R]){var v=(this[R]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},G.hexadecimalIntegerAsNumber=function(R){var v=parseInt(this[R],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(R){return parseFloat(this[R])},G.optionalFloat=function(R,v){var m=this[R];return m?parseFloat(m):v},G.enumeratedString=function(R){return this[R]},G.bool=function(R){return this[R]==="YES"},G.decimalResolution=function(R){var v=Y.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},z.parseAttrList=function(R){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(R))!==null;){var u=v[2];u.indexOf(p)===0&&u.lastIndexOf(p)===u.length-1&&(u=u.slice(1,-1)),m[v[1]]=u}return m},z}()},"./src/utils/binary-search.ts":function(re,$,P){"use strict";P.r($);var Y={search:function(U,z){for(var G=0,n=U.length-1,R=null,v=null;G<=n;){R=(G+n)/2|0,v=U[R];var m=z(v);if(m>0)G=R+1;else if(m<0)n=R-1;else return v}return null}};$.default=Y},"./src/utils/buffer-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"BufferHelper",function(){return U});var Y=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function z(){}return z.isBuffered=function(n,R){try{if(n){for(var v=z.getBuffered(n),m=0;m<v.length;m++)if(R>=v.start(m)&&R<=v.end(m))return!0}}catch(p){}return!1},z.bufferInfo=function(n,R,v){try{if(n){var m=z.getBuffered(n),p=[],u;for(u=0;u<m.length;u++)p.push({start:m.start(u),end:m.end(u)});return this.bufferedInfo(p,R,v)}}catch(l){}return{len:0,start:R,end:R,nextStart:void 0}},z.bufferedInfo=function(n,R,v){R=Math.max(0,R),n.sort(function(T,D){var L=T.start-D.start;return L||D.end-T.end});var m=[];if(v)for(var p=0;p<n.length;p++){var u=m.length;if(u){var l=m[u-1].end;n[p].start-l<v?n[p].end>l&&(m[u-1].end=n[p].end):m.push(n[p])}else m.push(n[p])}else m=n;for(var d=0,o,h=R,s=R,a=0;a<m.length;a++){var A=m[a].start,E=m[a].end;if(R+v>=A&&R<E)h=A,s=E,d=s-R;else if(R+v<A){o=A;break}}return{len:d,start:h||0,end:s||0,nextStart:o}},z.getBuffered=function(n){try{return n.buffered}catch(R){return Y.logger.log("failed to get media.buffered",R),j}},z}()},"./src/utils/cea-608-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"Row",function(){return s}),P.d($,"CaptionScreen",function(){return a});var Y=P("./src/utils/logger.ts"),j={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},U=function(O){var S=O;return j.hasOwnProperty(O)&&(S=j[O]),String.fromCharCode(S)},z=15,G=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(u||(u={}));var l=function(){function w(){this.time=null,this.verboseLevel=u.ERROR}var O=w.prototype;return O.log=function(f,C){this.verboseLevel>=f&&Y.logger.log(this.time+" ["+f+"] "+C)},w}(),d=function(O){for(var S=[],f=0;f<O.length;f++)S.push(O[f].toString(16));return S},o=function(){function w(S,f,C,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=S||"white",this.underline=f||!1,this.italics=C||!1,this.background=y||"black",this.flash=b||!1}var O=w.prototype;return O.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},O.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],y=0;y<C.length;y++){var b=C[y];f.hasOwnProperty(b)&&(this[b]=f[b])}},O.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},O.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},O.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},O.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),h=function(){function w(S,f,C,y,b,B){this.uchar=void 0,this.penState=void 0,this.uchar=S||" ",this.penState=new o(f,C,y,b,B)}var O=w.prototype;return O.reset=function(){this.uchar=" ",this.penState.reset()},O.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},O.setPenState=function(f){this.penState.copy(f)},O.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},O.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},O.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),s=function(){function w(S){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<G;f++)this.chars.push(new h);this.logger=S,this.pos=0,this.currPenState=new o}var O=w.prototype;return O.equals=function(f){for(var C=!0,y=0;y<G;y++)if(!this.chars[y].equals(f.chars[y])){C=!1;break}return C},O.copy=function(f){for(var C=0;C<G;C++)this.chars[C].copy(f.chars[C])},O.isEmpty=function(){for(var f=!0,C=0;C<G;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},O.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>G&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},O.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var y=this.pos+1;y<C+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(C)},O.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},O.insertChar=function(f){f>=144&&this.backSpace();var C=U(f);if(this.pos>=G){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},O.clearFromPos=function(f){var C;for(C=f;C<G;C++)this.chars[C].reset()},O.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},O.clearToEndOfRow=function(){this.clearFromPos(this.pos)},O.getTextString=function(){for(var f=[],C=!0,y=0;y<G;y++){var b=this.chars[y].uchar;b!==" "&&(C=!1),f.push(b)}return C?"":f.join("")},O.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.setPenState(this.currPenState)},w}(),a=function(){function w(S){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<z;f++)this.rows.push(new s(S));this.logger=S,this.currRow=z-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var O=w.prototype;return O.reset=function(){for(var f=0;f<z;f++)this.rows[f].clear();this.currRow=z-1},O.equals=function(f){for(var C=!0,y=0;y<z;y++)if(!this.rows[y].equals(f.rows[y])){C=!1;break}return C},O.copy=function(f){for(var C=0;C<z;C++)this.rows[C].copy(f.rows[C])},O.isEmpty=function(){for(var f=!0,C=0;C<z;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},O.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},O.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},O.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},O.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},O.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},O.setCursor=function(f){this.logger.log(u.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},O.setPAC=function(f){this.logger.log(u.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var y=0;y<z;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var F=B.rows[b].cueStartTime,x=this.logger.time;if(F&&x!==null&&F<x)for(var N=0;N<this.nrRollUpRows;N++)this.rows[C-this.nrRollUpRows+N+1].copy(B.rows[b+N])}}this.currRow=C;var I=this.rows[this.currRow];if(f.indent!==null){var g=f.indent,W=Math.max(g-1,0);I.setCursor(f.indent),f.color=I.chars[W].penState.foreground}var J={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(J)},O.setBkgData=function(f){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},O.setRollUpRows=function(f){this.nrRollUpRows=f},O.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(u.INFO,"Rolling up")},O.getDisplayText=function(f){f=f||!1;for(var C=[],y="",b=-1,B=0;B<z;B++){var F=this.rows[B].getTextString();F&&(b=B+1,f?C.push("Row "+b+": '"+F+"'"):C.push(F.trim()))}return C.length>0&&(f?y="["+C.join(" | ")+"]":y=C.join(`
|
|
`)),y},O.getTextAndFormat=function(){return this.rows},w}(),A=function(){function w(S,f,C){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=S,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new a(C),this.nonDisplayedMemory=new a(C),this.lastOutputScreen=new a(C),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var O=w.prototype;return O.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},O.getHandler=function(){return this.outputFilter},O.setHandler=function(f){this.outputFilter=f},O.setPAC=function(f){this.writeScreen.setPAC(f)},O.setBkgData=function(f){this.writeScreen.setBkgData(f)},O.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.INFO,"MODE="+f),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=f},O.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},O.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},O.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},O.ccAOF=function(){},O.ccAON=function(){},O.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},O.ccRU=function(f){this.logger.log(u.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},O.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},O.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},O.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},O.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},O.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},O.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},O.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},O.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},O.ccTO=function(f){this.logger.log(u.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},O.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var y=Math.floor(f/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=b[y]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},O.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},O.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},w}(),E=function(){function w(S,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new l;this.channels=[null,new A(S,f,y),new A(S+1,C,y)],this.cmdHistory=L(),this.logger=y}var O=w.prototype;return O.getHandler=function(f){return this.channels[f].getHandler()},O.setHandler=function(f,C){this.channels[f].setHandler(C)},O.addData=function(f,C){var y,b,B,F=!1;this.logger.time=f;for(var x=0;x<C.length;x+=2){if(b=C[x]&127,B=C[x+1]&127,b===0&&B===0)continue;if(this.logger.log(u.DATA,"["+d([C[x],C[x+1]])+"] -> ("+d([b,B])+")"),y=this.parseCmd(b,B),y||(y=this.parseMidrow(b,B)),y||(y=this.parsePAC(b,B)),y||(y=this.parseBackgroundAttributes(b,B)),!y&&(F=this.parseChars(b,B),F)){var N=this.currentChannel;if(N&&N>0){var I=this.channels[N];I.insertChars(F)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+d([b,B])+" orig: "+d([C[x],C[x+1]]))}},O.parseCmd=function(f,C){var y=this.cmdHistory,b=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,B=(f===23||f===31)&&C>=33&&C<=35;if(!(b||B))return!1;if(D(f,C,y))return T(null,null,y),this.logger.log(u.DEBUG,"Repeated command ("+d([f,C])+") is dropped"),!0;var F=f===20||f===21||f===23?1:2,x=this.channels[F];return f===20||f===21||f===28||f===29?C===32?x.ccRCL():C===33?x.ccBS():C===34?x.ccAOF():C===35?x.ccAON():C===36?x.ccDER():C===37?x.ccRU(2):C===38?x.ccRU(3):C===39?x.ccRU(4):C===40?x.ccFON():C===41?x.ccRDC():C===42?x.ccTR():C===43?x.ccRTD():C===44?x.ccEDM():C===45?x.ccCR():C===46?x.ccENM():C===47&&x.ccEOC():x.ccTO(C-32),T(f,C,y),this.currentChannel=F,!0},O.parseMidrow=function(f,C){var y=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(C),this.logger.log(u.DEBUG,"MIDROW ("+d([f,C])+")"),!0):!1}return!1},O.parsePAC=function(f,C){var y,b=this.cmdHistory,B=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,F=(f===16||f===24)&&C>=64&&C<=95;if(!(B||F))return!1;if(D(f,C,b))return T(null,null,b),!0;var x=f<=23?1:2;C>=64&&C<=95?y=x===1?n[f]:v[f]:y=x===1?R[f]:m[f];var N=this.channels[x];return N?(N.setPAC(this.interpretPAC(y,C)),T(f,C,b),this.currentChannel=x,!0):!1},O.interpretPAC=function(f,C){var y,b={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?y=C-96:y=C-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},O.parseChars=function(f,C){var y,b=null,B=null;if(f>=25?(y=2,B=f-8):(y=1,B=f),B>=17&&B<=19){var F;B===17?F=C+80:B===18?F=C+112:F=C+144,this.logger.log(u.INFO,"Special char '"+U(F)+"' in channel "+y),b=[F]}else f>=32&&f<=127&&(b=C===0?[f]:[f,C]);if(b){var x=d(b);this.logger.log(u.DEBUG,"Char codes = "+x.join(",")),T(f,C,this.cmdHistory)}return b},O.parseBackgroundAttributes=function(f,C){var y=(f===16||f===24)&&C>=32&&C<=47,b=(f===23||f===31)&&C>=45&&C<=47;if(!(y||b))return!1;var B,F={};f===16||f===24?(B=Math.floor((C-32)/2),F.background=p[B],C%2===1&&(F.background=F.background+"_semi")):C===45?F.background="transparent":(F.foreground="black",C===47&&(F.underline=!0));var x=f<=23?1:2,N=this.channels[x];return N.setBkgData(F),T(f,C,this.cmdHistory),!0},O.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=L()},O.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var y=this.channels[C];y&&y.cueSplitAtTime(f)}},w}();function T(w,O,S){S.a=w,S.b=O}function D(w,O,S){return S.a===w&&S.b===O}function L(){return{a:null,b:null}}$.default=E},"./src/utils/codecs.ts":function(re,$,P){"use strict";P.r($),P.d($,"isCodecType",function(){return j}),P.d($,"isCodecSupportedInMp4",function(){return U});var Y={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function j(z,G){var n=Y[G];return!!n&&n[z.slice(0,4)]===!0}function U(z,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+z+'"')}},"./src/utils/cues.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),U=P("./src/utils/texttrack-utils.ts"),z=/\s/,G={newCue:function(R,v,m,p){for(var u=[],l,d,o,h,s,a=self.VTTCue||self.TextTrackCue,A=0;A<p.rows.length;A++)if(l=p.rows[A],o=!0,h=0,s="",!l.isEmpty()){for(var E=0;E<l.chars.length;E++)z.test(l.chars[E].uchar)&&o?h++:(s+=l.chars[E].uchar,o=!1);l.cueStartTime=v,v===m&&(m+=1e-4),h>=16?h--:h++;var T=Object(Y.fixLineBreaks)(s.trim()),D=Object(j.generateCueId)(v,m,T);(!R||!R.cues||!R.cues.getCueById(D))&&(d=new a(v,m,T),d.id=D,d.line=A+1,d.align="left",d.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(d))}return R&&u.length&&(u.sort(function(L,w){return L.line==="auto"||w.line==="auto"?0:L.line>8&&w.line>8?w.line-L.line:L.line-w.line}),u.forEach(function(L){return Object(U.addCueToTrack)(R,L)})),u}};$.default=G},"./src/utils/discontinuities.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFirstFragWithCC",function(){return z}),P.d($,"shouldAlignOnDiscontinuities",function(){return G}),P.d($,"findDiscontinuousReferenceFrag",function(){return n}),P.d($,"adjustSlidingStart",function(){return v}),P.d($,"alignStream",function(){return m}),P.d($,"alignPDT",function(){return u}),P.d($,"alignFragmentByPDTDelta",function(){return l}),P.d($,"alignMediaPlaylistByPDT",function(){return d});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),U=P("./src/controller/level-helper.ts");function z(o,h){for(var s=null,a=0,A=o.length;a<A;a++){var E=o[a];if(E&&E.cc===h){s=E;break}}return s}function G(o,h,s){return!!(h.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function n(o,h){var s=o.fragments,a=h.fragments;if(!a.length||!s.length){j.logger.log("No fragments to align");return}var A=z(s,a[0].cc);if(!A||A&&!A.startPTS){j.logger.log("No frag in previous level to align on");return}return A}function R(o,h){if(o){var s=o.start+h;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function v(o,h){for(var s=h.fragments,a=0,A=s.length;a<A;a++)R(s[a],o);h.fragmentHint&&R(h.fragmentHint,o),h.alignedSliding=!0}function m(o,h,s){if(!h)return;p(o,s,h),!s.alignedSliding&&h.details&&u(s,h.details),!s.alignedSliding&&h.details&&!s.skippedSegments&&Object(U.adjustSliding)(h.details,s)}function p(o,h,s){if(G(o,s,h)){var a=n(s.details,h);a&&Object(Y.isFiniteNumber)(a.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),v(a.start,h))}}function u(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=o.fragments[0].programDateTime,A=(a-s)/1e3+h.fragments[0].start;A&&Object(Y.isFiniteNumber)(A)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+A.toFixed(3)+" "+o.url+" "),v(A,o))}function l(o,h){var s=o.programDateTime;if(!s)return;var a=(s-h)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function d(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=h.fragments[0].start,A=s-a*1e3;o.fragments.forEach(function(E){l(E,A)}),o.fragmentHint&&l(o.fragmentHint,A),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/utils/ewma.ts"),j=function(){function U(G,n,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(G),this.fast_=new Y.default(n)}var z=U.prototype;return z.update=function(n,R){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new Y.default(n,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new Y.default(R,m.getEstimate(),m.getTotalWeight()))},z.sample=function(n,R){n=Math.max(n,this.minDelayMs_);var v=8*R,m=n/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},z.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},z.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},z.destroy=function(){},U}();$.default=j},"./src/utils/ewma.ts":function(re,$,P){"use strict";P.r($);var Y=function(){function j(z,G,n){G===void 0&&(G=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=z,this.alpha_=z?Math.exp(Math.log(.5)/z):0,this.estimate_=G,this.totalWeight_=n}var U=j.prototype;return U.sample=function(G,n){var R=Math.pow(this.alpha_,G);this.estimate_=n*(1-R)+R*this.estimate_,this.totalWeight_+=G},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},j}();$.default=Y},"./src/utils/fetch-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"fetchSupported",function(){return l});var Y=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),U=P("./src/demux/chunk-cache.ts");function z(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,m(a,A)}function G(a){var A=typeof Map=="function"?new Map:void 0;return G=function(T){if(T===null||!v(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(T))return A.get(T);A.set(T,D)}function D(){return n(T,arguments,p(this).constructor)}return D.prototype=Object.create(T.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,T)},G(a)}function n(a,A,E){return R()?n=Reflect.construct:n=function(D,L,w){var O=[null];O.push.apply(O,L);var S=Function.bind.apply(D,O),f=new S;return w&&m(f,w.prototype),f},n.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,A){return m=Object.setPrototypeOf||function(T,D){return T.__proto__=D,T},m(a,A)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},p(a)}function u(){return u=Object.assign||function(a){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(a[T]=E[T])}return a},u.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var d=function(){function a(E){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=E.fetchSetup||h,this.controller=new self.AbortController,this.stats=new j.LoadStats}var A=a.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(T,D,L){var w=this,O=this.stats;if(O.loading.start)throw new Error("Loader can only be used once.");O.loading.start=self.performance.now();var S=o(T,this.controller.signal),f=L.onProgress,C=T.responseType==="arraybuffer",y=C?"byteLength":"length";this.context=T,this.config=D,this.callbacks=L,this.request=this.fetchSetup(T,S),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),L.onTimeout(O,T,w.response)},D.timeout),self.fetch(this.request).then(function(b){if(w.response=w.loader=b,!b.ok){var B=b.status,F=b.statusText;throw new s(F||"fetch, bad network response",B,b)}return O.loading.first=Math.max(self.performance.now(),O.loading.start),O.total=parseInt(b.headers.get("Content-Length")||"0"),f&&Object(Y.isFiniteNumber)(D.highWaterMark)?w.loadProgressively(b,O,T,D.highWaterMark,f):C?b.arrayBuffer():b.text()}).then(function(b){var B=w.response;self.clearTimeout(w.requestTimeout),O.loading.end=Math.max(self.performance.now(),O.loading.first),O.loaded=O.total=b[y];var F={url:B.url,data:b};f&&!Object(Y.isFiniteNumber)(D.highWaterMark)&&f(O,T,b,B),L.onSuccess(F,O,T,B)}).catch(function(b){if(self.clearTimeout(w.requestTimeout),O.aborted)return;var B=b.code||0;L.onError({code:B,text:b.message},T,b.details)})},A.getCacheAge=function(){var T=null;if(this.response){var D=this.response.headers.get("age");T=D?parseFloat(D):null}return T},A.loadProgressively=function(T,D,L,w,O){w===void 0&&(w=0);var S=new U.default,f=T.body.getReader(),C=function y(){return f.read().then(function(b){if(b.done)return S.dataLength&&O(D,L,S.flush(),T),Promise.resolve(new ArrayBuffer(0));var B=b.value,F=B.length;return D.loaded+=F,F<w||S.dataLength?(S.push(B),S.dataLength>=w&&O(D,L,S.flush(),T)):O(D,L,B,T),y()}).catch(function(){return Promise.reject()})};return C()},a}();function o(a,A){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function h(a,A){return new self.Request(a.url,A)}var s=function(a){z(A,a);function A(E,T,D){var L;return L=a.call(this,E)||this,L.code=void 0,L.details=void 0,L.code=T,L.details=D,L}return A}(G(Error));$.default=d},"./src/utils/imsc1-ttml-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"IMSC1_CODEC",function(){return v}),P.d($,"parseIMSC1",function(){return l});var Y=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/utils/vttcue.ts"),z=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(w){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var f in S)Object.prototype.hasOwnProperty.call(S,f)&&(w[f]=S[f])}return w},R.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(w,O,S,f,C){var y=Object(Y.findBox)(new Uint8Array(w),["mdat"]);if(y.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],B=Object(z.utf8ArrayToStr)(new Uint8Array(w,b.start,b.end-b.start)),F=Object(G.toTimescaleFromScale)(O,1,S);try{f(d(B,F))}catch(x){C(x)}}function d(w,O){var S=new DOMParser,f=S.parseFromString(w,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(y).reduce(function(I,g){return I[g]=C.getAttribute("ttp:"+g)||y[g],I},{}),B=C.getAttribute("xml:space")!=="preserve",F=h(o(C,"styling","style")),x=h(o(C,"layout","region")),N=o(C,"body","[begin]");return[].map.call(N,function(I){var g=s(I,B);if(!g||!I.hasAttribute("begin"))return null;var W=T(I.getAttribute("begin"),b),J=T(I.getAttribute("dur"),b),ie=T(I.getAttribute("end"),b);if(W===null)throw E(I);if(ie===null){if(J===null)throw E(I);ie=W+J}var ue=new U.default(W-O,ie-O,g);ue.id=Object(n.generateCueId)(ue.startTime,ue.endTime,ue.text);var Re=x[I.getAttribute("region")],ve=F[I.getAttribute("style")];ue.position=10,ue.size=80;var Se=a(Re,ve),Le=Se.textAlign;if(Le){var be=u[Le];be&&(ue.lineAlign=be),ue.align=Le}return R(ue,Se),ue}).filter(function(I){return I!==null})}function o(w,O,S){var f=w.getElementsByTagName(O)[0];return f?[].slice.call(f.querySelectorAll(S)):[]}function h(w){return w.reduce(function(O,S){var f=S.getAttribute("xml:id");return f&&(O[f]=S),O},{})}function s(w,O){return[].slice.call(w.childNodes).reduce(function(S,f,C){var y;return f.nodeName==="br"&&C?S+`
|
|
`:(y=f.childNodes)!==null&&y!==void 0&&y.length?s(f,O):O?S+f.textContent.trim().replace(/\s+/g," "):S+f.textContent},"")}function a(w,O){var S="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,y){var b=A(O,S,y)||A(w,S,y);return b&&(C[y]=b),C},{})}function A(w,O,S){return w.hasAttributeNS(O,S)?w.getAttributeNS(O,S):null}function E(w){return new Error("Could not parse ttml timestamp "+w)}function T(w,O){if(!w)return null;var S=Object(j.parseTimeStamp)(w);return S===null&&(m.test(w)?S=D(w,O):p.test(w)&&(S=L(w,O))),S}function D(w,O){var S=m.exec(w),f=(S[4]|0)+(S[5]|0)/O.subFrameRate;return(S[1]|0)*3600+(S[2]|0)*60+(S[3]|0)+f/O.frameRate}function L(w,O){var S=p.exec(w),f=Number(S[1]),C=S[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/O.frameRate;case"t":return f/O.tickRate}return f}},"./src/utils/logger.ts":function(re,$,P){"use strict";P.r($),P.d($,"enableLogs",function(){return n}),P.d($,"logger",function(){return R});var Y=function(){},j={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},U=j;function z(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):Y}function G(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),u=1;u<m;u++)p[u-1]=arguments[u];p.forEach(function(l){U[l]=v[l]?v[l].bind(v):z(l)})}function n(v){if(self.console&&v===!0||typeof v=="object"){G(v,"debug","log","info","warn","error");try{U.log()}catch(m){U=j}}else U=j}var R=U},"./src/utils/mediakeys-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"KeySystems",function(){return Y}),P.d($,"requestMediaKeySystemAccess",function(){return j});var Y;(function(U){U.WIDEVINE="com.widevine.alpha",U.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(re,$,P){"use strict";P.r($),P.d($,"bin2str",function(){return G}),P.d($,"readUint16",function(){return n}),P.d($,"readUint32",function(){return R}),P.d($,"writeUint32",function(){return v}),P.d($,"findBox",function(){return m}),P.d($,"parseSegmentIndex",function(){return p}),P.d($,"parseInitSegment",function(){return u}),P.d($,"getStartDTS",function(){return l}),P.d($,"getDuration",function(){return d}),P.d($,"computeRawDurationFromSamples",function(){return o}),P.d($,"offsetStartDTS",function(){return h}),P.d($,"segmentValidRange",function(){return s}),P.d($,"appendUint8Array",function(){return a});var Y=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),U=Math.pow(2,32)-1,z=[].push;function G(A){return String.fromCharCode.apply(null,A)}function n(A,E){"data"in A&&(E+=A.start,A=A.data);var T=A[E]<<8|A[E+1];return T<0?65536+T:T}function R(A,E){"data"in A&&(E+=A.start,A=A.data);var T=A[E]<<24|A[E+1]<<16|A[E+2]<<8|A[E+3];return T<0?4294967296+T:T}function v(A,E,T){"data"in A&&(E+=A.start,A=A.data),A[E]=T>>24,A[E+1]=T>>16&255,A[E+2]=T>>8&255,A[E+3]=T&255}function m(A,E){var T=[];if(!E.length)return T;var D,L,w;"data"in A?(D=A.data,L=A.start,w=A.end):(D=A,L=0,w=D.byteLength);for(var O=L;O<w;){var S=R(D,O),f=G(D.subarray(O+4,O+8)),C=S>1?O+S:w;if(f===E[0])if(E.length===1)T.push({data:D,start:O+8,end:C});else{var y=m({data:D,start:O+8,end:C},E.slice(1));y.length&&z.apply(T,y)}O=C}return T}function p(A){var E=m(A,["moov"]),T=E[0],D=T?T.end:null,L=m(A,["sidx"]);if(!L||!L[0])return null;var w=[],O=L[0],S=O.data[0],f=S===0?8:16,C=R(O,f);f+=4;var y=0,b=0;S===0?f+=8:f+=16,f+=2;var B=O.end+b,F=n(O,f);f+=2;for(var x=0;x<F;x++){var N=f,I=R(O,N);N+=4;var g=I&2147483647,W=(I&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=R(O,N);N+=4,w.push({referenceSize:g,subsegmentDuration:J,info:{duration:J/C,start:B,end:B+g-1}}),B+=g,N+=4,f=N}return{earliestPresentationTime:y,timescale:C,version:S,referencesCount:F,references:w,moovEndOffset:D}}function u(A){for(var E=[],T=m(A,["moov","trak"]),D=0;D<T.length;D++){var L=T[D],w=m(L,["tkhd"])[0];if(w){var O=w.data[w.start],S=O===0?12:20,f=R(w,S),C=m(L,["mdia","mdhd"])[0];if(C){O=C.data[C.start],S=O===0?12:20;var y=R(C,S),b=m(L,["mdia","hdlr"])[0];if(b){var B=G(b.data.subarray(b.start+8,b.start+12)),F={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[B];if(F){var x=m(L,["mdia","minf","stbl","stsd"])[0],N=void 0;x&&(N=G(x.data.subarray(x.start+12,x.start+16))),E[f]={timescale:y,type:F},E[F]={timescale:y,id:f,codec:N}}}}}}var I=m(A,["moov","mvex","trex"]);return I.forEach(function(g){var W=R(g,4),J=E[W];J&&(J.default={duration:R(g,12),flags:R(g,20)})}),E}function l(A,E){return m(E,["moof","traf"]).reduce(function(T,D){var L=m(D,["tfdt"])[0],w=L.data[L.start],O=m(D,["tfhd"]).reduce(function(S,f){var C=R(f,4),y=A[C];if(y){var b=R(L,4);w===1&&(b*=Math.pow(2,32),b+=R(L,8));var B=y.timescale||9e4,F=b/B;if(isFinite(F)&&(S===null||F<S))return F}return S},null);return O!==null&&isFinite(O)&&(T===null||O<T)?O:T},null)||0}function d(A,E){for(var T=0,D=0,L=0,w=m(A,["moof","traf"]),O=0;O<w.length;O++){var S=w[O],f=m(S,["tfhd"])[0],C=R(f,4),y=E[C];if(!y)continue;var b=y.default,B=R(f,0)|(b==null?void 0:b.flags),F=b==null?void 0:b.duration;B&8&&(B&2?F=R(f,12):F=R(f,8));for(var x=y.timescale||9e4,N=m(S,["trun"]),I=0;I<N.length;I++){if(F){var g=R(N[I],4);T=F*g}else T=o(N[I]);y.type===j.ElementaryStreamTypes.VIDEO?D+=T/x:y.type===j.ElementaryStreamTypes.AUDIO&&(L+=T/x)}}if(D===0&&L===0){var W=p(A);if(W!=null&&W.references)return W.references.reduce(function(J,ie){return J+ie.info.duration||0},0)}return D||L}function o(A){var E=R(A,0),T=8;E&1&&(T+=4),E&4&&(T+=4);for(var D=0,L=R(A,4),w=0;w<L;w++){if(E&256){var O=R(A,T);D+=O,T+=4}E&512&&(T+=4),E&1024&&(T+=4),E&2048&&(T+=4)}return D}function h(A,E,T){m(E,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(L){var w=R(L,4),O=A[w];if(!O)return;var S=O.timescale||9e4;m(D,["tfdt"]).forEach(function(f){var C=f.data[f.start],y=R(f,4);if(C===0)v(f,4,y-T*S);else{y*=Math.pow(2,32),y+=R(f,8),y-=T*S,y=Math.max(y,0);var b=Math.floor(y/(U+1)),B=Math.floor(y%(U+1));v(f,4,b),v(f,8,B)}})})})}function s(A){var E={valid:null,remainder:null},T=m(A,["moof"]);if(T){if(T.length<2)return E.remainder=A,E}else return E;var D=T[T.length-1];return E.valid=Object(Y.sliceUint8)(A,0,D.start-8),E.remainder=Object(Y.sliceUint8)(A,D.start-8),E}function a(A,E){var T=new Uint8Array(A.length+E.length);return T.set(A),T.set(E,A.length),T}},"./src/utils/output-filter.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return Y});var Y=function(){function j(z,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=z,this.trackName=G}var U=j.prototype;return U.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},U.newCue=function(G,n,R){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=n,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(re,$,P){"use strict";P.r($),P.d($,"sendAddTrackEvent",function(){return j}),P.d($,"addCueToTrack",function(){return U}),P.d($,"clearCurrentCues",function(){return z}),P.d($,"removeCuesInRange",function(){return G}),P.d($,"getCuesInRange",function(){return R});var Y=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(u){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function U(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(l){Y.logger.debug("[texttrack-utils]: "+l);var u=new self.TextTrackCue(m.startTime,m.endTime,m.text);u.id=m.id,v.addCue(u)}p==="disabled"&&(v.mode=p)}function z(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function G(v,m,p){var u=v.mode;if(u==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var l=R(v.cues,m,p),d=0;d<l.length;d++)v.removeCue(l[d]);u==="disabled"&&(v.mode=u)}function n(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var u=0,l=p;u<=l;){var d=Math.floor((l+u)/2);if(m<v[d].startTime)l=d-1;else if(m>v[d].startTime&&u<p)u=d+1;else return d}return v[u].startTime-m<m-v[l].startTime?u:l}function R(v,m,p){var u=[],l=n(v,m);if(l>-1)for(var d=l,o=v.length;d<o;d++){var h=v[d];if(h.startTime>=m&&h.endTime<=p)u.push(h);else if(h.startTime>p)return u}return u}},"./src/utils/time-ranges.ts":function(re,$,P){"use strict";P.r($);var Y={toString:function(U){for(var z="",G=U.length,n=0;n<G;n++)z+="["+U.start(n).toFixed(3)+","+U.end(n).toFixed(3)+"]";return z}};$.default=Y},"./src/utils/timescale-conversion.ts":function(re,$,P){"use strict";P.r($),P.d($,"toTimescaleFromBase",function(){return j}),P.d($,"toTimescaleFromScale",function(){return U}),P.d($,"toMsFromMpegTsClock",function(){return z}),P.d($,"toMpegTsClockFromTimescale",function(){return G});var Y=9e4;function j(n,R,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=n*R*v;return m?Math.round(p):p}function U(n,R,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),j(n,R,1/v,m)}function z(n,R){return R===void 0&&(R=!1),j(n,1e3,1/Y,R)}function G(n,R){return R===void 0&&(R=1),j(n,Y,1/R)}},"./src/utils/typed-array.ts":function(re,$,P){"use strict";P.r($),P.d($,"sliceUint8",function(){return Y});function Y(j,U,z){return Uint8Array.prototype.slice?j.slice(U,z):new Uint8Array(Array.prototype.slice.call(j,U,z))}},"./src/utils/vttcue.ts":function(re,$,P){"use strict";P.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],j=["start","middle","end","left","right"];function U(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function z(v){return U(Y,v)}function G(v){return U(j,v)}function n(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),u=1;u<m;u++)p[u-1]=arguments[u];for(var l=1;l<arguments.length;l++){var d=arguments[l];for(var o in d)v[o]=d[o]}return v}function R(v,m,p){var u=this,l={enumerable:!0};u.hasBeenReset=!1;var d="",o=!1,h=v,s=m,a=p,A=null,E="",T=!0,D="auto",L="start",w=50,O="middle",S=50,f="middle";Object.defineProperty(u,"id",n({},l,{get:function(){return d},set:function(y){d=""+y}})),Object.defineProperty(u,"pauseOnExit",n({},l,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(u,"startTime",n({},l,{get:function(){return h},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");h=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",n({},l,{get:function(){return s},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",n({},l,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",n({},l,{get:function(){return A},set:function(y){A=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",n({},l,{get:function(){return E},set:function(y){var b=z(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",n({},l,{get:function(){return T},set:function(y){T=!!y,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",n({},l,{get:function(){return D},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",n({},l,{get:function(){return L},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");L=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",n({},l,{get:function(){return w},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");w=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",n({},l,{get:function(){return O},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",n({},l,{get:function(){return S},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",n({},l,{get:function(){return f},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");f=b,this.hasBeenReset=!0}})),u.displayState=void 0}return R.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(re,$,P){"use strict";P.r($),P.d($,"parseTimeStamp",function(){return U}),P.d($,"fixLineBreaks",function(){return m}),P.d($,"VTTParser",function(){return p});var Y=P("./src/utils/vttcue.ts"),j=function(){function u(){}var l=u.prototype;return l.decode=function(o,h){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},u}();function U(u){function l(o,h,s,a){return(o|0)*3600+(h|0)*60+(s|0)+parseFloat(a||0)}var d=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?l(d[2],d[3],0,d[4]):l(d[1],d[2],d[3],d[4]):null}var z=function(){function u(){this.values=Object.create(null)}var l=u.prototype;return l.set=function(o,h){!this.get(o)&&h!==""&&(this.values[o]=h)},l.get=function(o,h,s){return s?this.has(o)?this.values[o]:h[s]:this.has(o)?this.values[o]:h},l.has=function(o){return o in this.values},l.alt=function(o,h,s){for(var a=0;a<s.length;++a)if(h===s[a]){this.set(o,h);break}},l.integer=function(o,h){/^-?\d+$/.test(h)&&this.set(o,parseInt(h,10))},l.percent=function(o,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var s=parseFloat(h);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},u}();function G(u,l,d,o){var h=o?u.split(o):[u];for(var s in h){if(typeof h[s]!="string")continue;var a=h[s].split(d);if(a.length!==2)continue;var A=a[0],E=a[1];l(A,E)}}var n=new Y.default(0,0,""),R=n.align==="middle"?"middle":"center";function v(u,l,d){var o=u;function h(){var A=U(u);if(A===null)throw new Error("Malformed timestamp: "+o);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function s(A,E){var T=new z;G(A,function(w,O){var S;switch(w){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===O){T.set(w,d[f].region);break}break;case"vertical":T.alt(w,O,["rl","lr"]);break;case"line":S=O.split(","),T.integer(w,S[0]),T.percent(w,S[0])&&T.set("snapToLines",!1),T.alt(w,S[0],["auto"]),S.length===2&&T.alt("lineAlign",S[1],["start",R,"end"]);break;case"position":S=O.split(","),T.percent(w,S[0]),S.length===2&&T.alt("positionAlign",S[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":T.percent(w,O);break;case"align":T.alt(w,O,["start",R,"end","left","right"]);break}},/:/,/\s/),E.region=T.get("region",null),E.vertical=T.get("vertical","");var D=T.get("line","auto");D==="auto"&&n.line===-1&&(D=-1),E.line=D,E.lineAlign=T.get("lineAlign","start"),E.snapToLines=T.get("snapToLines",!0),E.size=T.get("size",100),E.align=T.get("align",R);var L=T.get("position","auto");L==="auto"&&n.position===50&&(L=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=L}function a(){u=u.replace(/^\s+/,"")}if(a(),l.startTime=h(),a(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);u=u.substr(3),a(),l.endTime=h(),a(),s(u,l)}function m(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=u.prototype;return l.parse=function(o){var h=this;o&&(h.buffer+=h.decoder.decode(o,{stream:!0}));function s(){var L=h.buffer,w=0;for(L=m(L);w<L.length&&L[w]!=="\r"&&L[w]!==`
|
|
`;)++w;var O=L.substr(0,w);return L[w]==="\r"&&++w,L[w]===`
|
|
`&&++w,h.buffer=L.substr(w),O}function a(L){G(L,function(w,O){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=s();var E=A.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var T=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;T?T=!1:A=s();switch(h.state){case"HEADER":/:/.test(A)?a(A):A||(h.state="ID");continue;case"NOTE":A||(h.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){h.state="NOTE";break}if(!A)continue;if(h.cue=new Y.default(0,0,""),h.state="CUE",A.indexOf("-->")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{v(A,h.cue,h.regionList)}catch(L){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var D=A.indexOf("-->")!==-1;if(!A||D&&(T=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=`
|
|
`),h.cue.text+=A}continue;case"BADCUE":A||(h.state="ID")}}}catch(L){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){o.onparsingerror&&o.onparsingerror(h)}return o.onflush&&o.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"generateCueId",function(){return p}),P.d($,"parseWebVTT",function(){return l});var Y=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/demux/id3.ts"),z=P("./src/utils/timescale-conversion.ts"),G=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,R=function(o,h,s){return s===void 0&&(s=0),o.substr(s,h.length)===h},v=function(o){var h=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),A=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(h)||!Object(Y.isFiniteNumber)(s)||!Object(Y.isFiniteNumber)(a)||!Object(Y.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return h+=1e3*s,h+=60*1e3*a,h+=60*60*1e3*A,h},m=function(o){for(var h=5381,s=o.length;s;)h=h*33^o.charCodeAt(--s);return(h>>>0).toString()};function p(d,o,h){return m(d.toString())+m(o.toString())+m(h)}var u=function(o,h,s){var a=o[h],A=o[a.prevCC];if(!A||!A.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(E=A)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=a.start-A.start,a.new=!1,a=A,A=o[a.prevCC]}o.presentationOffset=s};function l(d,o,h,s,a,A,E,T){var D=new j.VTTParser,L=Object(U.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),w=[],O=Object(z.toMpegTsClockFromTimescale)(o,h),S="00:00.000",f=0,C=0,y,b=!0,B=!1;D.oncue=function(F){var x=s[a],N=s.ccOffset,I=(f-O)/9e4;if(x!=null&&x.new&&(C!==void 0?N=s.ccOffset=x.start:u(s,a,I)),I&&(N=I-s.presentationOffset),B){var g=F.endTime-F.startTime,W=Object(G.normalizePts)((F.startTime+N-C)*9e4,A*9e4)/9e4;F.startTime=W,F.endTime=W+g}var J=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(J)),F.id||(F.id=p(F.startTime,F.endTime,J)),F.endTime>0&&w.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){T(y);return}E(w)},L.forEach(function(F){if(b)if(R(F,"X-TIMESTAMP-MAP=")){b=!1,B=!0,F.substr(16).split(",").forEach(function(x){R(x,"LOCAL:")?S=x.substr(6):R(x,"MPEGTS:")&&(f=parseInt(x.substr(7)))});try{C=v(S)/1e3}catch(x){B=!1,y=x}return}else F===""&&(b=!1);D.parse(F+`
|
|
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(re,$,P){"use strict";P.r($);var Y=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,z=function(){function G(R){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=R?R.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var n=G.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},n.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},n.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var l=this.xhrSetup;try{if(l)try{l(p,m.url)}catch(h){p.open("GET",m.url,!0),l(p,m.url)}p.readyState||p.open("GET",m.url,!0);var d=this.context.headers;if(d)for(var o in d)p.setRequestHeader(o,d[o])}catch(h){this.callbacks.onError({code:p.status,text:h.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},n.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var u=m.readyState,l=this.config;if(p.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),u===4){m.onreadystatechange=null,m.onprogress=null;var d=m.status;if(d>=200&&d<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,h;if(v.responseType==="arraybuffer"?(o=m.response,h=o.byteLength):(o=m.responseText,h=o.length),p.loaded=p.total=h,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,p,v,m)}else p.retry>=l.maxRetry||d>=400&&d<499?(Y.logger.error(d+" while loading "+v.url),this.callbacks.onError({code:d,text:m.statusText},v,m)):(Y.logger.warn(d+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,l.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},n.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},n.getCacheAge=function(){var v=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},G}();$.default=z}}).default})},vHTk:function(ot,xe,Z){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|