(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&&/$/,blockCommentStart:"",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;JJ&&(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;Re0,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;ve0&&(!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=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;u1&&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>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".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(//),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=0&&m=0&&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=0&&v/),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;Efunction(){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;$-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=H.length?ee.slice(H.length):ee}).join(` `)}var o=[],h=["
    "],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){o.length=0,h=["
      "]}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("
    • "+ee.text+""),_++;var V=[];return _=T(X,_,ee.level,V),V.length>0&&(H.push("
        "),V.forEach(function(Ee){H.push(Ee)}),H.push("
      ")),H.push("
    • "),_=T(X,_,k,H),_}function D(){return T(o,0,0,h),h.push("
    "),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?"

    ".concat(X,"

    "):'
    ').concat(k?X:Object(l.escape)(X,!0),`
    `):'
    '+(k?X:Object(l.escape)(X,!0))+"
    "},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}),"'+X+""},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]',"select"),this.addActionButton(H,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(H,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(H,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(H,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(H,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(H,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(H,'',"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='',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,'',"render"),this.addActionButton(ee,'',"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;k0&&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||'')||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=` `),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||'')||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||'')||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=` `;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='',_}(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='',_}(ut),je=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||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='',_}(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;vt0&&(it=!0,vtKe&&(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='',_}(qe),_e=function(X){function _(k,H,ee){var V=X.call(this,k,ee||'')||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=` `,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=` `,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='',_}(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='',_}(Ze),le=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||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='',_}(ae),me='',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,''),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.width/2&&this.tipPosition.y>=this.height/2?V.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='',_}(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='',_}(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='',_}(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;Hthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,H=k',_.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-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),ee1&&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]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''},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;kthis.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+Hthis.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.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=_-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.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('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){_.isGridVisible=!_.isGridVisible,ee.isActive=_.isGridVisible},k.addButton(ee);var V=new Ut('',"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='',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('',"OK");Ve.onClick=this.startRenderAndClose,vt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new Ut('',"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('',"Rotate left");H.onClick=this.rotateLeftButtonClicked,k.addButton(H);var ee=new Ut('',"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('',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ke);var it=new Ut('',"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=/]*>/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("

    [TOC]

    ",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;pu.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?` `:"")+"",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?"/":""&&(A+=">"),m[d]=A}if(n.replaceSelections(m),v=n.listSelections(),!l)for(var d=0;d=0&&R[o]==v;o--)++d;m=l.to;for(var o=1;o0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;vU,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=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.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 ?/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;tt1||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/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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\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=//,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",")|<(?: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",")|<(?: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",")|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.pedantic=be({},ce.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\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-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",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]*?(?:(?=[\\.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;we0)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?'
    '+(fe?ae:ge(ae,!0))+`
    `:"
    "+(fe?ae:ge(ae,!0))+`
    `},_e.blockquote=function(ae){return`
    `+ae+`
    `},_e.html=function(ae){return ae},_e.heading=function(ae,le,fe,me){return this.options.headerIds?"'+ae+" `:""+ae+" `},_e.hr=function(){return this.options.xhtml?`
    `:`
    `},_e.list=function(ae,le,fe){var me=le?"ol":"ul",we=le&&fe!==1?' start="'+fe+'"':"";return"<"+me+we+`> `+ae+" `},_e.listitem=function(ae){return"
  • "+ae+`
  • `},_e.checkbox=function(ae){return" "},_e.paragraph=function(ae){return"

    "+ae+`

    `},_e.table=function(ae,le){return le&&(le=""+le+""),` `+ae+` `+le+`
    `},_e.tablerow=function(ae){return` `+ae+` `},_e.tablecell=function(ae,le){var fe=le.header?"th":"td",me=le.align?"<"+fe+' align="'+le.align+'">':"<"+fe+">";return me+ae+" `},_e.strong=function(ae){return""+ae+""},_e.em=function(ae){return""+ae+""},_e.codespan=function(ae){return""+ae+""},_e.br=function(){return this.options.xhtml?"
    ":"
    "},_e.del=function(ae){return""+ae+""},_e.link=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='",me},_e.image=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me=''+fe+'":">",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;me0&&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+1An error occurred:

    "+Qe(Ue.message+"",!0)+"
    ";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`,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=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;s0;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=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;F0&&(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=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;vea.length&&(E=a.length);AT===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;ae1&&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{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{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=0;Oe--){const Ie=oe.charCodeAt(Oe);if(Ie!==32&&Ie!==9)return Oe}return-1}function h(oe,ge){return oege?1:0}function s(oe,ge,Oe=0,Ie=oe.length,He=0,Xe=ge.length){for(;Oe$e)return 1}const qe=Ie-Oe,Ze=Xe-He;return qeZe?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=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 qeZe?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;Oe1){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=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=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),oege[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("![,](/api/attachments/".concat(jt.id,"?type=").concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?H.replaceSelection('')):jt.content_type.indexOf("pdf")>-1?H.replaceSelection('
    ').concat(jt.name,"")):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("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(ci)?yt.replaceSelection('').concat(Nt.name,"")):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("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(ci)?yt.replaceSelection('').concat(Nt.name,"")):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;jt0||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);wt0){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(`
    `),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(jt," ]( ").concat(Qt,' "').concat(jt,'" )')):H.replaceSelection("![,](".concat(Qt,")")),H.focus();case Xe:for(var cn=yt.row,Mn=yt.col,Nt=yt.align,ci=` `,zt=0;zt300&&(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;ge122||(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;Weme[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=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=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=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=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*]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[S,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\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="
    "+Ae+"
    ",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;He0){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))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.keyx.key)return 1;const N=this.regexp?this.regexp.source:"",I=x.regexp?x.regexp.source:"";return NI?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;Ix.expr.length)return 1;for(let N=0,I=this.expr.length;N1;){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.lengthx.expr.length)return 1;for(let N=0,I=this.expr.length;Nx.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 xN?1:0}function b(x,N,I,g){return xI?1:Ng?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=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;u1&&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=0&&m=0&&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||w0&&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._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` ${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)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=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"\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:tr?-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;Mt||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;ct)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-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;c0}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.post},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.lastColumnPos0?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=e.first&&tr?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;ithis.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;Meke&&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(;Yee.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&&tet.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.pose.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(;qK;--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.highlightFrontierr;i--){var c=mt(e,i).stateAfter;if(c&&(!(c instanceof ee)||i+c.lookAhead=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=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.from0&&Q)for(var ft=0;ft0)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;rt)&&(!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=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;ct.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;cte&&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;Kq||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=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;M2&&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;ir)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=r.lineN&&tt)&&(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=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+Q0&&(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=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=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=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=Yeet)&&(pe=ke,ye=et)}return pe||(pe=c[c.length-1]),pe.fromte&&(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;K0&&(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;it)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)mn&&dr(e.doc,t)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=c.lineN&&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;q0){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.viewFromr&&(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=e.display.viewTo||Q.to().line0?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.005||pe<-.005)&&(en(c.line,K),ys(c.line),c.rest))for(var ye=0;yee.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=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.topQ-i;if(t.topc+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.leftke+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.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=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&&Mer)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=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.viewFromK&&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-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;KK.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=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;M0: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;i1&&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;Q1&&!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-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=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=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=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;ie.lastLine())return;if(t.from.lineM&&(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){r1||!(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;t50){for(var K=c.lines.length%25+25,Q=K;Q10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;ie.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;c0||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=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.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=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;ie)return t=e,!0;e-=M,++r}),_(this,Je(r,t))},indexFromPos:function(e){e=_(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-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=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=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&&at0==(Ct.level!=1),kt=Et?st.begin:Q(st.end,-1);if(Ct.from<=kt&&kt0?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.line0)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;ie&&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.lineke.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=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;Q20*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(MeK,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=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-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;iM&&(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;ye0&&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&&(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;te0&&pe(M.charAt(K-1));)--K;for(;Q.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+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&&Ro(t,i)||{node:Q[0].measure.map[2],offset:0},te=c.linee.firstLine()&&(i=Je(i.line-1,mt(e.doc,i.line-1).length)),c.ch==mt(e.doc,c.line).text.length&&c.linet.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);kei.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=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);K1e3||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 ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].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;J0||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(xt0||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.clientHeightm||d>v&&o=m&&h>=p?d-v-u:o>m&&hp?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=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+(de1&&(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>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;geNe&&(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;f1?ie-1:0),Re=1;Re1?I-1:0),W=1;W=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"&&ie1&&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:(xF&&(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||WI.max?W=I.max:W=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;xF.length)&&(x=F.length);for(var N=0,I=new Array(x);N=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=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;xF.length)&&(x=F.length);for(var N=0,I=new Array(x);N=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=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=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=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:"",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;d1&&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=0&&u=0&&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=0&&p/),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.newlines0);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(/^(|]]>)$/.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("]*)/),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(//),cdata:L.starting_with(//),conditional_comment:L.starting_with(//),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("","ig"))}else this._is_content_unformatted(w)&&(L=this._input.readUntil(new RegExp("","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{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{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);l0},!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=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=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||g0&&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&&veue||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=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;su.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-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;fJ;(N0&&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=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-1&&BB.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(yb-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=N-b.maxFragLookUpTolerance&&x<=I;if(F!==null&&B.duration>F&&(x"+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"+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;R0&&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=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=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);os&&(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;DR){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;dv&&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.ccm?-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=T&&a<=D){o.time.push({startPTS:Math.max(h,d.start(E)),endPTS:Math.min(s,d.end(E))});break}else if(hT)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=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;Ep&&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=A&&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;s0){O=D[0].bitrate,D.sort(function(N,I){return N.bitrate-I.bitrate}),this._levels=D;for(var B=0;Bthis.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.loadError1){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;O0){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||bs.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=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=E.length)return;l(a,E[A].start)}function l(s,a){if(a){for(var A=s.fragments,E=s.skippedSegments;E0&&T0&&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&&S0&&(b1&&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=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=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-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=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=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>>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>>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)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;on?(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<>>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;p0?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>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;o0},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=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;J0&&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>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;ne16){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=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=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;B1;){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;xI){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.ptsO)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>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;vm.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;v2){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-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>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>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>>8&255),n.push(p&255),n=n.concat(Array.prototype.slice.call(m));for(v=0;v>>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>>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;L0?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;bece.pts){var he=9e4*.2;Re=Math.max(Math.min(Re,ce.pts-ce.dts),-1*he)}ce.dts0?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(Rene,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;Oe0?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=Se*N&&de0){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;ie4294967296;)D+=w;return D}function A(D){for(var L=0;L0?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;mNumber.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;pNumber.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.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;ul&&(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=A&&R=f&&Y.logger.log(this.time+" ["+f+"] "+C)},w}(),d=function(O){for(var S=[],f=0;fG&&(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=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;C0&&(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=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 ("+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=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;as.startCC||o&&o.cc=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=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"):Y}function G(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),u=1;u>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;O1?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>>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;DG)&&(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;dv[p].endTime)return-1;for(var u=0,l=p;u<=l;){var d=Math.floor((l+u)/2);if(mv[d].startTime&&u-1)for(var d=l,o=v.length;d=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;n1?m-1:0),u=1;u100)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=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(//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")===-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"}}}]);