You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__User__Detail__Topics__Po...

403 lines
923 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[279,5,7],{"+ua5":function(Ze,le,K){},"/cxE":function(Ze,le,K){"use strict";K.d(le,"f",function(){return A}),K.d(le,"g",function(){return B}),K.d(le,"h",function(){return C}),K.d(le,"e",function(){return H}),K.d(le,"b",function(){return U}),K.d(le,"c",function(){return e}),K.d(le,"d",function(){return R}),K.d(le,"a",function(){return p});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(d){setTimeout(()=>{throw d.stack?new Error(d.message+`
`+d.stack):d},0)}}emit(d){this.listeners.forEach(l=>{l(d)})}onUnexpectedError(d){this.unexpectedErrorHandler(d),this.emit(d)}onUnexpectedExternalError(d){this.unexpectedErrorHandler(d)}}const j=new te;function A(d){H(d)||j.onUnexpectedError(d);return}function B(d){H(d)||j.onUnexpectedExternalError(d);return}function C(d){if(d instanceof Error){let{name:l,message:n}=d;const o=d.stacktrace||d.stack;return{$isError:!0,name:l,message:n,stack:o}}return d}const I="Canceled";function H(d){return d instanceof Error&&d.name===I&&d.message===I}function U(){const d=new Error(I);return d.name=d.message,d}function e(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function R(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class p extends Error{constructor(d){super("NotSupported");d&&(this.message=d)}}},"24hK":function(Ze,le,K){"use strict";K.d(le,"a",function(){return j});class te{constructor(A){this.element=A,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class j{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let A=this._first;for(;A!==te.Undefined;){const B=A.next;A.prev=te.Undefined,A.next=te.Undefined,A=B}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(A){return this._insert(A,!1)}push(A){return this._insert(A,!0)}_insert(A,B){const C=new te(A);if(this._first===te.Undefined)this._first=C,this._last=C;else if(B){const H=this._last;this._last=C,C.prev=H,H.next=C}else{const H=this._first;this._first=C,C.next=H,H.prev=C}this._size+=1;let I=!1;return()=>{I||(I=!0,this._remove(C))}}shift(){if(this._first===te.Undefined)return;{const A=this._first.element;return this._remove(this._first),A}}pop(){if(this._last===te.Undefined)return;{const A=this._last.element;return this._remove(this._last),A}}_remove(A){if(A.prev!==te.Undefined&&A.next!==te.Undefined){const B=A.prev;B.next=A.next,A.next.prev=B}else A.prev===te.Undefined&&A.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):A.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):A.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let A=this._first;for(;A!==te.Undefined;)yield A.element,A=A.next}}},"3/fG":function(Ze,le,K){"use strict";K.d(le,"a",function(){return j});function te(A,B){let C;return B.length===0?C=A:C=A.replace(/\{(\d+)\}/g,function(I,H){const U=H[0];return typeof B[U]!="undefined"?B[U]:I}),C}function j(A,B,...C){return te(B,C)}},"55Ip":function(Ze,le,K){"use strict";K.d(le,"a",function(){return i});var te=K("Ty5D"),j=K("dI71"),A=K("q1tI"),B=K.n(A),C=K("YS25"),I=K("17x9"),H=K.n(I),U=K("wx14"),e=K("zLVn"),R=K("9R94"),p=function(s){Object(j.a)(g,s);function g(){for(var T,y=arguments.length,w=new Array(y),P=0;P<y;P++)w[P]=arguments[P];return T=s.call.apply(s,[this].concat(w))||this,T.history=Object(C.a)(T.props),T}var h=g.prototype;return h.render=function(){return B.a.createElement(te.c,{history:this.history,children:this.props.children})},g}(B.a.Component),d=function(s){Object(j.a)(g,s);function g(){for(var T,y=arguments.length,w=new Array(y),P=0;P<y;P++)w[P]=arguments[P];return T=s.call.apply(s,[this].concat(w))||this,T.history=Object(C.b)(T.props),T}var h=g.prototype;return h.render=function(){return B.a.createElement(te.c,{history:this.history,children:this.props.children})},g}(B.a.Component),l=function(g,h){return typeof g=="function"?g(h):g},n=function(g,h){return typeof g=="string"?Object(C.c)(g,null,null,h):g},o=function(g){return g},u=B.a.forwardRef;typeof u=="undefined"&&(u=o);function a(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}var r=u(function(s,g){var h=s.innerRef,T=s.navigate,y=s.onClick,w=Object(e.a)(s,["innerRef","navigate","onClick"]),P=w.target,L=Object(U.a)({},w,{onClick:function(D){try{y&&y(D)}catch(F){throw D.preventDefault(),F}!D.defaultPrevented&&D.button===0&&(!P||P==="_self")&&!a(D)&&(D.preventDefault(),T())}});return o!==u?L.ref=g||h:L.ref=h,B.a.createElement("a",L)}),i=u(function(s,g){var h=s.component,T=h===void 0?r:h,y=s.replace,w=s.to,P=s.innerRef,L=Object(e.a)(s,["component","replace","to","innerRef"]);return B.a.createElement(te.e.Consumer,null,function(S){S||Object(R.a)(!1);var D=S.history,F=n(l(w,S.location),S.location),O=F?D.createHref(F):"",W=Object(U.a)({},L,{href:O,navigate:function(){var Q=l(w,S.location),q=y?D.replace:D.push;q(Q)}});return o!==u?W.ref=g||P:W.innerRef=P,B.a.createElement(T,W)})});if(!1)var t,_;var f=function(g){return g},v=B.a.forwardRef;typeof v=="undefined"&&(v=f);function x(){for(var s=arguments.length,g=new Array(s),h=0;h<s;h++)g[h]=arguments[h];return g.filter(function(T){return T}).join(" ")}var b=v(function(s,g){var h=s["aria-current"],T=h===void 0?"page":h,y=s.activeClassName,w=y===void 0?"active":y,P=s.activeStyle,L=s.className,S=s.exact,D=s.isActive,F=s.location,O=s.sensitive,W=s.strict,z=s.style,Q=s.to,q=s.innerRef,me=Object(e.a)(s,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return B.a.createElement(te.e.Consumer,null,function(he){he||Object(R.a)(!1);var ce=F||he.location,pe=n(l(Q,ce),ce),ge=pe.pathname,ee=ge&&ge.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),J=ee?Object(te.f)(ce.pathname,{path:ee,exact:S,sensitive:O,strict:W}):null,Re=!!(D?D(J,ce):J),Me=Re?x(L,w):L,Ie=Re?Object(U.a)({},z,{},P):z,Fe=Object(U.a)({"aria-current":Re&&T||null,className:Me,style:Ie,to:pe},me);return f!==v?Fe.ref=g||q:Fe.innerRef=q,B.a.createElement(i,Fe)})});if(!1)var m},"5VLF":function(Ze,le,K){"use strict";var te,j;function A(B,C,I){var H=function(U,e){return B.js_beautify(U,e)};return H.js=B.js_beautify,H.css=C.css_beautify,H.html=I.html_beautify,H.js_beautify=B.js_beautify,H.css_beautify=C.css_beautify,H.html_beautify=I.html_beautify,H}!(te=[K("6UM0"),K("TXwP"),K("psGv")],j=function(B,C,I){return A(B,C,I)}.apply(le,te),j!==void 0&&(Ze.exports=j))},"5Y4S":function(Ze,le,K){"use strict";K.d(le,"a",function(){return A});var te=K("MNsG");const j=te.b.performance&&typeof te.b.performance.now=="function";class A{constructor(B){this._highResolution=j&&B,this._startTime=this._now(),this._stopTime=-1}static create(B=!0){return new A(B)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6UM0":function(Ze,le,K){var te,j;(function(){var A;(function(){"use strict";var C=[function(e,R,p){var d=p(1).Beautifier,l=p(5).Options;function n(o,u){var a=new d(o,u);return a.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new l}},function(e,R,p){var d=p(2).Output,l=p(3).Token,n=p(4),o=p(5).Options,u=p(7).Tokenizer,a=p(7).line_starters,r=p(7).positionable_operators,i=p(7).TOKEN;function t(O,W){return W.indexOf(O)!==-1}function _(O){return O.replace(/^\s+/g,"")}function f(O){for(var W={},z=0;z<O.length;z++)W[O[z].replace(/-/g,"_")]=O[z];return W}function v(O,W){return O&&O.type===i.RESERVED&&O.text===W}function x(O,W){return O&&O.type===i.RESERVED&&t(O.text,W)}var b=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],s=f(m),g=[s.before_newline,s.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(O,W){if(W.multiline_frame||W.mode===h.ForInitializer||W.mode===h.Conditional)return;O.remove_indent(W.start_line_index)}function y(O){O=O.replace(n.allLineBreaks,`
`);for(var W=[],z=O.indexOf(`
`);z!==-1;)W.push(O.substring(0,z)),O=O.substring(z+1),z=O.indexOf(`
`);return O.length&&W.push(O),W}function w(O){return O===h.ArrayLiteral}function P(O){return t(O,[h.Expression,h.ForInitializer,h.Conditional])}function L(O,W){for(var z=0;z<O.length;z++){var Q=O[z].trim();if(Q.charAt(0)!==W)return!1}return!0}function S(O,W){for(var z=0,Q=O.length,q;z<Q;z++)if(q=O[z],q&&q.indexOf(W)!==0)return!1;return!0}function D(O,W){W=W||{},this._source_text=O||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(W)}D.prototype.create_flags=function(O,W){var z=0;O&&(z=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>z&&(z=O.line_indent_level));var Q={mode:W,parent:O,last_token:O?O.last_token:new l(i.START_BLOCK,""),last_word:O?O.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:z,alignment:0,line_indent_level:O?O.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return Q},D.prototype._reset=function(O){var W=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new d(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var z=new u(O,this._options);return this._tokens=z.tokenize(),O},D.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,W=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
`,W&&n.lineBreak.test(W||"")&&(z=W.match(n.lineBreak)[0]));for(var Q=this._tokens.next();Q;)this.handle_token(Q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Q,Q=this._tokens.next();return O=this._output.get_code(z),O},D.prototype.handle_token=function(O,W){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,W):O.type===i.COMMENT?this.handle_comment(O,W):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,W):this.handle_unknown(O,W)},D.prototype.handle_whitespace_and_comments=function(O,W){var z=O.newlines,Q=this._options.keep_array_indentation&&w(this._flags.mode);if(O.comments_before)for(var q=O.comments_before.next();q;)this.handle_whitespace_and_comments(q,W),this.handle_token(q,W),q=O.comments_before.next();if(Q)for(var me=0;me<z;me+=1)this.print_newline(me>0,W);else if(this._options.max_preserve_newlines&&z>this._options.max_preserve_newlines&&(z=this._options.max_preserve_newlines),this._options.preserve_newlines&&z>1){this.print_newline(!1,W);for(var he=1;he<z;he+=1)this.print_newline(!0,W)}};var F=["async","break","continue","return","throw","yield"];D.prototype.allow_wrap_or_preserved_newline=function(O,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&O.newlines||W,Q=t(this._flags.last_token.text,r)||t(O.text,r);if(Q){var q=t(this._flags.last_token.text,r)&&t(this._options.operator_position,g)||t(O.text,r);z=z&&q}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(x(this._flags.last_token,F))return;this._output.set_wrap_point()}},D.prototype.print_newline=function(O,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&v(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},D.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},D.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},D.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&T(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||x(this._flags.last_token,["get","set"]))},D.prototype.start_of_statement=function(O){var W=!1;return W=W||x(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,W=W||v(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&x(this._flags.last_token,F)&&!O.newlines,W=W||v(this._flags.last_token,"else")&&!(v(O,"if")&&!O.comments_before),W=W||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),W=W||this._flags.last_token.type===i.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,W=W||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||x(this._flags.last_token,["get","set"])),W?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,x(O,["do","for","if","while"])),!0):!1},D.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var W=h.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){x(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=h.ArrayLiteral,w(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())),t(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=h.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=h.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var Q=this._tokens.peek(-4);x(z,["async","function"])||z.text==="*"&&x(Q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(Q.text==="{"||Q.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(O);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},D.prototype.handle_end_expr=function(O){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.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(O),this.restore_mode(),T(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},D.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var W=this._tokens.peek(),z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):z&&(t(z.text,[":",","])&&t(W.type,[i.STRING,i.WORD,i.RESERVED])||t(W.text,["get","set","..."])&&t(z.type,[i.WORD,i.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(z.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):t(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||x(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(x(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Q=!W.comments_before&&W.text==="}",q=Q&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var me=0,he=null;this._flags.inline_frame=!0;do if(me+=1,he=this._tokens.peek(me-1),he.newlines){this._flags.inline_frame=!1;break}while(he.type!==i.EOF&&!(he.type===i.END_BLOCK&&he.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(q||this._flags.last_token.type===i.EQUALS||x(this._flags.last_token,b)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!Q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},D.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===h.Statement;)this.restore_mode();var W=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(w(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(O)},D.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(t(O.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&t(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(t(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===h.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?x(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!x(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(v(O,"while")){this._output.space_before_token=!0,this.print_token(O),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&&v(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&x(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),v(O,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?x(this._flags.last_token,["get","set","new","export"])||x(this._flags.last_token,F)?this._output.space_before_token=!0:v(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===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var z="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":x(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===h.BlockStatement?z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&P(this._flags.mode)?z="SPACE":this._flags.last_token.type===i.STRING?z="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","]))?z="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),x(O,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?z="SPACE":z="NEWLINE"),x(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Q=this._output.current_line;Q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?x(this._flags.last_token,b)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&x(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!x(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(v(O,"if")&&v(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):x(O,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&v(O,"from")&&(this._flags.import_block=!1))},D.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var W=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&v(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},D.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},D.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},D.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(P(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(O)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},D.prototype.handle_operator=function(O){var W=O.text==="*"&&(x(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),z=t(O.text,["-","+"])&&(t(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||t(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var Q=!W;this.handle_whitespace_and_comments(O,Q)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&t(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 q=!0,me=!0,he=!1;if(O.text===":"?this._flags.ternary_depth===0?q=!1:(this._flags.ternary_depth-=1,he=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!z&&!W&&this._options.preserve_newlines&&t(O.text,r)){var ce=O.text===":",pe=ce&&he,ge=ce&&!he;switch(this._options.operator_position){case s.before_newline:this._output.space_before_token=!ge,this.print_token(O),(!ce||pe)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case s.after_newline:this._output.space_before_token=!0,!ce||pe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case s.preserve_newline:ge||this.allow_wrap_or_preserved_newline(O),q=!(this._output.just_added_newline()||ge),this._output.space_before_token=q,this.print_token(O),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(O),q=!1;var ee=this._tokens.peek();me=ee&&t(ee.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),q=this._flags.last_token.type===i.START_BLOCK,me=!1;else if(t(O.text,["--","++","!","~"])||z){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),q=!1,me=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var J=x(this._flags.last_token,b)&&O.newlines;J&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(J,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(q=!0),this._flags.last_token.type===i.RESERVED?q=!0:this._flags.last_token.type===i.END_EXPR?q=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(q=t(O.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(O.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(me=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||q,this.print_token(O),this._output.space_before_token=me},D.prototype.handle_block_comment=function(O,W){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,W),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,W)},D.prototype.print_block_commment=function(O,W){var z=y(O.text),Q,q=!1,me=!1,he=O.whitespace_before,ce=he.length;if(this.print_newline(!1,W),this.print_token_line_indentation(O),this._output.add_token(z[0]),this.print_newline(!1,W),z.length>1){for(z=z.slice(1),q=L(z,"*"),me=S(z,he),q&&(this._flags.alignment=1),Q=0;Q<z.length;Q++)q?(this.print_token_line_indentation(O),this._output.add_token(_(z[Q]))):me&&z[Q]?(this.print_token_line_indentation(O),this._output.add_token(z[Q].substring(ce))):(this._output.current_line.set_indent(-1),this._output.add_token(z[Q])),this.print_newline(!1,W);this._flags.alignment=0}},D.prototype.handle_comment=function(O,W){O.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,W)},D.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),x(this._flags.last_token,b)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(O)},D.prototype.handle_unknown=function(O,W){this.print_token(O),O.text[O.text.length-1]===`
`&&this.print_newline(!1,W)},D.prototype.handle_eof=function(O){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},e.exports.Beautifier=D},function(e){function R(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=[]}R.prototype.clone_empty=function(){var l=new R(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},R.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},R.prototype.has_match=function(l){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(l))return!0;return!1},R.prototype.set_indent=function(l,n){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=n||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 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},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(l){this.__items.push(l);var n=l.lastIndexOf(`
`);n!==-1?this.__character_count=l.length-n:this.__character_count+=l.length},R.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},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 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,n){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)),n=n||"",l.indent_level>0&&(n=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}p.prototype.get_indent_size=function(l,n){var o=this.__base_string_length;return n=n||0,l<0&&(o=0),o+=l*this.__indent_size,o+=n,o},p.prototype.get_indent_string=function(l,n){var o=this.__base_string;return n=n||0,l<0&&(l=0,o=""),n+=l*this.__indent_size,this.__ensure_cache(n),o+=this.__cache[n],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,n=0,o="";this.__indent_size&&l>=this.__indent_size&&(n=Math.floor(l/this.__indent_size),l-=n*this.__indent_size,o=new Array(n+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function d(l,n){this.__indent_cache=new p(l,n),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 R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(l,n){return this.__indent_cache.get_indent_string(l,n)},d.prototype.get_indent_size=function(l,n){return this.__indent_cache.get_indent_size(l,n)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(l){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return l!==`
`&&(o=o.replace(/[\n]/g,l)),o},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(l,n){return l=l||0,n=n||0,this.next_line.set_indent(l,n),this.__lines.length>1?(this.current_line.set_indent(l,n),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(l){for(var n=0;n<l.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(l){for(var n=this.__lines.length;l<n;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(l,n){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==n){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},e.exports.Output=d},function(e){function R(p,d,l,n){this.type=p,this.text=d,this.comments_before=null,this.newlines=l||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=R},function(e,R){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",l="\\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",n="\\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",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+l+"])",u="(?:\\\\u[0-9a-fA-F]{4}|["+d+l+n+"])*";R.identifier=new RegExp(o+u,"g"),R.identifierStart=new RegExp(o),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+d+l+n+"])+");var a=/[\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(e,R,p){var d=p(6).Options,l=["before-newline","after-newline","preserve-newline"];function n(o){d.call(this,o,"js");var u=this.raw_options.brace_style||null;u==="expand-strict"?this.raw_options.brace_style="expand":u==="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 a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<a.length;r++)a[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=a[r];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",l),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}n.prototype=new d,e.exports.Options=n},function(e){function R(l,n){this.raw_options=p(l,n),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(l,n){var o=this.raw_options[l],u=n||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},R.prototype._get_boolean=function(l,n){var o=this.raw_options[l],u=o===void 0?!!n:!!o;return u},R.prototype._get_characters=function(l,n){var o=this.raw_options[l],u=n||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},R.prototype._get_number=function(l,n){var o=this.raw_options[l];n=parseInt(n,10),isNaN(n)&&(n=0);var u=parseInt(o,10);return isNaN(u)&&(u=n),u},R.prototype._get_selection=function(l,n,o){var u=this._get_selection_list(l,n,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return u[0]},R.prototype._get_selection_list=function(l,n,o){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[n[0]],!this._is_valid_selection(o,n))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,n))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return u},R.prototype._is_valid_selection=function(l,n){return l.length&&n.length&&!l.some(function(o){return n.indexOf(o)===-1})};function p(l,n){var o={};l=d(l);var u;for(u in l)u!==n&&(o[u]=l[u]);if(n&&l[n])for(u in l[n])o[u]=l[n][u];return o}function d(l){var n={},o;for(o in l){var u=o.replace(/-/g,"_");n[u]=l[o]}return n}e.exports.Options=R,e.exports.normalizeOpts=d,e.exports.mergeOpts=p},function(e,R,p){var d=p(8).InputScanner,l=p(9).Tokenizer,n=p(9).TOKEN,o=p(13).Directives,u=p(4),a=p(12).Pattern,r=p(14).TemplatablePattern;function i(L,S){return S.indexOf(L)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},_=new o(/\/\*/,/\*\//),f=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,v=/[0-9]/,x=/[^\d\.]/,b=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var s=new RegExp(m),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),T=new RegExp("^(?:"+h.join("|")+")$"),y,w=function(L,S){l.call(this,L,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var D=new a(this._input),F=new r(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(u.identifier).matching(u.identifierMatch),number:D.matching(f),punct:D.matching(s),comment:D.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:D.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:D.matching(/<!--/),html_comment_end:D.matching(/-->/),include:D.starting_with(/#include/).until_after(u.lineBreak),shebang:D.starting_with(/#!/).until_after(u.lineBreak),xml:D.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:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};w.prototype=new l,w.prototype._is_comment=function(L){return L.type===t.COMMENT||L.type===t.BLOCK_COMMENT||L.type===t.UNKNOWN},w.prototype._is_opening=function(L){return L.type===t.START_BLOCK||L.type===t.START_EXPR},w.prototype._is_closing=function(L,S){return(L.type===t.END_BLOCK||L.type===t.END_EXPR)&&S&&(L.text==="]"&&S.text==="["||L.text===")"&&S.text==="("||L.text==="}"&&S.text==="{")},w.prototype._reset=function(){y=!1},w.prototype._get_next_token=function(L,S){var D=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(t.EOF,""):(D=D||this._read_non_javascript(F),D=D||this._read_string(F),D=D||this._read_word(L),D=D||this._read_singles(F),D=D||this._read_comment(F),D=D||this._read_regexp(F,L),D=D||this._read_xml(F,L),D=D||this._read_punctuation(),D=D||this._create_token(t.UNKNOWN,this._input.next()),D)},w.prototype._read_word=function(L){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(u.allLineBreaks,`
`),!(L.type===t.DOT||L.type===t.RESERVED&&(L.text==="set"||L.text==="get"))&&T.test(S)?(S==="in"||S==="of")&&(L.type===t.WORD||L.type===t.STRING)?this._create_token(t.OPERATOR,S):this._create_token(t.RESERVED,S):this._create_token(t.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(t.WORD,S)},w.prototype._read_singles=function(L){var S=null;return L==="("||L==="["?S=this._create_token(t.START_EXPR,L):L===")"||L==="]"?S=this._create_token(t.END_EXPR,L):L==="{"?S=this._create_token(t.START_BLOCK,L):L==="}"?S=this._create_token(t.END_BLOCK,L):L===";"?S=this._create_token(t.SEMICOLON,L):L==="."&&x.test(this._input.peek(1))?S=this._create_token(t.DOT,L):L===","&&(S=this._create_token(t.COMMA,L)),S&&this._input.next(),S},w.prototype._read_punctuation=function(){var L=this.__patterns.punct.read();if(L!=="")return L==="="?this._create_token(t.EQUALS,L):L==="?."?this._create_token(t.DOT,L):this._create_token(t.OPERATOR,L)},w.prototype._read_non_javascript=function(L){var S="";if(L==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(t.UNKNOWN,S.trim()+`
`);if(S=this.__patterns.include.read(),S)return this._create_token(t.UNKNOWN,S.trim()+`
`);L=this._input.next();var D="#";if(this._input.hasNext()&&this._input.testChar(v)){do L=this._input.next(),D+=L;while(this._input.hasNext()&&L!=="#"&&L!=="=");return L==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(D+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(D+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,D)}this._input.back()}else if(L==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(u.newline);)S+=this._input.next();return y=!0,this._create_token(t.COMMENT,S)}}else if(y&&L==="-"&&(S=this.__patterns.html_comment_end.read(),S))return y=!1,this._create_token(t.COMMENT,S);return null},w.prototype._read_comment=function(L){var S=null;if(L==="/"){var D="";if(this._input.peek(1)==="*"){D=this.__patterns.block_comment.read();var F=_.get_directives(D);F&&F.ignore==="start"&&(D+=_.readIgnored(this._input)),D=D.replace(u.allLineBreaks,`
`),S=this._create_token(t.BLOCK_COMMENT,D),S.directives=F}else this._input.peek(1)==="/"&&(D=this.__patterns.comment.read(),S=this._create_token(t.COMMENT,D))}return S},w.prototype._read_string=function(L){if(L==="`"||L==="'"||L==='"'){var S=this._input.next();return this.has_char_escapes=!1,L==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(L),this.has_char_escapes&&this._options.unescape_strings&&(S=P(S)),this._input.peek()===L&&(S+=this._input.next()),S=S.replace(u.allLineBreaks,`
`),this._create_token(t.STRING,S)}return null},w.prototype._allow_regexp_or_xml=function(L){return L.type===t.RESERVED&&i(L.text,["return","case","throw","else","do","typeof","yield"])||L.type===t.END_EXPR&&L.text===")"&&L.opened.previous.type===t.RESERVED&&i(L.opened.previous.text,["if","while","for"])||i(L.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},w.prototype._read_regexp=function(L,S){if(L==="/"&&this._allow_regexp_or_xml(S)){for(var D=this._input.next(),F=!1,O=!1;this._input.hasNext()&&(F||O||this._input.peek()!==L)&&!this._input.testChar(u.newline);)D+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===L&&(D+=this._input.next(),D+=this._input.read(u.identifier)),this._create_token(t.STRING,D)}return null},w.prototype._read_xml=function(L,S){if(this._options.e4x&&L==="<"&&this._allow_regexp_or_xml(S)){var D="",F=this.__patterns.xml.read_match();if(F){for(var O=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=O.indexOf("{")===0,z=0;F;){var Q=!!F[1],q=F[2],me=!!F[F.length-1]||q.slice(0,8)==="![CDATA[";if(!me&&(q===O||W&&q.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Q?--z:++z),D+=F[0],z<=0)break;F=this.__patterns.xml.read_match()}return F||(D+=this._input.match(/[\s\S]*/g)[0]),D=D.replace(u.allLineBreaks,`
`),this._create_token(t.STRING,D)}}return null};function P(L){for(var S="",D=0,F=new d(L),O=null;F.hasNext();)if(O=F.match(/([\s]|[^\\]|\\\\)+/g),O&&(S+=O[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")O=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")O=F.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",F.hasNext()&&(S+=F.next());continue}if(!O)return L;if(D=parseInt(O[1],16),D>126&&D<=255&&O[0].indexOf("x")===0)return L;if(D>=0&&D<32){S+="\\"+O[0];continue}else D===34||D===39||D===92?S+="\\"+String.fromCharCode(D):S+=String.fromCharCode(D)}return S}w.prototype._read_string_recursive=function(L,S,D){var F,O;L==="'"?O=this.__patterns.single_quote:L==='"'?O=this.__patterns.double_quote:L==="`"?O=this.__patterns.template_text:L==="}"&&(O=this.__patterns.template_expression);for(var W=O.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===L||!S&&u.newline.test(z)){this._input.back();break}else z==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
`&&this._input.next(),z+=this._input.next()):D&&(D==="${"&&z==="$"&&this._input.peek()==="{"&&(z+=this._input.next()),D===z&&(L==="`"?z+=this._read_string_recursive("}",S,"`"):z+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=O.read(),W+=z}return W},e.exports.Tokenizer=w,e.exports.TOKEN=t,e.exports.positionable_operators=b.slice(),e.exports.line_starters=g.slice()},function(e){var R=RegExp.prototype.hasOwnProperty("sticky");function p(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},p.prototype.peek=function(d){var l=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(l=this.__input.charAt(d)),l},p.prototype.__match=function(d,l){d.lastIndex=l;var n=d.exec(this.__input);return n&&!(R&&d.sticky)&&(n.index!==l&&(n=null)),n},p.prototype.test=function(d,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(d,l):!1},p.prototype.testChar=function(d,l){var n=this.peek(l);return d.lastIndex=0,n!==null&&d.test(n)},p.prototype.match=function(d){var l=this.__match(d,this.__position);return l?this.__position+=l[0].length:l=null,l},p.prototype.read=function(d,l,n){var o="",u;return d&&(u=this.match(d),u&&(o+=u[0])),l&&(u||!d)&&(o+=this.readUntil(l,n)),o},p.prototype.readUntil=function(d,l){var n="",o=this.__position;d.lastIndex=this.__position;var u=d.exec(this.__input);return u?(o=u.index,l&&(o+=u[0].length)):o=this.__input_length,n=this.__input.substring(this.__position,o),this.__position=o,n},p.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},p.prototype.get_regexp=function(d,l){var n=null,o="g";return l&&R&&(o="y"),typeof d=="string"&&d!==""?n=new RegExp(d,o):d&&(n=new RegExp(d.source,o)),n},p.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(d){var l=this.__position,n=this.readUntilAfter(d);return this.__position=l,n},p.prototype.lookBack=function(d){var l=this.__position-1;return l>=d.length&&this.__input.substring(l-d.length,l).toLowerCase()===d},e.exports.InputScanner=p},function(e,R,p){var d=p(8).InputScanner,l=p(3).Token,n=p(10).TokenStream,o=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(r,i){this._input=new d(r),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var r,i=new l(u.START,""),t=null,_=[],f=new n;i.type!==u.EOF;){for(r=this._get_next_token(i,t);this._is_comment(r);)f.add(r),r=this._get_next_token(i,t);f.isEmpty()||(r.comments_before=f,f=new n),r.parent=t,this._is_opening(r)?(_.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=_.pop(),r.parent=t),r.previous=i,i.next=r,this.__tokens.add(r),i=r}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(r,i){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(u.RAW,t):this._create_token(u.EOF,"")},a.prototype._is_comment=function(r){return!1},a.prototype._is_opening=function(r){return!1},a.prototype._is_closing=function(r,i){return!1},a.prototype._create_token=function(r,i){var t=new l(r,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=a,e.exports.TOKEN=u},function(e){function R(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position<this.__tokens_length},R.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},R.prototype.peek=function(p){var d=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(d=this.__tokens[p]),d},R.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},e.exports.TokenStream=R},function(e,R,p){var d=p(12).Pattern;function l(n,o){d.call(this,n,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new d,l.prototype.__set_whitespace_patterns=function(n,o){n+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var o=this.__split(this._newline_regexp,n);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return n},l.prototype.matching=function(n,o){var u=this._create();return u.__set_whitespace_patterns(n,o),u._update(),u},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(n,o){n.lastIndex=0;for(var u=0,a=[],r=n.exec(o);r;)a.push(o.substring(u,r.index)),u=r.index+r[0].length,r=n.exec(o);return u<o.length?a.push(o.substring(u,o.length)):a.push(""),a},e.exports.WhitespacePattern=l},function(e){function R(p,d){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}R.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},R.prototype.read_match=function(){return this._input.match(this._match_pattern)},R.prototype.until_after=function(p){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(p),d._update(),d},R.prototype.until=function(p){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(p),d._update(),d},R.prototype.starting_with=function(p){var d=this._create();return d._starting_pattern=this._input.get_regexp(p,!0),d._update(),d},R.prototype.matching=function(p){var d=this._create();return d._match_pattern=this._input.get_regexp(p,!0),d._update(),d},R.prototype._create=function(){return new R(this._input,this)},R.prototype._update=function(){},e.exports.Pattern=R},function(e){function R(p,d){p=typeof p=="string"?p:p.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+d,"g")}R.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(p);l;)d[l[1]]=l[2],l=this.__directive_pattern.exec(p);return d},R.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=R},function(e,R,p){var d=p(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(o,u){d.call(this,o,u),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var a=new d(o);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new d,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},n.prototype.read_options=function(o){var u=this._create();for(var a in l)u._disabled[a]=o.templating.indexOf(a)===-1;return u._update(),u},n.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},n.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 u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},n.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("|")+")")},n.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!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},e.exports.TemplatablePattern=n}],I={};function H(e){var R=I[e];if(R!==void 0)return R.exports;var p=I[e]={exports:{}};return C[e](p,p.exports,H),p.exports}var U=H(0);A=U})();var B=A;!(te=[],j=function(){return{js_beautify:B}}.apply(le,te),j!==void 0&&(Ze.exports=j))})()},"746U":function(Ze,le,K){"use strict";K.d(le,"f",function(){return te}),K.d(le,"l",function(){return j}),K.d(le,"k",function(){return A}),K.d(le,"j",function(){return B}),K.d(le,"g",function(){return C}),K.d(le,"m",function(){return I}),K.d(le,"h",function(){return H}),K.d(le,"n",function(){return U}),K.d(le,"c",function(){return e}),K.d(le,"a",function(){return R}),K.d(le,"i",function(){return p}),K.d(le,"o",function(){return d}),K.d(le,"e",function(){return o}),K.d(le,"d",function(){return u}),K.d(le,"p",function(){return a}),K.d(le,"b",function(){return r});function te(i){return Array.isArray(i)}function j(i){return typeof i=="string"}function A(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function B(i){return typeof i=="number"&&!isNaN(i)}function C(i){return i===!0||i===!1}function I(i){return typeof i=="undefined"}function H(i){return!U(i)}function U(i){return I(i)||i===null}function e(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function R(i){if(U(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function p(i){return typeof i=="function"}function d(i,t){const _=Math.min(i.length,t.length);for(let f=0;f<_;f++)l(i[f],t[f])}function l(i,t){if(j(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(p(t)){try{if(i instanceof t)return}catch(_){}if(!U(i)&&i.constructor===t)return;if(t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function n(i){let t=[],_=Object.getPrototypeOf(i);for(;Object.prototype!==_;)t=t.concat(Object.getOwnPropertyNames(_)),_=Object.getPrototypeOf(_);return t}function o(i){const t=[];for(const _ of n(i))typeof i[_]=="function"&&t.push(_);return t}function u(i,t){const _=v=>function(){const x=Array.prototype.slice.call(arguments,0);return t(v,x)};let f={};for(const v of i)f[v]=_(v);return f}function a(i){return i===null?void 0:i}function r(i,t="Unreachable"){throw new Error(t)}},"7iMQ":function(Ze,le,K){Ze.exports={flex_box_center:"flex_box_center___2gbXl",flex_space_between:"flex_space_between___1wCja",flex_box_vertical_center:"flex_box_vertical_center___1SR9W",flex_box_center_end:"flex_box_center_end___iQrwG",flex_box_column:"flex_box_column___1FzsI",bg:"bg___Fnp9V",containerTitle:"containerTitle___3SWYr",containerDesc:"containerDesc___1vOga",listItem:"listItem___3Ygyv",info:"info___q0zEQ",title:"title___1lfph",titleLeft:"titleLeft___YAW8a",titleRight:"titleRight___24IYl",acitons:"acitons___1eW6L"}},"8HAY":function(Ze,le,K){"use strict";K.d(le,"a",function(){return C}),K.d(le,"b",function(){return I}),K.d(le,"d",function(){return H}),K.d(le,"e",function(){return U}),K.d(le,"c",function(){return e});var te=K("MI8n"),j=K("pmY6"),A=K("3/fG"),B=function(R,p,d,l){function n(o){return o instanceof d?o:new d(function(u){u(o)})}return new(d||(d=Promise))(function(o,u){function a(t){try{i(l.next(t))}catch(_){u(_)}}function r(t){try{i(l.throw(t))}catch(_){u(_)}}function i(t){t.done?o(t.value):n(t.value).then(a,r)}i((l=l.apply(R,p||[])).next())})};class C extends j.a{constructor(R,p="",d="",l=!0,n){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=R,this._label=p,this._cssClass=d,this._enabled=l,this._actionCallback=n}get id(){return this._id}get label(){return this._label}set label(R){this._setLabel(R)}_setLabel(R){this._label!==R&&(this._label=R,this._onDidChange.fire({label:R}))}get tooltip(){return this._tooltip||""}set tooltip(R){this._setTooltip(R)}_setTooltip(R){this._tooltip!==R&&(this._tooltip=R,this._onDidChange.fire({tooltip:R}))}get class(){return this._cssClass}set class(R){this._setClass(R)}_setClass(R){this._cssClass!==R&&(this._cssClass=R,this._onDidChange.fire({class:R}))}get enabled(){return this._enabled}set enabled(R){this._setEnabled(R)}_setEnabled(R){this._enabled!==R&&(this._enabled=R,this._onDidChange.fire({enabled:R}))}get checked(){return this._checked}set checked(R){this._setChecked(R)}_setChecked(R){this._checked!==R&&(this._checked=R,this._onDidChange.fire({checked:R}))}run(R,p){return B(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(R))})}}class I extends j.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(R,p){return B(this,void 0,void 0,function*(){if(!R.enabled)return;this._onBeforeRun.fire({action:R});let d;try{yield this.runAction(R,p)}catch(l){d=l}this._onDidRun.fire({action:R,error:d})})}runAction(R,p){return B(this,void 0,void 0,function*(){yield R.run(p)})}}class H extends C{constructor(R){super(H.ID,R,R?"separator text":"separator");this.checked=!1,this.enabled=!1}}H.ID="vs.actions.separator";class U{constructor(R,p,d,l){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=R,this.label=p,this.class=l,this._actions=d}get actions(){return this._actions}dispose(){}run(){return B(this,void 0,void 0,function*(){})}}class e extends C{constructor(){super(e.ID,A.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Ze,le,K){Ze.exports={button:"button___1wy9m"}},"9Bee":function(Ze,le,K){"use strict";var te=K("DYRE"),j=K("zeV3"),A=K("+L6B"),B=K("2/Rp"),C=K("k1fw"),I=K("9og8"),H=K("tJVT"),U=K("WmNS"),e=K.n(U),R=K("q1tI"),p=K.n(R),d=K("vg9a"),l=K("DlQD"),n=K.n(l),o=K("rUJ1");function u(M,c){var E=M.match(/^(\s+)(?:```)/);if(E===null)return c;var k=E[1];return c.split(`
`).map(function(G){var N=G.match(/^\s+/);if(N===null)return G;var ie=Object(H.a)(N,1),Ee=ie[0];return Ee.length>=k.length?G.slice(k.length):G}).join(`
`)}var a=[],r=["<ul>"],i=new n.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _(){a.length=0,r=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function v(M,c,E,k){if(c>=M.length||M[c].level<=E)return c;var G=M[c];k.push("<li><a href='#"+G.anchor+"'>"+G.text+"</a>"),c++;var N=[];return c=v(M,c,G.level,N),N.length>0&&(k.push("<ul>"),N.forEach(function(ie){k.push(ie)}),k.push("</ul>")),k.push("</li>"),c=v(M,c,E,k),c}function x(){return v(a,0,0,r),r.push("</ul>"),r.join("")}var b={heading:function(c){var E=t.exec(c);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},fences:function(c){var E=this.rules.block.fences.exec(c);if(E){var k=E[0],G=u(k,E[3]||""),N=E[2]?E[2].trim():E[2];if(["latex","katex","math"].indexOf(N)>=0){var ie=g(),Ee=G;G=ie,h[ie]={type:"block",expression:Ee}}return{type:"code",raw:k,lang:N,text:G}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,s=0,g=function(){return"__special_katext_id_".concat(s++,"__")},h={};function T(){return h}function y(){s=0,h={}}function w(M){return M=M.replace(m,function(c,E){var k=g();return h[k]={type:"inline",expression:E},k}),M}var P=i.listitem;i.listitem=function(M){return P(w(M))};var L=i.paragraph;i.paragraph=function(M){return L(w(M))};var S=i.tablecell;i.tablecell=function(M,c){return S(w(M),c)},i.code=function(M,c,E){var k=(c||"").match(/\S*/)[0];return k?["latex","katex","math"].indexOf(k)>=0?"<p class='editormd-tex'>".concat(M,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(c,'">').concat(E?M:Object(o.escape)(M,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(E?M:Object(o.escape)(M,!0))+"</code></pre>"},i.heading=function(M,c,E){var k=this.options.headerPrefix+E.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:k,level:c,text:M}),"<h"+c+' id="'+k+'">'+M+"</h"+c+">"},n.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),n.a.use({tokenizer:b,renderer:i});var D=n.a,F=K("SJMd"),O=K("ulZh"),W=K.n(O),z=K("m3rI"),Q=K("Oy/b"),q=K("p5ED"),me=K("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var he=function(M,c){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,k){E.__proto__=k}||function(E,k){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(E[G]=k[G])})(M,c)};function ce(M,c){function E(){this.constructor=M}he(M,c),M.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function pe(M,c,E,k){return new(E||(E=Promise))(function(G,N){function ie($e){try{je(k.next($e))}catch(we){N(we)}}function Ee($e){try{je(k.throw($e))}catch(we){N(we)}}function je($e){var we;$e.done?G($e.value):(we=$e.value,we instanceof E?we:new E(function(nt){nt(we)})).then(ie,Ee)}je((k=k.apply(M,c||[])).next())})}function ge(M,c){var E,k,G,N,ie={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return N={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function Ee(je){return function($e){return function(we){if(E)throw new TypeError("Generator is already executing.");for(;ie;)try{if(E=1,k&&(G=2&we[0]?k.return:we[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,we[1])).done)return G;switch(k=0,G&&(we=[2&we[0],G.value]),we[0]){case 0:case 1:G=we;break;case 4:return ie.label++,{value:we[1],done:!1};case 5:ie.label++,k=we[1],we=[0];continue;case 7:we=ie.ops.pop(),ie.trys.pop();continue;default:if(!(G=ie.trys,(G=G.length>0&&G[G.length-1])||we[0]!==6&&we[0]!==2)){ie=0;continue}if(we[0]===3&&(!G||we[1]>G[0]&&we[1]<G[3])){ie.label=we[1];break}if(we[0]===6&&ie.label<G[1]){ie.label=G[1],G=we;break}if(G&&ie.label<G[2]){ie.label=G[2],ie.ops.push(we);break}G[2]&&ie.ops.pop(),ie.trys.pop();continue}we=c.call(M,ie)}catch(nt){we=[6,nt],k=0}finally{E=G=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([je,$e])}}}function ee(){for(var M=0,c=0,E=arguments.length;c<E;c++)M+=arguments[c].length;var k=Array(M),G=0;for(c=0;c<E;c++)for(var N=arguments[c],ie=0,Ee=N.length;ie<Ee;ie++,G++)k[G]=N[ie];return k}var J=function(){function M(){}return M.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},M.setAttributes=function(c,E){for(var k=0,G=E;k<G.length;k++){var N=G[k],ie=N[0],Ee=N[1];c.setAttribute(ie,Ee)}},M.createRect=function(c,E,k){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",c.toString()),G.setAttribute("height",E.toString()),k&&M.setAttributes(G,k),G},M.createLine=function(c,E,k,G,N){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",c.toString()),ie.setAttribute("y1",E.toString()),ie.setAttribute("x2",k.toString()),ie.setAttribute("y2",G.toString()),N&&M.setAttributes(ie,N),ie},M.createPolygon=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",c),E&&M.setAttributes(k,E),k},M.createCircle=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(c/2).toString()),k.setAttribute("cy",(c/2).toString()),k.setAttribute("r",c.toString()),E&&M.setAttributes(k,E),k},M.createEllipse=function(c,E,k){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(c/2).toString()),G.setAttribute("cy",(E/2).toString()),G.setAttribute("rx",(c/2).toString()),G.setAttribute("ry",(E/2).toString()),k&&M.setAttributes(G,k),G},M.createGroup=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","g");return c&&M.setAttributes(E,c),E},M.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},M.createMarker=function(c,E,k,G,N,ie,Ee){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return M.setAttributes(je,[["id",c],["orient",E],["markerWidth",k.toString()],["markerHeight",G.toString()],["refX",N.toString()],["refY",ie.toString()]]),je.appendChild(Ee),je},M.createText=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","text");return E.setAttribute("x","0"),E.setAttribute("y","0"),c&&M.setAttributes(E,c),E},M.createTSpan=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=c,E&&M.setAttributes(k,E),k},M.createImage=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","image");return c&&M.setAttributes(E,c),E},M.createPoint=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=c,k.y=E,k},M.createPath=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",c),E&&M.setAttributes(k,E),k},M}(),Re=function(){function M(){}return M.addKey=function(c){M.key=c},Object.defineProperty(M,"isLicensed",{get:function(){return!!M.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(M.key)},enumerable:!1,configurable:!0}),M}(),Me=function(){function M(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return M.prototype.rasterize=function(c,E,k){var G=this;return new Promise(function(N){var ie=k!==void 0?k:document.createElement("canvas");c===null&&(G.markersOnly=!0,G.naturalSize=!1);var Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("width",E.width.baseVal.valueAsString),Ee.setAttribute("height",E.height.baseVal.valueAsString),Ee.setAttribute("viewBox","0 0 "+E.viewBox.baseVal.width.toString()+" "+E.viewBox.baseVal.height.toString()),Ee.innerHTML=E.innerHTML,G.naturalSize===!0?(Ee.width.baseVal.value=c.naturalWidth,Ee.height.baseVal.value=c.naturalHeight):G.width!==void 0&&G.height!==void 0&&(Ee.width.baseVal.value=G.width,Ee.height.baseVal.value=G.height),ie.width=Ee.width.baseVal.value,ie.height=Ee.height.baseVal.value;var je=Ee.outerHTML,$e=ie.getContext("2d");G.markersOnly!==!0&&$e.drawImage(c,0,0,ie.width,ie.height);var we=window.URL,nt=new Image(ie.width,ie.height);nt.setAttribute("crossOrigin","anonymous");var _t=new Blob([je],{type:"image/svg+xml"}),Tt=we.createObjectURL(_t);nt.onload=function(){$e.drawImage(nt,0,0),we.revokeObjectURL(Tt);var Mt=ie.toDataURL(G.imageType,G.imageQuality);N(Mt)},nt.src=Tt})},M}(),Ie=function(){},Fe=function(){function M(c){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+c+"_"}return Object.defineProperty(M.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),M.prototype.addClass=function(c){return this.styleSheet===void 0&&this.addStyleSheet(),c.name=""+this.classNamePrefix+c.localName,this.classes.push(c),this.styleSheet.sheet.insertRule("."+c.name+" {"+c.style+"}",this.styleSheet.sheet.cssRules.length),c},M.prototype.addRule=function(c){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(c),this.styleSheet.sheet.insertRule(c.selector+" {"+c.style+"}",this.styleSheet.sheet.cssRules.length)},M.prototype.addStyleSheet=function(){var c;this.styleSheet=document.createElement("style"),((c=this.styleSheetRoot)!==null&&c!==void 0?c:document.head).appendChild(this.styleSheet),this.addRule(new He("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new _e("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new _e("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},M.prototype.removeStyleSheet=function(){var c;this.styleSheet&&(((c=this.styleSheetRoot)!==null&&c!==void 0?c:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},M}(),He=function(M,c){this.selector=M,this.style=c},_e=function(M,c){this.localName=M,this.style=c},Ae=function(){function M(c,E,k,G,N){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=c,this.displayMode=E,this.markerItems=k,this.uiStyleSettings=G,this.styles=N,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return M.prototype.show=function(c){var E=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var k=document.createElement("div");k.className=this.toolbarBlockStyleClass.name,k.style.whiteSpace="nowrap",this.uiContainer.appendChild(k),this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(N){var ie=document.createElement("div");ie.className=""+E.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",N.typeName),ie.innerHTML=N.icon,ie.addEventListener("click",function(){E.markerToolbarButtonClicked(ie,N)}),E.buttons.push(ie),E.markerButtons.push(ie)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",G.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(G),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},M.prototype.addButtonClickListener=function(c){this.buttonClickListeners.push(c)},M.prototype.removeButtonClickListener=function(c){this.buttonClickListeners.indexOf(c)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(c),1)},M.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},M.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var c=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var E=0;E<this.markerButtons.length;E++)E<c||E===c&&this.markerButtons.length-1===c?this.markerButtonBlock.appendChild(this.markerButtons[E]):(E===c&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[E]))}},M.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},M.prototype.resetButtonStyles=function(){var c=this;this.buttons.forEach(function(E){E.className=E.className.replace(c.uiStyleSettings.toolbarButtonStyleColorsClassName?c.uiStyleSettings.toolbarButtonStyleColorsClassName:c.toolbarButtonStyleColorsClass.name,"").trim(),E.className=E.className.replace(c.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?c.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:c.toolbarActiveButtonStyleColorsClass.name,"").trim(),E.className+=" "+(c.uiStyleSettings.toolbarButtonStyleColorsClassName?c.uiStyleSettings.toolbarButtonStyleColorsClassName:c.toolbarButtonStyleColorsClass.name)})},M.prototype.addActionButton=function(c,E,k){var G=this,N=document.createElement("div");switch(N.className=""+this.toolbarButtonStyleClass.name,N.innerHTML=E,N.setAttribute("data-action",k),N.addEventListener("click",function(){G.actionToolbarButtonClicked(N,k)}),k){case"select":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":N.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":N.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":N.style.fill=this.uiStyleSettings.closeButtonColor}c.appendChild(N),this.buttons.push(N)},M.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _e("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new _e("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _e("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new _e("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new _e("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var c=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _e("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*c)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*c)+`px;
padding: `+c+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _e("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _e("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},M.prototype.markerToolbarButtonClicked=function(c,E){this.setActiveButton(c),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("marker",E)}),this.markerButtonOverflowBlock.style.display="none"},M.prototype.actionToolbarButtonClicked=function(c,E){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("action",E)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},M.prototype.setActiveButton=function(c){this.resetButtonStyles(),c.className=c.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),c.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},M.prototype.setActiveMarkerButton=function(c){var E=this.markerButtons.find(function(k){return k.getAttribute("data-type-name")===c});E&&this.setActiveButton(E)},M.prototype.setCurrentMarker=function(c){var E=this;this.currentMarker=c,this.buttons.filter(function(k){return/delete|notes/.test(k.getAttribute("data-action"))}).forEach(function(k){E.currentMarker===void 0?(k.style.fillOpacity="0.4",k.style.pointerEvents="none"):(k.style.fillOpacity="1",k.style.pointerEvents="all")})},M}(),Se=function(){function M(c,E,k,G){this.panels=[],this.panelButtons=[],this.markerjsContainer=c,this.displayMode=E,this.uiStyleSettings=k,this.styles=G,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return M.prototype.addStyles=function(){var c;this.toolboxStyleClass=this.styles.addClass(new _e("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 _e("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new _e("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new _e("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new _e("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 _e("toolbox-panel-row_colors",`
background-color: `+((c=this.uiStyleSettings.toolboxBackgroundColor)!==null&&c!==void 0?c:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new _e("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
padding: `+E+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},M.prototype.show=function(c){var E;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolboxStyleClass.name+" "+((E=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&E!==void 0?E:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},M.prototype.setPanelButtons=function(c){var E,k,G=this;this.panels=c,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((E=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&E!==void 0?E:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(N){var ie;N.uiStyleSettings=G.uiStyleSettings;var Ee=document.createElement("div");Ee.className=G.toolboxButtonStyleClass.name+" "+((ie=G.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:G.toolboxButtonStyleColorsClass.name),Ee.innerHTML=N.icon,Ee.title=N.title,Ee.addEventListener("click",function(){G.panelButtonClick(N)}),G.panelButtons.push(Ee),G.buttonRow.appendChild(Ee)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},M.prototype.panelButtonClick=function(c){var E=this,k=-1;if(c!==this.activePanel){k=this.panels.indexOf(c),this.panelRow.innerHTML="";var G=c.getUi();G.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(G),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=c}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){E.displayMode==="inline"?E.panelRow.style.display="none":E.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(N,ie){var Ee,je;N.className=E.toolboxButtonStyleClass.name+" "+(ie===k?""+((Ee=E.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:E.toolboxActiveButtonStyleColorsClass.name):""+((je=E.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:E.toolboxButtonStyleColorsClass.name))})},M}(),X=function(M,c){this.title=M,this.icon=c},ne=function(M){function c(E,k,G,N){var ie=M.call(this,E,N||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ie.colors=[],ie.addTransparent=!1,ie.colorBoxes=[],ie.colors=k,ie.currentColor=G,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.whiteSpace="nowrap",this.colors.forEach(function(G){var N=E.getColorBox(G);k.appendChild(N),E.colorBoxes.push(N)}),k},c.prototype.getColorBox=function(E){var k=this,G=this.uiStyleSettings.toolbarHeight/4,N=this.uiStyleSettings.toolbarHeight-G,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=N-2+"px",ie.style.height=N-2+"px",ie.style.padding="1px",ie.style.marginRight="2px",ie.style.marginBottom="2px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderRadius=(N+2)/2+"px",ie.style.borderColor=E===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){k.setCurrentColor(E,ie)});var Ee=document.createElement("div");return Ee.style.display="inline-block",Ee.style.width=N-2+"px",Ee.style.height=N-2+"px",Ee.style.backgroundColor=E,Ee.style.borderRadius=N/2+"px",E==="transparent"&&(Ee.style.fill=this.uiStyleSettings.toolboxAccentColor,Ee.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ie.appendChild(Ee),ie},c.prototype.setCurrentColor=function(E,k){var G=this;this.currentColor=E,this.colorBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(E)},c}(X),ue=function(){function M(c,E,k){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=E,this.globalSettings=k,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(M.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),M.prototype.ownsTarget=function(c){return!1},Object.defineProperty(M.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),M.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},M.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},M.prototype.pointerDown=function(c,E){},M.prototype.dblClick=function(c,E){},M.prototype.manipulate=function(c){},M.prototype.pointerUp=function(c){this.stateChanged()},M.prototype.dispose=function(){},M.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},M.prototype.getState=function(){return{typeName:M.typeName,state:this.state,notes:this.notes}},M.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},M.prototype.scale=function(c,E){},M.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},M.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},M.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},M.typeName="MarkerBase",M}(),de=function(){function M(){this.findGripByVisual=this.findGripByVisual.bind(this)}return M.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},M}(),xe=function(){function M(){this.GRIP_SIZE=10,this.visual=J.createGroup(),this.visual.appendChild(J.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(J.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return M.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},M}(),Te=function(){function M(){}return M.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},M.toSVGMatrix=function(c,E){return c.a=E.a,c.b=E.b,c.c=E.c,c.d=E.d,c.e=E.e,c.f=E.f,c},M}(),Le=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.left=0,N.top=0,N.width=0,N.height=0,N.defaultSize={x:50,y:20},N.offsetX=0,N.offsetY=0,N.rotationAngle=0,N.CB_DISTANCE=10,N._suppressMarkerCreateEvent=!1,N.container.transform.baseVal.appendItem(J.createTransform()),N.setupControlBox(),N}return ce(c,M),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(E){this._visual=E;var k=J.createTransform();this._visual.transform.baseVal.appendItem(k)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!!M.prototype.ownsTarget.call(this,E)||!!(this.controlGrips.findGripByVisual(E)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(E))},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="new"&&(this.left=E.x,this.top=E.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var G=this.unrotatePoint(E);if(this.manipulationStartX=G.x,this.manipulationStartY=G.y,this.offsetX=G.x-this.left,this.offsetY=G.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(k),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k)){this.activeGrip=this.rotatorGrip;var N=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=N.x-this.width/2,this.top=N.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ie=this.container.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(E){var k=this.state;M.prototype.pointerUp.call(this,E),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(E),this._state="select",k==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(E){this.visual.style.transform="translate("+E.x+"px, "+E.y+"px)"},c.prototype.manipulate=function(E){var k=this.unrotatePoint(E);this.state==="creating"?this.resize(E):this.state==="move"?(this.left=this.manipulationStartLeft+(k.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(k.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(k):this.state==="rotate"&&this.rotate(E)},c.prototype.resize=function(E){var k=this.manipulationStartLeft,G=this.manipulationStartWidth,N=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:k=this.manipulationStartLeft+E.x-this.manipulationStartX,G=this.manipulationStartWidth+this.manipulationStartLeft-k;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:G=this.manipulationStartWidth+E.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:N=this.manipulationStartTop+E.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-N;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+E.y-this.manipulationStartY}G>=0?(this.left=k,this.width=G):(this.left=k+G,this.width=-G),ie>=0?(this.top=N,this.height=ie):(this.top=N+ie,this.height=-ie),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(E){if(Math.abs(E.x-this.centerX)>.1){var k=Math.sign(E.x-this.centerX);this.rotationAngle=180*Math.atan((E.y-this.centerY)/(E.x-this.centerX))/Math.PI+90*k,this.applyRotation()}},c.prototype.applyRotation=function(){var E=this.container.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(E,0)},c.prototype.rotatePoint=function(E){if(this.rotationAngle===0)return E;var k=this.container.getCTM(),G=J.createPoint(E.x,E.y);return{x:(G=G.matrixTransform(k)).x,y:G.y}},c.prototype.unrotatePoint=function(E){if(this.rotationAngle===0)return E;var k=this.container.getCTM();k=k.inverse();var G=J.createPoint(E.x,E.y);return{x:(G=G.matrixTransform(k)).x,y:G.y}},c.prototype.select=function(){M.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){M.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=J.createGroup();var E=J.createTransform();E.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(E),this.container.appendChild(this.controlBox),this.controlRect=J.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=J.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 de,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var E=this.controlBox.transform.baseVal.getItem(0);E.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(E,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()},c.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()},c.prototype.createGrip=function(){var E=new xe;return E.visual.transform.baseVal.appendItem(J.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.controlGrips.topLeft.GRIP_SIZE,k=-E/2,G=k,N=(this.width+this.CB_DISTANCE)/2-E/2,ie=(this.height+this.CB_DISTANCE)/2-E/2,Ee=this.height+this.CB_DISTANCE-E/2,je=this.width+this.CB_DISTANCE-E/2;this.positionGrip(this.controlGrips.topLeft.visual,k,G),this.positionGrip(this.controlGrips.topCenter.visual,N,G),this.positionGrip(this.controlGrips.topRight.visual,je,G),this.positionGrip(this.controlGrips.centerLeft.visual,k,ie),this.positionGrip(this.controlGrips.centerRight.visual,je,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,k,Ee),this.positionGrip(this.controlGrips.bottomCenter.visual,N,Ee),this.positionGrip(this.controlGrips.bottomRight.visual,je,Ee),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,N,G-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(E,k,G){var N=E.transform.baseVal.getItem(0);N.setTranslate(k,G),E.transform.baseVal.replaceItem(N,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Te.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Te.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},M.prototype.getState.call(this))},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E);var k=E;this.left=k.left,this.top=k.top,this.width=k.width,this.height=k.height,this.rotationAngle=k.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Te.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,k.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Te.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,k.containerTransformMatrix))},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k);var G=this.rotatePoint({x:this.left,y:this.top}),N=this.unrotatePoint({x:G.x*E,y:G.y*k});this.left=N.x,this.top=N.y,this.width=this.width*E,this.height=this.height*k,this.adjustControlBox()},c}(ue),Pe=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.createVisual=N.createVisual.bind(N),N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=J.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)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){M.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){M.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){M.prototype.setSize.call(this),J.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){M.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&J.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&J.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&J.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&J.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},M.prototype.getState.call(this))},c.prototype.restoreState=function(E){var k=E;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),M.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.setSize()},c.title="Rectangle marker",c}(Le),oe=function(M){function c(E,k,G,N){var ie=M.call(this,E,N||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ie.widths=[],ie.widthBoxes=[],ie.widths=k,ie.currentWidth=G,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.widths.forEach(function(G){var N=document.createElement("div");N.style.display="flex",N.style.flexGrow="2",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=G===E.currentWidth?E.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){E.setCurrentWidth(G,N)}),k.appendChild(N);var ie=document.createElement("div");ie.innerText=G.toString(),ie.style.marginRight="5px",N.appendChild(ie);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.display="flex",Ee.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=G+"px solid "+E.uiStyleSettings.toolboxColor,je.style.flexGrow="2",Ee.appendChild(je),N.appendChild(Ee),E.widthBoxes.push(N)}),k},c.prototype.setCurrentWidth=function(E,k){var G=this;this.currentWidth=E,this.widthBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(X),ke=function(M){function c(E,k,G,N){var ie=M.call(this,E,N||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ie.styles=[],ie.styleBoxes=[],ie.styles=k,ie.currentStyle=G,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.styles.forEach(function(G){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/E.styles.length-5+"%",N.style.borderColor=G===E.currentStyle?E.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){E.setCurrentStyle(G,N)}),k.appendChild(N);var ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Ee=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+E.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(G!==""?'stroke-dasharray="'+G+'"':"")+` />
</svg>`;ie.innerHTML=Ee,N.appendChild(ie),E.styleBoxes.push(N)}),k},c.prototype.setCurrentStyle=function(E,k){var G=this;this.currentStyle=E,this.styleBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(X),De=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.strokeColor=G.defaultColor,N.strokeWidth=G.defaultStrokeWidth,N.strokeDasharray=G.defaultStrokeDasharray,N.strokePanel=new ne("Line color",G.defaultColorSet,G.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new oe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new ke("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return ce(c,M),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=M.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="FrameMarker",c.title="Frame marker",c.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',c}(Pe),Ce=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},Ge=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.x1=0,N.y1=0,N.x2=0,N.y2=0,N.defaultLength=50,N.manipulationStartX=0,N.manipulationStartY=0,N.manipulationStartX1=0,N.manipulationStartY1=0,N.manipulationStartX2=0,N.manipulationStartY2=0,N.setupControlBox(),N}return ce(c,M),c.prototype.ownsTarget=function(E){return!!M.prototype.ownsTarget.call(this,E)||!(!this.grip1.ownsTarget(E)&&!this.grip2.ownsTarget(E))},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.manipulationStartX=E.x,this.manipulationStartY=E.y,this.state==="new"&&(this.x1=E.x,this.y1=E.y,this.x2=E.x,this.y2=E.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(k)?this.activeGrip=this.grip1:this.grip2.ownsTarget(k)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(E){var k=this.state;M.prototype.pointerUp.call(this,E),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(E),this._state="select",k==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(E){this.state==="creating"?this.resize(E):this.state==="move"?(this.x1=this.manipulationStartX1+E.x-this.manipulationStartX,this.y1=this.manipulationStartY1+E.y-this.manipulationStartY,this.x2=this.manipulationStartX2+E.x-this.manipulationStartX,this.y2=this.manipulationStartY2+E.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(E)},c.prototype.resize=function(E){switch(this.activeGrip){case this.grip1:this.x1=E.x,this.y1=E.y;break;case this.grip2:case void 0:this.x2=E.x,this.y2=E.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){M.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){M.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=J.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var E=new xe;return E.visual.transform.baseVal.appendItem(J.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-E/2,this.y1-E/2),this.positionGrip(this.grip2.visual,this.x2-E/2,this.y2-E/2)},c.prototype.positionGrip=function(E,k,G){var N=E.transform.baseVal.getItem(0);N.setTranslate(k,G),E.transform.baseVal.replaceItem(N,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},M.prototype.getState.call(this))},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E);var k=E;this.x1=k.x1,this.y1=k.y1,this.x2=k.x2,this.y2=k.y2},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.x1=this.x1*E,this.y1=this.y1*k,this.x2=this.x2*E,this.y2=this.y2*k,this.adjustVisual(),this.adjustControlBox()},c}(ue),Be=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.strokeColor=G.defaultColor,N.strokeWidth=G.defaultStrokeWidth,N.strokeDasharray=G.defaultStrokeDasharray,N.strokePanel=new ne("Line color",G.defaultColorSet,G.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new oe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new ke("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorLine&&E!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=J.createGroup(),this.selectorLine=J.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=J.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)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.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()),J.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),J.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),J.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E);var k=E;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',c}(Ge),ve=function(M){function c(E,k,G,N){var ie=M.call(this,E,N||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ie.fonts=[],ie.fontBoxes=[],ie.fonts=k,ie.currentFont=G,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.flexGrow="2",this.fonts.forEach(function(G){var N=document.createElement("div");N.style.display="inline-block",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/E.fonts.length-5+"%",N.style.borderColor=G===E.currentFont?E.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){E.setCurrentFont(G,N)}),k.appendChild(N);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=G,ie.style.overflow="hidden";var Ee=document.createElement("div");Ee.style.whiteSpace="nowrap",Ee.style.overflow="hidden",Ee.style.textOverflow="ellipsis",Ee.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Ee),N.appendChild(ie),E.fontBoxes.push(N)}),k},c.prototype.setCurrentFont=function(E,k){var G=this;this.currentFont=E,this.fontBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(X),be=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.color="transparent",N.padding=5,N.DEFAULT_TEXT="your text here",N.text=N.DEFAULT_TEXT,N.isMoved=!1,N.color=G.defaultColor,N.fontFamily=G.defaultFontFamily,N.defaultSize={x:100,y:30},N.setColor=N.setColor.bind(N),N.setFont=N.setFont.bind(N),N.renderText=N.renderText.bind(N),N.sizeText=N.sizeText.bind(N),N.textEditDivClicked=N.textEditDivClicked.bind(N),N.showTextEditor=N.showTextEditor.bind(N),N.setSize=N.setSize.bind(N),N.positionTextEditor=N.positionTextEditor.bind(N),N.colorPanel=new ne("Color",G.defaultColorSet,G.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.fontFamilyPanel=new ve("Font",G.defaultFontFamilies,G.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N}return ce(c,M),c.prototype.ownsTarget=function(E){if(M.prototype.ownsTarget.call(this,E)||E===this.visual||E===this.textElement||E===this.bgRectangle)return!0;var k=!1;return this.textElement.childNodes.forEach(function(G){G===E&&(k=!0)}),k},c.prototype.createVisual=function(){this.visual=J.createGroup(),this.bgRectangle=J.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=J.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(J.createTransform()),this.textElement.transform.baseVal.appendItem(J.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.isMoved=!1,this.pointerDownPoint=E,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.renderText=function(){var E=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(k){E.textElement.appendChild(J.createTSpan(k.trim()===""?" ":k.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var E=this.textElement.getBBox(),k=1;if(E.width>0&&E.height>0){var G=(1*this.width-this.width*this.padding*2/100)/E.width,N=(1*this.height-this.height*this.padding*2/100)/E.height;k=Math.min(G,N)}return k},c.prototype.getTextPosition=function(E){var k=this.textElement.getBBox(),G=0,N=0;return k.width>0&&k.height>0&&(G=(this.width-k.width*E)/2,N=this.height/2-k.height*E/2),{x:G,y:N}},c.prototype.sizeText=function(){var E=this.textElement.getBBox(),k=this.getTextScale(),G=this.getTextPosition(k);G.y-=E.y*k,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+G.x+"px, "+G.y+"px) scale("+k+", "+k+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(G.x,G.y),this.textElement.transform.baseVal.getItem(1).setScale(k,k))},c.prototype.manipulate=function(E){M.prototype.manipulate.call(this,E),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(E.x-this.pointerDownPoint.x)>5||Math.abs(E.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(E){M.prototype.resize.call(this,E),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){M.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(J.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),J.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(E){var k=this.state;k==="creating"&&(this._suppressMarkerCreateEvent=!0),M.prototype.pointerUp.call(this,E),this.setSize(),(k==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var E=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(k){k.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var k=Number.parseFloat(E.textEditor.style.fontSize);E.textEditor.clientWidth>=Number.parseInt(E.textEditor.style.maxWidth)&&k>.9;)k-=.1,E.textEditor.style.fontSize=Math.max(k,.9)+"em"}),this.textEditor.addEventListener("keyup",function(k){k.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(k){if(k.clipboardData){var G=k.clipboardData.getData("text"),N=window.getSelection();if(!N.rangeCount)return!1;N.deleteFromDocument(),N.getRangeAt(0).insertNode(document.createTextNode(G)),k.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){E.textEditDivClicked(E.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var E=this.getTextScale(),k=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),G=this.textElement.getBBox(),N={x:G.width*E,y:G.height*E};k.x-=N.x/2,k.y-=N.y/2,this.textEditor.style.top=k.y+"px",this.textEditor.style.left=k.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-k.x+"px",this.textEditor.style.fontSize=Math.max(16*E,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(E){this.text=E.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){M.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),M.prototype.deselect.call(this)},c.prototype.dblClick=function(E,k){M.prototype.dblClick.call(this,E,k),this.showTextEditor()},c.prototype.setColor=function(E){this.textElement&&J.setAttributes(this.textElement,[["fill",E]]),this.color=E,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(E)},c.prototype.setFont=function(E){this.textElement&&J.setAttributes(this.textElement,[["font-family",E]]),this.fontFamily=E,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var k=E;this.color=k.color,this.fontFamily=k.fontFamily,this.padding=k.padding,this.text=k.text,this.createVisual(),M.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',c}(Le),se=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.color="transparent",N.lineWidth=3,N.drawing=!1,N.pixelRatio=1,N.color=G.defaultColor,N.lineWidth=G.defaultStrokeWidth,N.pixelRatio=G.freehandPixelRatio,N.setColor=N.setColor.bind(N),N.addCanvas=N.addCanvas.bind(N),N.finishCreation=N.finishCreation.bind(N),N.setLineWidth=N.setLineWidth.bind(N),N.colorPanel=new ne("Color",G.defaultColorSet,G.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.lineWidthPanel=new oe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),N.lineWidthPanel.onWidthChanged=N.setLineWidth,N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=J.createGroup(),this.drawingImage=J.createImage(),this.visual.appendChild(this.drawingImage);var E=J.createTransform();this.visual.transform.baseVal.appendItem(E),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,k){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(E.x,E.y),this.drawing=!0):M.prototype.pointerDown.call(this,E,k)},c.prototype.manipulate=function(E){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(E.x,E.y),this.canvasContext.stroke()):M.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){M.prototype.resize.call(this,E),J.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),J.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):M.prototype.pointerUp.call(this,E)},c.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)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),M.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),M.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var E=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),k=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],G=k[0],N=k[1],ie=k[2],Ee=k[3],je=!1,$e=0;$e<this.canvasElement.height;$e++)for(var we=0;we<this.canvasElement.width;we++)E.data[$e*this.canvasElement.width*4+4*we+3]>0&&(je=!0,$e<N&&(N=$e),we<G&&(G=we),$e>Ee&&(Ee=$e),we>ie&&(ie=we));if(je){this.left=G/this.pixelRatio,this.top=N/this.pixelRatio,this.width=(ie-G)/this.pixelRatio,this.height=(Ee-N)/this.pixelRatio;var nt=document.createElement("canvas");nt.width=ie-G,nt.height=Ee-N,nt.getContext("2d").putImageData(this.canvasContext.getImageData(G,N,ie-G,Ee-N),0,0),this.drawingImgUrl=nt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){J.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),J.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(E){this.color=E,this.colorChanged(E)},c.prototype.setLineWidth=function(E){this.lineWidth=E},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({drawingImgUrl:this.drawingImgUrl},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){this.createVisual(),M.prototype.restoreState.call(this,E),this.drawingImgUrl=E.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',c}(Le),re=function(M){function c(E,k,G){var N=M.call(this,E,G||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return N.typeBoxes=[],N.currentType=k,N.setCurrentType=N.setCurrentType.bind(N),N}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2";for(var G=function(Ee){var je="both";switch(Ee){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var $e=document.createElement("div");if($e.style.display="flex",$e.style.flexGrow="2",$e.style.alignItems="center",$e.style.justifyContent="space-between",$e.style.padding="5px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderColor=je===N.currentType?N.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){E.setCurrentType(je,$e)}),k.appendChild($e),je==="both"||je==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,we.style.marginLeft="5px",$e.appendChild(we)}var nt=document.createElement("div");nt.style.display="flex",nt.style.alignItems="center",nt.style.minHeight="20px",nt.style.flexGrow="2";var _t=document.createElement("hr");if(_t.style.minWidth="20px",_t.style.border="0px",_t.style.borderTop="3px solid "+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee"),_t.style.flexGrow="2",nt.appendChild(_t),$e.appendChild(nt),je==="both"||je==="end"){var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Tt.style.marginRight="5px",$e.appendChild(Tt)}N.typeBoxes.push($e)},N=this,ie=0;ie<4;ie++)G(ie);return k},c.prototype.setCurrentType=function(E,k){var G=this;this.currentType=E,this.typeBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(X),ae=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.arrowType="end",N.arrowBaseHeight=10,N.arrowBaseWidth=10,N.getArrowPoints=N.getArrowPoints.bind(N),N.setArrowType=N.setArrowType.bind(N),N.arrowTypePanel=new re("Arrow type","end"),N.arrowTypePanel.onArrowTypeChanged=N.setArrowType,N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.arrow1&&E!==this.arrow2)},c.prototype.getArrowPoints=function(E,k){var G=this.arrowBaseWidth+2*this.strokeWidth,N=this.arrowBaseHeight+2*this.strokeWidth;return E-G/2+","+(k+N/2)+" "+E+","+(k-N/2)+" "+(E+G/2)+","+(k+N/2)},c.prototype.createTips=function(){this.arrow1=J.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(J.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=J.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(J.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(M.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",J.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),J.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.arrow1.transform.baseVal.getItem(0);k.setRotate(E,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(k,0);var G=this.arrow2.transform.baseVal.getItem(0);G.setRotate(E+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(G,0)}},c.prototype.setArrowType=function(E){this.arrowType=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({arrowType:this.arrowType},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E);var k=E;this.arrowType=k.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',c}(Be),V=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.fillColor=G.defaultFillColor,N.strokeWidth=0,N.fillPanel=new ne("Color",G.defaultColorSet,G.defaultFillColor),N.fillPanel.onColorChanged=N.setFillColor,N}return ce(c,M),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=M.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="CoverMarker",c.title="Cover marker",c.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',c}(Pe),Y=function(M){function c(E,k,G,N){var ie=M.call(this,E,N||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ie.opacities=[],ie.opacityBoxes=[],ie.opacities=k,ie.currentOpacity=G,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return ce(c,M),c.prototype.getUi=function(){var E=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",k.style.justifyContent="space-between",this.opacities.forEach(function(G){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=G===E.currentOpacity?E.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){E.setCurrentOpacity(G,N)}),k.appendChild(N);var ie=document.createElement("div");ie.innerText=100*G+"%",N.appendChild(ie),E.opacityBoxes.push(N)}),k},c.prototype.setCurrentOpacity=function(E,k){var G=this;this.currentOpacity=E,this.opacityBoxes.forEach(function(N){N.style.borderColor=N===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(X),$=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.setOpacity=N.setOpacity.bind(N),N.fillColor=G.defaultHighlightColor,N.strokeWidth=0,N.opacity=G.defaultHighlightOpacity,N.fillPanel=new ne("Color",G.defaultColorSet,N.fillColor),N.fillPanel.onColorChanged=N.setFillColor,N.opacityPanel=new Y("Opacity",G.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return ce(c,M),c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&J.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=M.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',c}(V),Z='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',fe=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.bgColor="transparent",N.tipPosition={x:0,y:0},N.tipBase1Position={x:0,y:0},N.tipBase2Position={x:0,y:0},N.tipMoving=!1,N.color=G.defaultStrokeColor,N.bgColor=G.defaultFillColor,N.fontFamily=G.defaultFontFamily,N.defaultSize={x:100,y:30},N.setBgColor=N.setBgColor.bind(N),N.getTipPoints=N.getTipPoints.bind(N),N.positionTip=N.positionTip.bind(N),N.setTipPoints=N.setTipPoints.bind(N),N.colorPanel=new ne("Text color",G.defaultColorSet,N.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),N.colorPanel.onColorChanged=N.setColor,N.bgColorPanel=new ne("Fill color",G.defaultColorSet,N.bgColor,Z),N.bgColorPanel.onColorChanged=N.setBgColor,N.fontFamilyPanel=new ve("Font",G.defaultFontFamilies,G.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N.tipGrip=new xe,N.tipGrip.visual.transform.baseVal.appendItem(J.createTransform()),N.controlBox.appendChild(N.tipGrip.visual),N}return ce(c,M),c.prototype.ownsTarget=function(E){return M.prototype.ownsTarget.call(this,E)||this.tipGrip.ownsTarget(E)||this.tip===E},c.prototype.createTip=function(){J.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=J.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(E,k){this.state==="new"&&M.prototype.pointerDown.call(this,E,k),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(k)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):M.prototype.pointerDown.call(this,E,k)},c.prototype.pointerUp=function(E){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,M.prototype.pointerUp.call(this,E);else{var k=this.state==="creating";M.prototype.pointerUp.call(this,E),this.setTipPoints(k),this.positionTip()}},c.prototype.manipulate=function(E){if(this.tipMoving){var k=this.unrotatePoint(E);this.tipPosition={x:k.x-this.manipulationStartLeft,y:k.y-this.manipulationStartTop},this.positionTip()}else M.prototype.manipulate.call(this,E)},c.prototype.setBgColor=function(E){this.bgRectangle&&this.tip&&(J.setAttributes(this.bgRectangle,[["fill",E]]),J.setAttributes(this.tip,[["fill",E]])),this.bgColor=E,this.fillColorChanged(E)},c.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},c.prototype.setTipPoints=function(E){E===void 0&&(E=!1);var k=Math.min(this.height/2,15),G=this.height/5;E&&(this.tipPosition={x:k+G/2,y:this.height+20});var N=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:0},this.tipBase2Position={x:k+G,y:0}):(this.tipBase1Position={x:0,y:k},this.tipBase2Position={x:0,y:k+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-G,y:0},this.tipBase2Position={x:this.width-k,y:0}):(this.tipBase1Position={x:this.width,y:k},this.tipBase2Position={x:this.width,y:k+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?N<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-G,y:this.height},this.tipBase2Position={x:this.width-k,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-k-G},this.tipBase2Position={x:this.width,y:this.height-k}):N<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:this.height},this.tipBase2Position={x:k+G,y:this.height}):(this.tipBase1Position={x:0,y:this.height-k},this.tipBase2Position={x:0,y:this.height-k-G})},c.prototype.resize=function(E){M.prototype.resize.call(this,E),this.positionTip()},c.prototype.positionTip=function(){J.setAttributes(this.tip,[["points",this.getTipPoints()]]);var E=this.tipGrip.visual.transform.baseVal.getItem(0);E.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(E,0)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.positionTip(),M.prototype.select.call(this)},c.prototype.getState=function(){var E=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var k=E;this.bgColor=k.bgColor,this.tipPosition=k.tipPosition,M.prototype.restoreState.call(this,E),this.createTip(),this.setTipPoints()},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.tipPosition={x:this.tipPosition.x*E,y:this.tipPosition.y*k},this.positionTip()},c.typeName="CalloutMarker",c.title="Callout marker",c.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',c}(be),ye=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.strokeColor=G.defaultColor,N.strokeWidth=G.defaultStrokeWidth,N.strokeDasharray=G.defaultStrokeDasharray,N.fillColor=G.defaultFillColor,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.setOpacity=N.setOpacity.bind(N),N.createVisual=N.createVisual.bind(N),N.strokePanel=new ne("Line color",ee(G.defaultColorSet,["transparent"]),G.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.fillPanel=new ne("Fill color",ee(G.defaultColorSet,["transparent"]),N.fillColor,Z),N.fillPanel.onColorChanged=N.setFillColor,N.strokeWidthPanel=new oe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new ke("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N.opacityPanel=new Y("Opacity",G.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=J.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){M.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){M.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){M.prototype.setSize.call(this),J.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},c.prototype.pointerUp=function(E){M.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&J.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&J.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(E),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&J.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&J.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&J.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var k=E;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),M.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,k){M.prototype.scale.call(this,E,k),this.setSize()},c.typeName="EllipseMarker",c.title="Ellipse marker",c.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',c}(Le),Oe=function(M){function c(E,k,G){return M.call(this,E,k,G)||this}return ce(c,M),Object.defineProperty(c.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.tip1&&E!==this.tip2)},c.prototype.createTips=function(){this.tip1=J.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(J.createTransform()),this.visual.appendChild(this.tip1),this.tip2=J.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(J.createTransform()),this.visual.appendChild(this.tip2)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(M.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(J.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),J.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.tip1.transform.baseVal.getItem(0);k.setRotate(E,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(k,0);var G=this.tip2.transform.baseVal.getItem(0);G.setRotate(E+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(G,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=M.prototype.getState.call(this);return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',c}(Be),Ue=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.strokePanel.colors=G.defaultColorSet,N.fillColor="transparent",N}return ce(c,M),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=M.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',c}(ye),We=function(){function M(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(M.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),M.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},M.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},M.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},M.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},M.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},M}(),Ne=function(M){function c(E,k,G){var N=M.call(this,E,k,G)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.curveX=0,N.curveY=0,N.manipulationStartCurveX=0,N.manipulationStartCurveY=0,N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.positionGrips=N.positionGrips.bind(N),N.addControlGrips=N.addControlGrips.bind(N),N.adjustVisual=N.adjustVisual.bind(N),N.setupControlBox=N.setupControlBox.bind(N),N.resize=N.resize.bind(N),N.strokeColor=G.defaultColor,N.strokeWidth=G.defaultStrokeWidth,N.strokeDasharray=G.defaultStrokeDasharray,N.strokePanel=new ne("Line color",G.defaultColorSet,G.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new oe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new ke("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return ce(c,M),c.prototype.ownsTarget=function(E){return!(!M.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorCurve&&E!==this.visibleCurve&&!this.curveGrip.ownsTarget(E))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=J.createGroup(),this.selectorCurve=J.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=J.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)},c.prototype.pointerDown=function(E,k){M.prototype.pointerDown.call(this,E,k),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=E.x,this.curveY=E.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(k)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),J.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),J.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),J.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){M.prototype.setupControlBox.call(this),this.curveControlLine1=J.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=J.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)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,M.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){M.prototype.positionGrips.call(this);var E=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-E/2,this.curveY-E/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()))},c.prototype.manipulate=function(E){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+E.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+E.y-this.manipulationStartY),M.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){this.activeGrip===this.curveGrip&&(this.curveX=E.x,this.curveY=E.y),M.prototype.resize.call(this,E),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual()},c.prototype.scale=function(E,k){this.curveX=this.curveX*E,this.curveY=this.curveY*k,M.prototype.scale.call(this,E,k)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},M.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){M.prototype.restoreState.call(this,E);var k=E;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.curveX=k.curveX,this.curveY=k.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',c}(Ge),Ve=function(){function M(c,E){E===void 0&&(E=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=E}return Object.defineProperty(M.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),M.prototype.preventDefault=function(){this._defaultPrevented=!0},M}(),qe=function(M){function c(E,k,G){var N=M.call(this,E,!1)||this;return N.dataUrl=k,N.state=G,N}return ce(c,M),c}(Ve),ze=function(M){function c(E,k,G){G===void 0&&(G=!1);var N=M.call(this,E,G)||this;return N.marker=k,N}return ce(c,M),c}(Ve),rt=function(){function M(){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 M.prototype.addEventListener=function(c,E){this[c].push(E)},M.prototype.removeEventListener=function(c,E){var k=this[c].indexOf(E);k>-1&&this[c].splice(k,1)},M}(),lt=function(){function M(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,this._isOpen=!1,this.undoRedoManager=new We,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=M.instanceCounter++,this.styles=new Fe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.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(M.prototype,"ALL_MARKER_TYPES",{get:function(){return[De,se,ae,be,Ue,ye,$,fe,Oe,V,Be,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[De,se,ae,be,ye,$,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"BASIC_MARKER_TYPES",{get:function(){return[De,se,ae,be,$]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var E=this;this._availableMarkerTypes.splice(0),c.forEach(function(k){if(typeof k=="string"){var G=E.ALL_MARKER_TYPES.find(function(N){return N.typeName===k});G!==void 0&&E._availableMarkerTypes.push(G)}else E._availableMarkerTypes.push(k)})},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,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(M.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),M.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},M.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&Ie.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ie.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(E){return E(new Ve(c))})},M.prototype.render=function(){return pe(this,void 0,void 0,function(){var c;return ge(this,function(E){switch(E.label){case 0:return this.setCurrentMarker(),(c=new Me).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return E.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,E.sent()]}})})},M.prototype.close=function(c){var E=this;if(c===void 0&&(c=!1),this.isOpen){var k=!1;c||this.eventListeners.beforeclose.forEach(function(G){var N=new Ve(E,!0);G(N),N.defaultPrevented&&(k=!0)}),k||(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(G){return G(new Ve(E))}),this.detachEvents(),this._isOpen=!1)}},M.prototype.addMarkersToToolbar=function(){for(var c,E=[],k=0;k<arguments.length;k++)E[k]=arguments[k];(c=this._availableMarkerTypes).push.apply(c,E)},M.prototype.addRenderEventListener=function(c){this.addEventListener("render",function(E){c(E.dataUrl,E.state)})},M.prototype.removeRenderEventListener=function(c){},M.prototype.addCloseEventListener=function(c){this.addEventListener("close",function(){c()})},M.prototype.removeCloseEventListener=function(c){},M.prototype.setupResizeObserver=function(){var c=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return c.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},M.prototype.onPopupTargetResize=function(){var c=1*this.target.clientWidth/this.target.clientHeight,E=this.editorCanvas.clientWidth/c>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,k=E<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/c;this.resize(E,k)},M.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},M.prototype.resize=function(c,E){this._isResizing=!0;var k=c/this.imageWidth,G=E/this.imageHeight;this.imageWidth=Math.round(c),this.imageHeight=Math.round(E),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(k,G),this._isResizing=!1},M.prototype.scaleMarkers=function(c,E){var k,G=this;this._currentMarker&&this._currentMarker instanceof be?this._currentMarker.scale(c,E):(k=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(N){N!==G._currentMarker&&N.scale(c,E)}),k!==void 0&&this.setCurrentMarker(k)},M.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},M.prototype.setTopLeft=function(){var c=this.editingTarget.getBoundingClientRect(),E=this.editorCanvas.getBoundingClientRect();this.left=c.left-E.left,this.top=c.top-E.top},M.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},M.prototype.addDefs=function(){for(var c,E=[],k=0;k<arguments.length;k++)E[k]=arguments[k];this.defs=J.createDefs(),this.addDefsToImage(),(c=this.defs).append.apply(c,E)},M.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},M.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},M.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},M.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},M.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},M.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},M.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},M.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var c=document.createElement("a");c.href="https://markerjs.com/",c.target="_blank",c.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},M.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")},M.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"},M.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},M.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 c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"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 Ae(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Se(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},M.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},M.prototype.removeMarker=function(c){this.markerImage.removeChild(c.container),this.markers.indexOf(c)>-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},M.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())},M.prototype.toolbarButtonClicked=function(c,E){if(c==="marker"&&E!==void 0)this.createNewMarker(E);else if(c==="action")switch(E){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()}},M.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var E=!1;if(this.eventListeners.markerbeforedelete.forEach(function(G){var N=new ze(c,c._currentMarker,!0);G(N),N.defaultPrevented&&(E=!0)}),!E){var k=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(G){return G(new ze(c,k))})}}},M.prototype.clear=function(){var c=this,E=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Ee=new ze(c,void 0,!0);ie(Ee),Ee.defaultPrevented&&(E=!0)}),!E)){this.setCurrentMarker();for(var k=function(ie){var Ee=G.markers[ie];G.setCurrentMarker(G.markers[ie]),G._currentMarker.dispose(),G.markerImage.removeChild(G._currentMarker.container),G.markers.splice(G.markers.indexOf(G._currentMarker),1),G.eventListeners.markerdelete.forEach(function(je){return je(new ze(c,Ee))})},G=this,N=this.markers.length-1;N>=0;N--)k(N);this.addUndoStep()}},Object.defineProperty(M.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),M.prototype.showNotesEditor=function(){var c;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=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},M.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)},M.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},M.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var E=this.getState(),k=this.undoRedoManager.getLastUndoStep();if(!k||k.width===E.width&&k.height===E.height){var G=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(E),G<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(N){return N(new Ve(c))})}else this.undoRedoManager.replaceLastUndoStep(E),this.eventListeners.statechange.forEach(function(N){return N(new Ve(c))})}},M.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},M.prototype.undoStep=function(){var c=this,E=this.undoRedoManager.undo();E!==void 0&&(this.restoreState(E),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Ve(c))}))},M.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},M.prototype.redoStep=function(){var c=this,E=this.undoRedoManager.redo();E!==void 0&&(this.restoreState(E),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Ve(c))}))},M.prototype.stepZoom=function(){var c=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=c<this.zoomSteps.length-1?this.zoomSteps[c+1]:this.zoomSteps[0]},M.prototype.panTo=function(c){this.contentDiv.scrollBy({left:this.prevPanPoint.x-c.x,top:this.prevPanPoint.y-c.y}),this.prevPanPoint=c},M.prototype.startRenderAndClose=function(){return pe(this,void 0,void 0,function(){var c,E,k=this;return ge(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return c=G.sent(),E=this.getState(),this.eventListeners.render.forEach(function(N){return N(new qe(k,c,E))}),this.close(!0),[2]}})})},M.prototype.getState=function(c){c===!0&&this.setCurrentMarker();var E={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(k){return E.markers.push(k.getState())}),E},M.prototype.restoreState=function(c){var E=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);c.markers.forEach(function(k){var G=E._availableMarkerTypes.find(function(ie){return ie.typeName===k.typeName});if(G!==void 0){var N=E.addNewMarker(G);N.restoreState(k),E.markers.push(N)}}),c.width&&c.height&&(c.width!==this.imageWidth||c.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/c.width,this.imageHeight/c.height),this.eventListeners.restorestate.forEach(function(k){return k(new Ve(E))})},M.prototype.addNewMarker=function(c){var E=J.createGroup();return this.markerImage.appendChild(E),new c(E,this.overlayContainer,this.settings)},M.prototype.createNewMarker=function(c){var E,k=this;(E=typeof c=="string"?this._availableMarkerTypes.find(function(G){return G.typeName===c}):c)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(E),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(E.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(G){return G(new ze(k,k._currentMarker))}))},M.prototype.markerCreated=function(c){var E=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(c),this.setCurrentMarker(c),c instanceof se&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(se):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(k){return k(new ze(E,E._currentMarker))})},M.prototype.colorChanged=function(c){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=c,this.settings.defaultStrokeColor=c)},M.prototype.fillColorChanged=function(c){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=c)},M.prototype.markerStateChanged=function(c){var E=this;this.eventListeners.markerchange.forEach(function(k){return k(new ze(E,c))})},M.prototype.setCurrentMarker=function(c){var E=this;this._currentMarker!==c&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(k){return k(new ze(E,E._currentMarker))})),this._currentMarker=c,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(k){return k(new ze(E,E._currentMarker))}))},M.prototype.onPointerDown=function(c){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||c.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var E=this.markers.find(function(k){return k.ownsTarget(c.target)});E!==void 0?(this.setCurrentMarker(E),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(c.clientX,c.clientY),c.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:c.clientX,y:c.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(c.clientX,c.clientY))},M.prototype.onDblClick=function(c){if(this._isFocused||this.focus(),this.mode==="select"){var E=this.markers.find(function(k){return k.ownsTarget(c.target)});E!==void 0&&E!==this._currentMarker&&this.setCurrentMarker(E),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(c.clientX,c.clientY),c.target):this.setCurrentMarker()}},M.prototype.onPointerMove=function(c){this.touchPoints!==1&&c.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||c.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(c.clientX,c.clientY)):this.zoomLevel>1&&this.panTo({x:c.clientX,y:c.clientY}))},M.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},M.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},M.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},M.prototype.clientToLocalCoordinates=function(c,E){var k=this.markerImage.getBoundingClientRect();return{x:(c-k.left)/this.zoomLevel,y:(E-k.top)/this.zoomLevel}},M.prototype.onWindowResize=function(){this.positionUI()},M.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"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()},M.prototype.addLicenseKey=function(c){Re.addKey(c)},M.prototype.addEventListener=function(c,E){this.eventListeners.addEventListener(c,E)},M.prototype.removeEventListener=function(c,E){this.eventListeners.removeEventListener(c,E)},M.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(M.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),M.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(E){return E(new Ve(c))}))},M.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(E){return E(new Ve(c))}))},M.instanceCounter=0,M}();/* **********************************
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 ct=function(M,c){return(ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,k){E.__proto__=k}||function(E,k){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(E[G]=k[G])})(M,c)};function et(M,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function E(){this.constructor=M}ct(M,c),M.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function ut(M,c,E,k){return new(E||(E=Promise))(function(G,N){function ie($e){try{je(k.next($e))}catch(we){N(we)}}function Ee($e){try{je(k.throw($e))}catch(we){N(we)}}function je($e){var we;$e.done?G($e.value):(we=$e.value,we instanceof E?we:new E(function(nt){nt(we)})).then(ie,Ee)}je((k=k.apply(M,c||[])).next())})}function gt(M,c){var E,k,G,N,ie={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return N={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function Ee(je){return function($e){return function(we){if(E)throw new TypeError("Generator is already executing.");for(;ie;)try{if(E=1,k&&(G=2&we[0]?k.return:we[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,we[1])).done)return G;switch(k=0,G&&(we=[2&we[0],G.value]),we[0]){case 0:case 1:G=we;break;case 4:return ie.label++,{value:we[1],done:!1};case 5:ie.label++,k=we[1],we=[0];continue;case 7:we=ie.ops.pop(),ie.trys.pop();continue;default:if(!(G=ie.trys,(G=G.length>0&&G[G.length-1])||we[0]!==6&&we[0]!==2)){ie=0;continue}if(we[0]===3&&(!G||we[1]>G[0]&&we[1]<G[3])){ie.label=we[1];break}if(we[0]===6&&ie.label<G[1]){ie.label=G[1],G=we;break}if(G&&ie.label<G[2]){ie.label=G[2],ie.ops.push(we);break}G[2]&&ie.ops.pop(),ie.trys.pop();continue}we=c.call(M,ie)}catch(nt){we=[6,nt],k=0}finally{E=G=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([je,$e])}}}var Lt=function(){function M(){}return M.addKey=function(c){M.key=c},Object.defineProperty(M,"isLicensed",{get:function(){return!!M.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(M.key)},enumerable:!1,configurable:!0}),M}(),Ye=function(){function M(){}return M.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},M.setAttributes=function(c,E){for(var k=0,G=E;k<G.length;k++){var N=G[k],ie=N[0],Ee=N[1];c.setAttribute(ie,Ee)}},M.createRect=function(c,E,k){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",c.toString()),G.setAttribute("height",E.toString()),k&&M.setAttributes(G,k),G},M.createLine=function(c,E,k,G,N){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",c.toString()),ie.setAttribute("y1",E.toString()),ie.setAttribute("x2",k.toString()),ie.setAttribute("y2",G.toString()),N&&M.setAttributes(ie,N),ie},M.createPolygon=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",c),E&&M.setAttributes(k,E),k},M.createCircle=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(c/2).toString()),k.setAttribute("cy",(c/2).toString()),k.setAttribute("r",c.toString()),E&&M.setAttributes(k,E),k},M.createEllipse=function(c,E,k){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(c/2).toString()),G.setAttribute("cy",(E/2).toString()),G.setAttribute("rx",(c/2).toString()),G.setAttribute("ry",(E/2).toString()),k&&M.setAttributes(G,k),G},M.createGroup=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","g");return c&&M.setAttributes(E,c),E},M.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},M.createMarker=function(c,E,k,G,N,ie,Ee){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return M.setAttributes(je,[["id",c],["orient",E],["markerWidth",k.toString()],["markerHeight",G.toString()],["refX",N.toString()],["refY",ie.toString()]]),je.appendChild(Ee),je},M.createText=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","text");return E.setAttribute("x","0"),E.setAttribute("y","0"),c&&M.setAttributes(E,c),E},M.createTSpan=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=c,E&&M.setAttributes(k,E),k},M.createImage=function(c){var E=document.createElementNS("http://www.w3.org/2000/svg","image");return c&&M.setAttributes(E,c),E},M.createPoint=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=c,k.y=E,k},M.createPath=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",c),E&&M.setAttributes(k,E),k},M.createElement=function(c,E){var k=document.createElementNS("http://www.w3.org/2000/svg",c);return E&&M.setAttributes(k,E),k},M.getHollowRectanglePath=function(c,E,k,G,N,ie,Ee,je){return"M"+c+","+E+"V"+(E+G)+"H"+(c+k)+"V"+E+"H"+N+"V"+ie+"H"+(N+Ee)+"V"+(ie+je)+"H"+N+"V"+E+"Z"},M}(),xt=function(){function M(c){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+c+"_"}return Object.defineProperty(M.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),M.prototype.addClass=function(c){return this.styleSheet===void 0&&this.addStyleSheet(),c.name=""+this.classNamePrefix+c.localName,this.classes.push(c),this.styleSheet.sheet.insertRule("."+c.name+" {"+c.style+"}",this.styleSheet.sheet.cssRules.length),c},M.prototype.addRule=function(c){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(c),this.styleSheet.sheet.insertRule(c.selector+" {"+c.style+"}",this.styleSheet.sheet.cssRules.length)},M.prototype.addStyleSheet=function(){var c;this.styleSheet=document.createElement("style"),((c=this.styleSheetRoot)!==null&&c!==void 0?c:document.head).appendChild(this.styleSheet),this.addRule(new Je("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ke("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ke("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},M.prototype.removeStyleSheet=function(){var c;this.styleSheet&&(((c=this.styleSheetRoot)!==null&&c!==void 0?c:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},M}(),Je=function(M,c){this.selector=M,this.style=c},Ke=function(M,c){this.localName=M,this.style=c},Qe=function(){function M(){this.blocks=[],this.display=""}return M.prototype.addButtonBlock=function(c){c.className=this.blockClassName,c.buttonClassName=this.buttonClassName,c.buttonColorsClassName=this.buttonColorsClassName,c.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(c)},M.prototype.addElementBlock=function(c){c.className===void 0&&(c.className=this.blockClassName),this.blocks.push(c)},M.prototype.getUI=function(){var c=document.createElement("div");return c.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,c.style.display=this.display,this.blocks.forEach(function(E){return c.appendChild(E.getUI())}),c},M}(),tt=function(){function M(){}return M.prototype.getUI=function(){var c=document.createElement("div");if(c.className=this.className,this.minWidth!==void 0&&(c.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":c.style.justifyContent="flex-start";break;case"center":c.style.justifyContent="center";break;case"end":c.style.justifyContent="flex-end"}return c.style.whiteSpace="nowrap",c},M}(),vt=function(M){function c(){var E=M!==null&&M.apply(this,arguments)||this;return E.buttons=[],E}return et(c,M),c.prototype.addButton=function(E){E.className=this.buttonClassName,E.colorsClassName=this.buttonColorsClassName,E.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(E)},c.prototype.getUI=function(){var E=M.prototype.getUI.call(this);return this.buttons.forEach(function(k){return E.appendChild(k.getUI())}),E},c}(tt),st=function(){function M(c,E){this._isActive=!1,this._isHidden=!1,this._icon=c,this.title=E,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(M.prototype,"icon",{get:function(){return this._icon},set:function(c){this._icon=c,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isActive",{get:function(){return this._isActive},set:function(c){this._isActive=c,this.adjustClassName()},enumerable:!1,configurable:!0}),M.prototype.getUI=function(){var c=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return c.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},M.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},M.prototype.hide=function(){this._isHidden=!0},M}(),at=function(M){function c(){var E=M!==null&&M.apply(this,arguments)||this;return E.elements=[],E}return et(c,M),c.prototype.addElement=function(E){this.elements.push(E)},c.prototype.getUI=function(){var E=M.prototype.getUI.call(this);return this.elements.forEach(function(k){return E.appendChild(k)}),E},c}(tt),ot=function(){function M(c,E){this.horizontal=c,this.vertical=E}return Object.defineProperty(M.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),M.prototype.getVerticalLength=function(c){return c/this.ratio},M.prototype.getHorizontalLength=function(c){return c*this.ratio},M}(),it=function(){function M(){}return M.getIcon=function(c,E){if(c>0&&E>0){var k=new ot(c,E),G=k.ratio>=1?20:k.getHorizontalLength(20),N=k.ratio<1?20:k.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var Ee=Ye.createDefs();ie.appendChild(Ee);var je=Ye.createElement("clipPath",[["id","text-bg-clip"]]);Ee.appendChild(je);var $e=Ye.createPath(Ye.getHollowRectanglePath((24-G)/2,(24-N)/2,G,N,(24-G)/2+2,(24-N)/2+2,G-4,N-4));ie.appendChild($e);var we=Ye.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);we.appendChild(Ye.createTSpan(c+":"+E)),ie.appendChild(we);var nt=we.getBBox();Ye.setAttributes(we,[["x",((24-nt.width)/2).toString()],["y",((24-nt.height)/2-nt.y).toString()]]);var _t=Ye.createPath(Ye.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(nt.width))/2,(24-Math.ceil(nt.height))/2,Math.ceil(nt.width),Math.ceil(nt.height)));return je.appendChild(_t),Ye.setAttributes($e,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},M}(),ft=function(M){function c(E,k,G){var N=M.call(this,E,k)||this;return N.isDropdownOpen=!1,N.onClick=N.dropdownButtonClicked,N.dropdownButtons=G,N}return et(c,M),c.prototype.setupDropdown=function(){var E=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(k){k.className=E.className,k.colorsClassName=E.colorsClassName,E.dropdownBlock.appendChild(k.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},c.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},c.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},c.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},c.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},c.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},c}(st),Et=function(){function M(c,E){this.GRIP_SIZE=10,this.color=c,this.fillColor=E,this.visual=Ye.createGroup(),this.visual.appendChild(Ye.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ye.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return M.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},M.prototype.setCenter=function(c,E){this.visual.childNodes.forEach(function(k){return Ye.setAttributes(k,[["cx",c.toString()],["cy",E.toString()]])})},M}(),ht=function(){function M(c,E,k,G){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=c,this.canvasHeight=E,this.margin=k,this.container=G,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(M.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(c){this._aspectRatio=c,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.gridContainer&&Ye.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(c){this._zoomFactor=c,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),M.prototype.open=function(){var c=this;this.cropShadeElement=Ye.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ye.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var E=0;E<this.numberOfGridLines;E++)this.horizontalGridLines.push(Ye.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ye.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(k){return c.gridContainer.appendChild(k)}),this.verticalGridLines.forEach(function(k){return c.gridContainer.appendChild(k)}),this.cropRectElement=Ye.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},M.prototype.setCropRectangle=function(c){this.cropRect=c;var E=Object.assign({},this.cropRect);this.zoomFactor!==1&&(E.width=this.cropRect.width*this.zoomFactor,E.height=this.cropRect.height*this.zoomFactor,E.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-E.width/2,E.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-E.height/2),Ye.setAttributes(this.cropRectElement,[["x",E.x.toString()],["y",E.y.toString()],["width",E.width.toString()],["height",E.height.toString()]]);var k=E.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(N,ie){var Ee=E.y+k*(ie+1);Ye.setAttributes(N,[["x1",""+E.x],["y1",""+Ee],["x2",""+(E.x+E.width)],["y2",""+Ee]])});var G=E.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(N,ie){var Ee=E.x+G*(ie+1);Ye.setAttributes(N,[["x1",""+Ee],["y1",""+E.y],["x2",""+Ee],["y2",""+(E.y+E.height)]])}),Ye.setAttributes(this.cropShadeElement,[["d",Ye.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,E.x,E.y,E.width,E.height)]]),this.topLeftGrip.setCenter(E.x,E.y),this.topRightGrip.setCenter(E.x+E.width,E.y),this.bottomLeftGrip.setCenter(E.x,E.y+E.height),this.bottomRightGrip.setCenter(E.x+E.width,E.y+E.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},M.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)},M.prototype.clientToLocalCoordinates=function(c,E){var k=this.container.getBoundingClientRect();return{x:c-k.left+this.margin,y:E-k.top+this.margin}},M.prototype.onPointerDown=function(c){this.container.setPointerCapture(c.pointerId),this.previousPoint=this.clientToLocalCoordinates(c.clientX,c.clientY),this.cropRectElement===c.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(c.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(c.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(c.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(c.target)&&(this.activeGrip=this.bottomRightGrip)},M.prototype.onPointerMove=function(c){if(this.isMoving)this.move(this.clientToLocalCoordinates(c.clientX,c.clientY));else if(this.activeGrip){var E=this.clientToLocalCoordinates(c.clientX,c.clientY);this.resize(E)}c.preventDefault()},M.prototype.onPointerUp=function(c){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(c.pointerId)},M.prototype.move=function(c){var E=c.x-this.previousPoint.x,k=c.y-this.previousPoint.y;this.zoomFactor!==1&&(E=-E/this.zoomFactor,k=-k/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+E),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+k),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=c},M.prototype.resize=function(c){var E=Object.assign({},this.cropRect),k=c.x-this.previousPoint.x,G=c.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:E.x+k<this.margin&&(k=this.margin-E.x),E.x+=k,E.width=this.cropRect.x+this.cropRect.width-E.x;break;case this.bottomRightGrip:case this.topRightGrip:E.width+k>this.canvasWidth*this.zoomFactor&&(k=this.canvasWidth*this.zoomFactor-E.width),E.width+=k}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(E.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(k),E.height=this.aspectRatio.getVerticalLength(E.width)):(E.y+=G,E.height=this.cropRect.y+this.cropRect.height-E.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?E.height=this.aspectRatio.getVerticalLength(E.width):E.height+=G}E.width<10&&(E.x=this.cropRect.x,E.width=10),E.height<10&&(E.y=this.cropRect.y,E.height=10),this.previousPoint=c,E.x>=this.margin&&E.y>=this.margin&&E.x-this.margin+E.width<=this.canvasWidth&&E.y-this.margin+E.height<=this.canvasHeight&&(this.cropRect=E,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},M.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var c=this.cropRect.x+this.cropRect.width/2,E=this.cropRect.y+this.cropRect.height/2,k=this.aspectRatio.getHorizontalLength(this.cropRect.height),G=this.aspectRatio.getVerticalLength(this.cropRect.width);k/this.canvasWidth<G/this.canvasHeight?this.cropRect.width=k:this.cropRect.height=G,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=c-this.cropRect.width/2,this.cropRect.y=E-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)}},M.prototype.getRescaledRect=function(c,E,k,G,N,ie){var Ee=k/c,je=G/E;return{x:(N.x-ie)*Ee+ie,y:(N.y-ie)*je+ie,width:N.width*Ee,height:N.height*je}},M.prototype.scaleCanvas=function(c,E){var k=this.getRescaledRect(this.canvasWidth,this.canvasHeight,c,E,this.cropRect,this.margin);this.canvasWidth=c,this.canvasHeight=E,this.onCropChange&&this.onCropChange(k),this.setCropRectangle(k)},M}(),It=function(){function M(c){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=c,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(M.prototype,"angle",{get:function(){return this._angle},set:function(c){this._angle=c,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),M.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},M.prototype.onPointerDown=function(c){this.controlContainer.setPointerCapture(c.pointerId),this.isDragging=!0,this.previousPoint={x:c.clientX,y:c.clientY}},M.prototype.onPointerMove=function(c){this.isDragging&&(this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.previousPoint.x=c.clientX)},M.prototype.onPointerUp=function(c){this.isDragging&&this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(c.pointerId)},M.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var c=this.angleLabelText.getBBox();Ye.setAttributes(this.angleLabelElement,[["x",((this.width-c.width)/2).toString()],["y",(this.height/2).toString()]])}},M.prototype.positionScaleShape=function(){if(this.scaleShape){var c=this.scaleShape.transform.baseVal.getItem(0);c.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(c,0)}},M.prototype.getVisual=function(){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("width",this.width+"px"),c.setAttribute("height",this.height+"px"),c.setAttribute("viewBox","0 0 "+this.width+" "+this.height),c.style.flexShrink="0",document.body.appendChild(c);for(var E="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,k=1;k<=this.width/5+10;k++){var G=k%5==0?this.height/3:this.height/6;E+="h4v"+-G+"h1v"+G}E+="v1H0Z",this.scaleShape=Ye.createPath(E);var N=Ye.createTransform();this.scaleShape.transform.baseVal.appendItem(N),c.appendChild(this.scaleShape),this.angleLabelElement=Ye.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ye.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=Ye.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),c.appendChild(this.angleLabelElement),document.body.removeChild(c),c},M}(),wt=function(){function M(){this.naturalSize=!1,this.imageType="image/png"}return M.prototype.rasterize=function(c,E,k,G,N,ie,Ee){var je=this;return new Promise(function($e){var we=document.createElement("canvas");we.width=c.width.baseVal.value-2*G,we.height=c.height.baseVal.value-2*G;var nt=1,_t=1;je.naturalSize===!0?(nt=E.naturalWidth/(c.width.baseVal.value-2*G)/ie,_t=E.naturalHeight/(c.height.baseVal.value-2*G)/Ee,we.width=E.naturalWidth/ie,we.height=E.naturalHeight/Ee):je.width!==void 0&&je.height!==void 0&&(nt=je.width/k.width,_t=je.height/k.height,we.width*=nt,we.height*=_t);var Tt=we.getContext("2d");Tt.translate(we.width/2,we.height/2),Tt.rotate(N*Math.PI/180),Tt.scale(ie,Ee),Tt.translate(-we.width/2,-we.height/2),Tt.drawImage(E,0,0,we.width,we.height);var Mt=document.createElement("canvas");Mt.width=k.width*nt,Mt.height=k.height*_t,Mt.getContext("2d").putImageData(Tt.getImageData((k.x-G)*nt,(k.y-G)*_t,k.width*nt,k.height*_t),0,0),$e(Mt.toDataURL(je.imageType,je.imageQuality))})},M}(),dt=function(){function M(c){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=M.instanceCounter++,this.styles=new xt(this.instanceNo),this.target=c,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(M.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(c){this._zoomToCropEnabled=c,c?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"gridLines",{get:function(){return this._gridLines},set:function(c){this._gridLines=c,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(c){this._rotationAngle=c,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"aspectRatio",{get:function(){var c;return(c=this._aspectRatio)!==null&&c!==void 0?c:this.aspectRatios[0]},set:function(c){this._aspectRatio=c},enumerable:!1,configurable:!0}),M.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},M.prototype.show=function(){this.showUI(),this.open()},M.prototype.close=function(c){c===void 0&&(c=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),c||this.closeEventListeners.forEach(function(E){return E()}),this._isOpen=!1)},M.prototype.addRenderEventListener=function(c){this.renderEventListeners.push(c)},M.prototype.removeRenderEventListener=function(c){this.renderEventListeners.indexOf(c)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(c),1)},M.prototype.addCloseEventListener=function(c){this.closeEventListeners.push(c)},M.prototype.removeCloseEventListener=function(c){this.closeEventListeners.indexOf(c)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(c),1)},M.prototype.setupResizeObserver=function(){var c=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.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))},M.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var c=1*this.target.clientWidth/this.target.clientHeight,E=this.contentDiv.clientWidth/c>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*c:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,k=E+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/c;this.resize(E,k)}},M.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},M.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ye.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},M.prototype.resize=function(c,E){this.imageWidth=Math.round(c),this.imageHeight=Math.round(E),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},M.prototype.setEditingTarget=function(){var c=document.createElement("canvas");c.width=this.target.naturalWidth,c.height=this.target.naturalHeight,c.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var E=c.toDataURL();Ye.setAttributes(this.editingTarget,[["href",E]]),this.setEditingTargetSize()},M.prototype.setTopLeft=function(){var c=this.target.getBoundingClientRect(),E=this.editorCanvas.getBoundingClientRect();this.left=c.left-E.left-this.CANVAS_MARGIN,this.top=c.top-E.top-this.CANVAS_MARGIN},M.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ye.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ye.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ye.createGroup(),this.editingTargetRotationScaleContainer=Ye.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var c=Ye.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(c);var E=Ye.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(E),this.editingTargetContainer=Ye.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},M.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},M.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ye.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ht(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},M.prototype.zoomToCrop=function(){if(this.cropRect){var c=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,E=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=c+"px "+E+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-c+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-E+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},M.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},M.prototype.cropRectChanged=function(c){this.cropRect=c,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},M.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},M.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"},M.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},M.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var c=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,E=this.target.offsetTop>c+this.CANVAS_MARGIN?this.target.offsetTop-(c+this.CANVAS_MARGIN):0;this.coverDiv.style.top=E+"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},M.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},M.prototype.addTopToolbar=function(){var c=this;this.topToolbar=new Qe,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 E=new vt;E.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(E);var k=[];this.aspectRatios.forEach(function(_t){var Tt=new st(it.getIcon(_t.horizontal,_t.vertical),_t.horizontal===0&&_t.vertical===0?"FREE":_t.horizontal+":"+_t.vertical);Tt.onClick=function(){return c.ratioButtonClicked(_t)},k.push(Tt)}),this.aspectRatioButton=new ft(it.getIcon(0,0),"Aspect ratio",k),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,E.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var G=new st('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");G.isActive=this.isGridVisible,G.onClick=function(){c.isGridVisible=!c.isGridVisible,G.isActive=c.isGridVisible},E.addButton(G);var N=new st('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(N.isActive=this.zoomToCropEnabled,N.onClick=function(){c.zoomToCropEnabled=!c.zoomToCropEnabled,N.isActive=c.zoomToCropEnabled},E.addButton(N),!Lt.isLicensed){var ie=new at;this.topToolbar.addElementBlock(ie);var Ee=document.createElement("div");Ee.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Ee.appendChild(je),ie.addElement(Ee)}var $e=new vt;$e.minWidth=3*this.toolbarHeight+"px",$e.contentAlign="end",this.topToolbar.addButtonBlock($e);var we=new st('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");we.onClick=this.startRenderAndClose,$e.addButton(we),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(we.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var nt=new st('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");nt.onClick=this.close,$e.addButton(nt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(nt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},M.prototype.addBottomToolbar=function(){var c=this;this.bottomToolbar=new Qe,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 E=new vt;E.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(E);var k=new st('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");k.onClick=this.rotateLeftButtonClicked,E.addButton(k);var G=new st('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");G.onClick=this.rotateRightButtonClicked,E.addButton(G);var N=new at;N.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(N),this.straightener=new It("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($e){c.rotateBy($e),c.straightener.angle=c.rotationAngle},N.addElement(this.straightener.getUI());var ie=new vt;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var Ee=new st('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Ee.onClick=this.flipHorizontallyButtonClicked,ie.addButton(Ee);var je=new st('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");je.onClick=this.flipVerticallyButtonClicked,ie.addButton(je)},M.prototype.ratioButtonClicked=function(c){this.aspectRatio=c,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},M.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=it.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},M.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ot(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},M.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},M.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},M.prototype.restoreState=function(c){if(c){var E=this.cropLayer.getRescaledRect(c.width,c.height,this.imageWidth,this.imageHeight,c.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(E),this.cropRectChanged(E),this.flippedHorizontally=c.flippedHorizontally,this.flippedVertically=c.flippedVertically,this.applyFlip(),this.rotationAngle=c.rotationAngle,this.applyRotation()}},M.prototype.clientToLocalCoordinates=function(c,E){var k=this.cropImage.getBoundingClientRect();return{x:c-k.left,y:E-k.top}},M.prototype.onWindowResize=function(){this.positionUI()},M.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var c=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=c+"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()},M.prototype.rotateLeftButtonClicked=function(){var c=this.rotationAngle-90;this.rotationAngle%90!=0&&(c+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(c)},M.prototype.rotateRightButtonClicked=function(){var c=this.rotationAngle+90;this.rotationAngle%90!=0&&(c-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(c)},M.prototype.rotateTo=function(c){c=(c=c>180?c-360:c)<=-180?c+360:c,this.rotationAngle=c,this.applyRotation()},M.prototype.rotateBy=function(c){this.rotateTo((this.rotationAngle+c)%360)},M.prototype.applyRotation=function(){var c=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var E=this.editingTargetRotationContainer.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(E,0);var k=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/k.width,this.imageHeight/k.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=c},M.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},M.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},M.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},M.prototype.startRenderAndClose=function(){return ut(this,void 0,void 0,function(){var c,E;return gt(this,function(k){switch(k.label){case 0:return[4,this.render()];case 1:return c=k.sent(),E=this.getState(),this.renderEventListeners.forEach(function(G){return G(c,E)}),this.close(!0),[2]}})})},M.prototype.render=function(){return ut(this,void 0,void 0,function(){var c;return gt(this,function(E){switch(E.label){case 0:return(c=new wt).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.width=this.renderWidth,c.height=this.renderHeight,this.unzoomFromCrop(),Ye.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,c.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 E.sent(),[4,c.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,E.sent()]}})})},M.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ke("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 Ke("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ke("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var c=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ke("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*c)+`px;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ke("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ke("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ke("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 Ke("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ke("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 Ke("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ke("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},M.instanceCounter=0,M}(),Xe=K("8hTe"),pt=K.n(Xe),St=/<pre[^>]*>/g;function Rt(M){var c=document.createElement("div");return c.innerHTML=M,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var mt=le.a=function(M){var c=M.value,E=c===void 0?"":c,k=M.edit,G=k===void 0?!1:k,N=M.className,ie=M.showTextOnly,Ee=M.showLines,je=M.replaces,$e=M.zoomImg,we=M.hasMask,nt=M.style,_t=nt===void 0?{}:nt,Tt=M.stylesPrev,Mt=Tt===void 0?{}:Tt,Ft=String(E),Dt=Object(R.useRef)(),Nt=Object(R.useRef)(),Xt=Object(R.useState)(""),zt=Object(H.a)(Xt,2),jt=zt[0],Bt=zt[1],$t=Object(R.useState)("office"),Vt=Object(H.a)($t,2),Qt=Vt[0],Ht=Vt[1],Jt=function(){var bt=new dt(Nt.current);bt.displayMode="popup",bt.addRenderEventListener(function(){var Pt=Object(I.a)(e.a.mark(function yt(kt){var At;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Dt.current.style.display="none",Ct.next=3,Object(me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kt}});case 3:At=Ct.sent,At!=null&&At.id&&je(Nt.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(At==null?void 0:At.id,"?type=").concat(At.content_type));case 5:case"end":return Ct.stop()}},yt)}));return function(yt){return Pt.apply(this,arguments)}}()),bt.show()},Zt=function(){var bt=new lt(Nt.current);bt.settings.displayMode="popup",bt.addEventListener("render",function(){var Pt=Object(I.a)(e.a.mark(function yt(kt){var At;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(Dt.current.style.display="none",!Nt.current){Ct.next=6;break}return Ct.next=4,Object(me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kt.dataUrl}});case 4:At=Ct.sent,At!=null&&At.id&&je(Nt.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(At==null?void 0:At.id,"?type=").concat(At.content_type));case 6:case"end":return Ct.stop()}},yt)}));return function(yt){return Pt.apply(this,arguments)}}()),bt.show(),window.markerArea=bt},Wt=Object(R.useMemo)(function(){Dt.current&&(Dt.current.style.zIndex=-1);try{var Ot=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Pt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ft=Ft.replace(Ot,"("+z.a.API_SERVER+"/api/attachments/").replace(bt,'"'+z.a.API_SERVER+"/api/attachments/").replace(Pt,'"'+z.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(Kt){}var yt=D(Ft),kt=T();if(Ft.match(/\[TOC\]/)&&(yt=yt.replace("<p>[TOC]</p>",x()),_()),yt=yt.replace(/(__special_katext_id_\d+__)/g,function(Kt,Ct){var Yt=kt[Ct],ti=Yt.type,ii=Yt.expression;return Object(Q.renderToString)(Rt(ii)||"",{displayMode:ti==="block",throwOnError:!1,output:"html"})}),yt=yt.replace(/▁/g,"\u2581\u2581\u2581"),y(),ie){var At=document.createElement("div");return At.innerHTML=yt,At.innerText}return setTimeout(function(){return qt()},500),yt},[Ft]),Ut=Object(R.useRef)();f.WebkitLineClamp=Ee,Ee&&(_t=Object(C.a)(Object(C.a)({},_t),f));function Gt(Ot){var bt=Ot.target;if(bt.tagName.toUpperCase()==="IMG"){if($e){var Pt=bt.getAttribute("src");Bt(Pt),Ht("image")}}else if(bt.tagName.toUpperCase()==="A"){var yt=bt.getAttribute("href");if(yt.indexOf("office")>-1)Ot.preventDefault(),Bt(yt),Ht("office");else if(yt.indexOf("application/pdf")>-1)Ot.preventDefault(),Bt(yt),Ht("pdf");else if(yt.indexOf("text/html")>-1)Ot.preventDefault(),Bt(yt),Ht("html");else if(yt.startsWith("#")){Ot.preventDefault();var kt=document.getElementById(yt.replace("#",""));kt&&kt.scrollIntoView(!0)}}}var qt=function(){var bt,Pt=(bt=Ut.current)===null||bt===void 0?void 0:bt.querySelectorAll("video");Pt==null||Pt.forEach(function(yt){if(yt.oncontextmenu=function(){return!1},yt.src.indexOf(".m3u8")>-1&&!yt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var kt=new W.a;kt.loadSource(yt.src),kt.attachMedia(yt)}}})};Object(R.useEffect)(function(){if(Ut.current&&Wt&&(Wt.match(St)&&window.PR.prettyPrint()),Ut.current)return Ut.current.addEventListener("click",Gt),function(){Ut.current.removeEventListener("click",Gt),y(),_()}},[Wt,Ut.current,Gt]);var ei=function(bt){if(!G)return;bt.target.nodeName==="IMG"?(Dt.current.style.zIndex=1,Dt.current.style.display="flex",Dt.current.style.width=bt.target.clientWidth+"px",Dt.current.style.height=bt.target.clientHeight+"px",Dt.current.style.top=bt.target.offsetTop+"px",Dt.current.style.left=bt.target.offsetLeft+"px",Nt.current.src=bt.target.getAttribute("src")):Dt.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Ut,style:Object(C.a)({},_t),className:"".concat(N||""," markdown-body ").concat(pt.a.mdBody),onMouseOver:ei,dangerouslySetInnerHTML:{__html:Wt}}),p.a.createElement("div",{ref:Dt,className:pt.a.button},p.a.createElement(j.a,null,p.a.createElement(B.a,{onClick:function(){return Jt()}},"\u88C1\u526A"),p.a.createElement(B.a,{onClick:function(){return Zt()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:Nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(q.a,{close:!0,data:jt,type:jt!=null&&jt.length?Qt:"",style:Object(C.a)({},Mt),onClose:function(){return Bt("")}}))}},BU3w:function(Ze,le,K){"use strict";K.d(le,"a",function(){return I});var te=K("MNnm"),j="rc-util-key";function A(H){if(H.attachTo)return H.attachTo;var U=document.querySelector("head");return U||document.body}function B(H){var U,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var R=document.createElement("style");if((U=e.csp)===null||U===void 0?void 0:U.nonce){var p;R.nonce=(p=e.csp)===null||p===void 0?void 0:p.nonce}R.innerHTML=H;var d=A(e),l=d.firstChild;return e.prepend&&d.prepend?d.prepend(R):e.prepend&&l?d.insertBefore(R,l):d.appendChild(R),R}var C=new Map;function I(H,U){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=A(e);if(!C.has(R)){var p=B("",e),d=p.parentNode;C.set(R,d),d.removeChild(p)}var l=Array.from(C.get(R).children).find(function(r){return r.tagName==="STYLE"&&r[j]===U});if(l){var n,o;if(((n=e.csp)===null||n===void 0?void 0:n.nonce)&&l.nonce!==((o=e.csp)===null||o===void 0?void 0:o.nonce)){var u;l.nonce=(u=e.csp)===null||u===void 0?void 0:u.nonce}return l.innerHTML!==H&&(l.innerHTML=H),l}var a=B(H,e);return a[j]=U,a}},"C/vA":function(Ze,le,K){"use strict";K.d(le,"a",function(){return te});function te(j){const A=this;let B=!1,C;return function(){return B||(B=!0,C=j.apply(A,arguments)),C}}},"Cg/j":function(Ze,le,K){"use strict";K.d(le,"b",function(){return te}),K.d(le,"a",function(){return j}),K.d(le,"c",function(){return B}),K.d(le,"d",function(){return C});var te;(function(I){I.serviceIds=new Map,I.DI_TARGET="$di$target",I.DI_DEPENDENCIES="$di$dependencies";function H(U){return U[I.DI_DEPENDENCIES]||[]}I.getServiceDependencies=H})(te||(te={}));const j=B("instantiationService");function A(I,H,U,e){H[te.DI_TARGET]===H?H[te.DI_DEPENDENCIES].push({id:I,index:U,optional:e}):(H[te.DI_DEPENDENCIES]=[{id:I,index:U,optional:e}],H[te.DI_TARGET]=H)}function B(I){if(te.serviceIds.has(I))return te.serviceIds.get(I);const H=function(U,e,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");A(H,U,R,!1)};return H.toString=()=>I,te.serviceIds.set(I,H),H}function C(I){return function(H,U,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");A(I,H,e,!0)}}},DlQD:function(Ze,le,K){(function(te,j){Ze.exports=j()})(this,function(){"use strict";function te(se,re){for(var ae=0;ae<re.length;ae++){var V=re[ae];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(se,V.key,V)}}function j(se,re,ae){return re&&te(se.prototype,re),ae&&te(se,ae),se}function A(se,re){if(!se)return;if(typeof se=="string")return B(se,re);var ae=Object.prototype.toString.call(se).slice(8,-1);if(ae==="Object"&&se.constructor&&(ae=se.constructor.name),ae==="Map"||ae==="Set")return Array.from(se);if(ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae))return B(se,re)}function B(se,re){(re==null||re>se.length)&&(re=se.length);for(var ae=0,V=new Array(re);ae<re;ae++)V[ae]=se[ae];return V}function C(se,re){var ae;if(typeof Symbol=="undefined"||se[Symbol.iterator]==null){if(Array.isArray(se)||(ae=A(se))||re&&se&&typeof se.length=="number"){ae&&(se=ae);var V=0;return function(){return V>=se.length?{done:!0}:{done:!1,value:se[V++]}}}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 ae=se[Symbol.iterator](),ae.next.bind(ae)}function I(se,re){return re={exports:{}},se(re,re.exports),re.exports}var H=I(function(se){function re(){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 ae(V){se.exports.defaults=V}se.exports={defaults:re(),getDefaults:re,changeDefaults:ae}}),U=H.defaults,e=H.getDefaults,R=H.changeDefaults,p=/[&<>"']/,d=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},u=function(re){return o[re]};function a(se,re){if(re){if(p.test(se))return se.replace(d,u)}else if(l.test(se))return se.replace(n,u);return se}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(se){return se.replace(r,function(re,ae){return ae=ae.toLowerCase(),ae==="colon"?":":ae.charAt(0)==="#"?ae.charAt(1)==="x"?String.fromCharCode(parseInt(ae.substring(2),16)):String.fromCharCode(+ae.substring(1)):""})}var t=/(^|[^\[])\^/g;function _(se,re){se=se.source||se,re=re||"";var ae={replace:function(Y,$){return $=$.source||$,$=$.replace(t,"$1"),se=se.replace(Y,$),ae},getRegex:function(){return new RegExp(se,re)}};return ae}var f=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(se,re,ae){if(se){var V;try{V=decodeURIComponent(i(ae)).replace(f,"").toLowerCase()}catch(Y){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}re&&!v.test(ae)&&(ae=h(re,ae));try{ae=encodeURI(ae).replace(/%25/g,"%")}catch(Y){return null}return ae}var b={},m=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(se,re){b[" "+se]||(m.test(se)?b[" "+se]=se+"/":b[" "+se]=P(se,"/",!0)),se=b[" "+se];var ae=se.indexOf(":")===-1;return re.substring(0,2)==="//"?ae?re:se.replace(s,"$1")+re:re.charAt(0)==="/"?ae?re:se.replace(g,"$1")+re:se+re}var T={exec:function(){}};function y(se){for(var re=1,ae,V;re<arguments.length;re++){ae=arguments[re];for(V in ae)Object.prototype.hasOwnProperty.call(ae,V)&&(se[V]=ae[V])}return se}function w(se,re){var ae=se.replace(/\|/g,function($,Z,fe){for(var ye=!1,Oe=Z;--Oe>=0&&fe[Oe]==="\\";)ye=!ye;return ye?"|":" |"}),V=ae.split(/ \|/),Y=0;if(V.length>re)V.splice(re);else for(;V.length<re;)V.push("");for(;Y<V.length;Y++)V[Y]=V[Y].trim().replace(/\\\|/g,"|");return V}function P(se,re,ae){var V=se.length;if(V===0)return"";for(var Y=0;Y<V;){var $=se.charAt(V-Y-1);if($===re&&!ae)Y++;else if($!==re&&ae)Y++;else break}return se.substr(0,V-Y)}function L(se,re){if(se.indexOf(re[1])===-1)return-1;for(var ae=se.length,V=0,Y=0;Y<ae;Y++)if(se[Y]==="\\")Y++;else if(se[Y]===re[0])V++;else if(se[Y]===re[1]&&(V--,V<0))return Y;return-1}function S(se){se&&se.sanitize&&!se.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var D={escape:a,unescape:i,edit:_,cleanUrl:x,resolveUrl:h,noopTest:T,merge:y,splitCells:w,rtrim:P,findClosingBracket:L,checkSanitizeDeprecation:S},F=H.defaults,O=D.rtrim,W=D.splitCells,z=D.escape,Q=D.findClosingBracket;function q(se,re,ae){var V=re.href,Y=re.title?z(re.title):null,$=se[1].replace(/\\([\[\]])/g,"$1");return se[0].charAt(0)!=="!"?{type:"link",raw:ae,href:V,title:Y,text:$}:{type:"image",raw:ae,href:V,title:Y,text:z($)}}function me(se,re){var ae=se.match(/^(\s+)(?:```)/);if(ae===null)return re;var V=ae[1];return re.split(`
`).map(function(Y){var $=Y.match(/^\s+/);if($===null)return Y;var Z=$[0];return Z.length>=V.length?Y.slice(V.length):Y}).join(`
`)}var he=function(){function se(ae){this.options=ae||F}var re=se.prototype;return re.space=function(V){var Y=this.rules.block.newline.exec(V);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
`}},re.code=function(V,Y){var $=this.rules.block.code.exec(V);if($){var Z=Y[Y.length-1];if(Z&&Z.type==="paragraph")return{raw:$[0],text:$[0].trimRight()};var fe=$[0].replace(/^ {4}/gm,"");return{type:"code",raw:$[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:O(fe,`
`)}}},re.fences=function(V){var Y=this.rules.block.fences.exec(V);if(Y){var $=Y[0],Z=me($,Y[3]||"");return{type:"code",raw:$,lang:Y[2]?Y[2].trim():Y[2],text:Z}}},re.heading=function(V){var Y=this.rules.block.heading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},re.nptable=function(V){var Y=this.rules.block.nptable.exec(V);if(Y){var $={type:"table",header:W(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[],raw:Y[0]};if($.header.length===$.align.length){var Z=$.align.length,fe;for(fe=0;fe<Z;fe++)/^ *-+: *$/.test($.align[fe])?$.align[fe]="right":/^ *:-+: *$/.test($.align[fe])?$.align[fe]="center":/^ *:-+ *$/.test($.align[fe])?$.align[fe]="left":$.align[fe]=null;for(Z=$.cells.length,fe=0;fe<Z;fe++)$.cells[fe]=W($.cells[fe],$.header.length);return $}}},re.hr=function(V){var Y=this.rules.block.hr.exec(V);if(Y)return{type:"hr",raw:Y[0]}},re.blockquote=function(V){var Y=this.rules.block.blockquote.exec(V);if(Y){var $=Y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Y[0],text:$}}},re.list=function(V){var Y=this.rules.block.list.exec(V);if(Y){for(var $=Y[0],Z=Y[2],fe=Z.length>1,ye=Z[Z.length-1]===")",Oe={type:"list",raw:$,ordered:fe,start:fe?+Z.slice(0,-1):"",loose:!1,items:[]},Ue=Y[0].match(this.rules.block.item),We=!1,Ne,Ve,qe,ze,rt,lt,ct,et=Ue.length,ut=0;ut<et;ut++)Ne=Ue[ut],$=Ne,Ve=Ne.length,Ne=Ne.replace(/^ *([*+-]|\d+[.)]) */,""),~Ne.indexOf(`
`)&&(Ve-=Ne.length,Ne=this.options.pedantic?Ne.replace(/^ {1,4}/gm,""):Ne.replace(new RegExp("^ {1,"+Ve+"}","gm"),"")),ut!==et-1&&(qe=this.rules.block.bullet.exec(Ue[ut+1])[0],(fe?qe.length===1||!ye&&qe[qe.length-1]===")":qe.length>1||this.options.smartLists&&qe!==Z)&&(ze=Ue.slice(ut+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-ze.length),ut=et-1)),rt=We||/\n\n(?!\s*$)/.test(Ne),ut!==et-1&&(We=Ne.charAt(Ne.length-1)===`
`,rt||(rt=We)),rt&&(Oe.loose=!0),lt=/^\[[ xX]\] /.test(Ne),ct=void 0,lt&&(ct=Ne[1]!==" ",Ne=Ne.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:$,task:lt,checked:ct,loose:rt,text:Ne});return Oe}},re.html=function(V){var Y=this.rules.block.html.exec(V);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):z(Y[0]):Y[0]}},re.def=function(V){var Y=this.rules.block.def.exec(V);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var $=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:$,raw:Y[0],href:Y[2],title:Y[3]}}},re.table=function(V){var Y=this.rules.block.table.exec(V);if(Y){var $={type:"table",header:W(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[]};if($.header.length===$.align.length){$.raw=Y[0];var Z=$.align.length,fe;for(fe=0;fe<Z;fe++)/^ *-+: *$/.test($.align[fe])?$.align[fe]="right":/^ *:-+: *$/.test($.align[fe])?$.align[fe]="center":/^ *:-+ *$/.test($.align[fe])?$.align[fe]="left":$.align[fe]=null;for(Z=$.cells.length,fe=0;fe<Z;fe++)$.cells[fe]=W($.cells[fe].replace(/^ *\| *| *\| *$/g,""),$.header.length);return $}}},re.lheading=function(V){var Y=this.rules.block.lheading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1]}},re.paragraph=function(V){var Y=this.rules.block.paragraph.exec(V);if(Y)return{type:"paragraph",raw:Y[0],text:Y[1].charAt(Y[1].length-1)===`
`?Y[1].slice(0,-1):Y[1]}},re.text=function(V,Y){var $=this.rules.block.text.exec(V);if($){var Z=Y[Y.length-1];return Z&&Z.type==="text"?{raw:$[0],text:$[0]}:{type:"text",raw:$[0],text:$[0]}}},re.escape=function(V){var Y=this.rules.inline.escape.exec(V);if(Y)return{type:"escape",raw:Y[0],text:z(Y[1])}},re.tag=function(V,Y,$){var Z=this.rules.inline.tag.exec(V);if(Z)return!Y&&/^<a /i.test(Z[0])?Y=!0:Y&&/^<\/a>/i.test(Z[0])&&(Y=!1),!$&&/^<(pre|code|kbd|script)(\s|>)/i.test(Z[0])?$=!0:$&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Z[0])&&($=!1),{type:this.options.sanitize?"text":"html",raw:Z[0],inLink:Y,inRawBlock:$,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):z(Z[0]):Z[0]}},re.link=function(V){var Y=this.rules.inline.link.exec(V);if(Y){var $=Q(Y[2],"()");if($>-1){var Z=Y[0].indexOf("!")===0?5:4,fe=Z+Y[1].length+$;Y[2]=Y[2].substring(0,$),Y[0]=Y[0].substring(0,fe).trim(),Y[3]=""}var ye=Y[2],Oe="";if(this.options.pedantic){var Ue=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ye);Ue?(ye=Ue[1],Oe=Ue[3]):Oe=""}else Oe=Y[3]?Y[3].slice(1,-1):"";ye=ye.trim().replace(/^<([\s\S]*)>$/,"$1");var We=q(Y,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},Y[0]);return We}},re.reflink=function(V,Y){var $;if(($=this.rules.inline.reflink.exec(V))||($=this.rules.inline.nolink.exec(V))){var Z=($[2]||$[1]).replace(/\s+/g," ");if(Z=Y[Z.toLowerCase()],!Z||!Z.href){var fe=$[0].charAt(0);return{type:"text",raw:fe,text:fe}}var ye=q($,Z,$[0]);return ye}},re.strong=function(V,Y,$){$===void 0&&($="");var Z=this.rules.inline.strong.start.exec(V);if(Z&&(!Z[1]||Z[1]&&($===""||this.rules.inline.punctuation.exec($)))){Y=Y.slice(-1*V.length);var fe=Z[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;fe.lastIndex=0;for(var ye;(Z=fe.exec(Y))!=null;)if(ye=this.rules.inline.strong.middle.exec(Y.slice(0,Z.index+3)),ye)return{type:"strong",raw:V.slice(0,ye[0].length),text:V.slice(2,ye[0].length-2)}}},re.em=function(V,Y,$){$===void 0&&($="");var Z=this.rules.inline.em.start.exec(V);if(Z&&(!Z[1]||Z[1]&&($===""||this.rules.inline.punctuation.exec($)))){Y=Y.slice(-1*V.length);var fe=Z[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;fe.lastIndex=0;for(var ye;(Z=fe.exec(Y))!=null;)if(ye=this.rules.inline.em.middle.exec(Y.slice(0,Z.index+2)),ye)return{type:"em",raw:V.slice(0,ye[0].length),text:V.slice(1,ye[0].length-1)}}},re.codespan=function(V){var Y=this.rules.inline.code.exec(V);if(Y){var $=Y[2].replace(/\n/g," "),Z=/[^ ]/.test($),fe=$.startsWith(" ")&&$.endsWith(" ");return Z&&fe&&($=$.substring(1,$.length-1)),$=z($,!0),{type:"codespan",raw:Y[0],text:$}}},re.br=function(V){var Y=this.rules.inline.br.exec(V);if(Y)return{type:"br",raw:Y[0]}},re.del=function(V){var Y=this.rules.inline.del.exec(V);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},re.autolink=function(V,Y){var $=this.rules.inline.autolink.exec(V);if($){var Z,fe;return $[2]==="@"?(Z=z(this.options.mangle?Y($[1]):$[1]),fe="mailto:"+Z):(Z=z($[1]),fe=Z),{type:"link",raw:$[0],text:Z,href:fe,tokens:[{type:"text",raw:Z,text:Z}]}}},re.url=function(V,Y){var $;if($=this.rules.inline.url.exec(V)){var Z,fe;if($[2]==="@")Z=z(this.options.mangle?Y($[0]):$[0]),fe="mailto:"+Z;else{var ye;do ye=$[0],$[0]=this.rules.inline._backpedal.exec($[0])[0];while(ye!==$[0]);Z=z($[0]),$[1]==="www."?fe="http://"+Z:fe=Z}return{type:"link",raw:$[0],text:Z,href:fe,tokens:[{type:"text",raw:Z,text:Z}]}}},re.inlineText=function(V,Y,$){var Z=this.rules.inline.text.exec(V);if(Z){var fe;return Y?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):z(Z[0]):Z[0]:fe=z(this.options.smartypants?$(Z[0]):Z[0]),{type:"text",raw:Z[0],text:fe}}},se}(),ce=D.noopTest,pe=D.edit,ge=D.merge,ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ce,table:ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=pe(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=pe(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=pe(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=pe(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=pe(ee._paragraph).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.blockquote=pe(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=ge({},ee),ee.gfm=ge({},ee.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*|$)"}),ee.gfm.nptable=pe(ee.gfm.nptable).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.gfm.table=pe(ee.gfm.table).replace("hr",ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ee._tag).getRegex(),ee.pedantic=ge({},ee.normal,{html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ce,paragraph:pe(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var J={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ce,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};J._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",J.punctuation=pe(J.punctuation).replace(/punctuation/g,J._punctuation).getRegex(),J._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",J._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",J.em.start=pe(J.em.start).replace(/punctuation/g,J._punctuation).getRegex(),J.em.middle=pe(J.em.middle).replace(/punctuation/g,J._punctuation).replace(/overlapSkip/g,J._overlapSkip).getRegex(),J.em.endAst=pe(J.em.endAst,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.em.endUnd=pe(J.em.endUnd,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.strong.start=pe(J.strong.start).replace(/punctuation/g,J._punctuation).getRegex(),J.strong.middle=pe(J.strong.middle).replace(/punctuation/g,J._punctuation).replace(/blockSkip/g,J._blockSkip).getRegex(),J.strong.endAst=pe(J.strong.endAst,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.strong.endUnd=pe(J.strong.endUnd,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.blockSkip=pe(J._blockSkip,"g").getRegex(),J.overlapSkip=pe(J._overlapSkip,"g").getRegex(),J._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,J._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,J._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])?)+(?![-_])/,J.autolink=pe(J.autolink).replace("scheme",J._scheme).replace("email",J._email).getRegex(),J._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,J.tag=pe(J.tag).replace("comment",ee._comment).replace("attribute",J._attribute).getRegex(),J._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,J._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,J._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,J.link=pe(J.link).replace("label",J._label).replace("href",J._href).replace("title",J._title).getRegex(),J.reflink=pe(J.reflink).replace("label",J._label).getRegex(),J.reflinkSearch=pe(J.reflinkSearch,"g").replace("reflink",J.reflink).replace("nolink",J.nolink).getRegex(),J.normal=ge({},J),J.pedantic=ge({},J.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:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",J._label).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",J._label).getRegex()}),J.gfm=ge({},J.normal,{escape:pe(J.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),J.gfm.url=pe(J.gfm.url,"i").replace("email",J.gfm._extended_email).getRegex(),J.breaks=ge({},J.gfm,{br:pe(J.br).replace("{2,}","*").getRegex(),text:pe(J.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Re={block:ee,inline:J},Me=H.defaults,Ie=Re.block,Fe=Re.inline;function He(se){return se.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function _e(se){var re="",ae,V,Y=se.length;for(ae=0;ae<Y;ae++)V=se.charCodeAt(ae),Math.random()>.5&&(V="x"+V.toString(16)),re+="&#"+V+";";return re}var Ae=function(){function se(ae){this.tokens=[],this.tokens.links=Object.create(null),this.options=ae||Me,this.options.tokenizer=this.options.tokenizer||new he,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:Ie.normal,inline:Fe.normal};this.options.pedantic?(V.block=Ie.pedantic,V.inline=Fe.pedantic):this.options.gfm&&(V.block=Ie.gfm,this.options.breaks?V.inline=Fe.breaks:V.inline=Fe.gfm),this.tokenizer.rules=V}se.lex=function(V,Y){var $=new se(Y);return $.lex(V)};var re=se.prototype;return re.lex=function(V){return V=V.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function(V,Y,$){Y===void 0&&(Y=[]),$===void 0&&($=!0),V=V.replace(/^ +$/gm,"");for(var Z,fe,ye,Oe;V;){if(Z=this.tokenizer.space(V)){V=V.substring(Z.raw.length),Z.type&&Y.push(Z);continue}if(Z=this.tokenizer.code(V,Y)){V=V.substring(Z.raw.length),Z.type?Y.push(Z):(Oe=Y[Y.length-1],Oe.raw+=`
`+Z.raw,Oe.text+=`
`+Z.text);continue}if(Z=this.tokenizer.fences(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.heading(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.nptable(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.hr(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.blockquote(V)){V=V.substring(Z.raw.length),Z.tokens=this.blockTokens(Z.text,[],$),Y.push(Z);continue}if(Z=this.tokenizer.list(V)){for(V=V.substring(Z.raw.length),ye=Z.items.length,fe=0;fe<ye;fe++)Z.items[fe].tokens=this.blockTokens(Z.items[fe].text,[],!1);Y.push(Z);continue}if(Z=this.tokenizer.html(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if($&&(Z=this.tokenizer.def(V))){V=V.substring(Z.raw.length),this.tokens.links[Z.tag]||(this.tokens.links[Z.tag]={href:Z.href,title:Z.title});continue}if(Z=this.tokenizer.table(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.lheading(V)){V=V.substring(Z.raw.length),Y.push(Z);continue}if($&&(Z=this.tokenizer.paragraph(V))){V=V.substring(Z.raw.length),Y.push(Z);continue}if(Z=this.tokenizer.text(V,Y)){V=V.substring(Z.raw.length),Z.type?Y.push(Z):(Oe=Y[Y.length-1],Oe.raw+=`
`+Z.raw,Oe.text+=`
`+Z.text);continue}if(V){var Ue="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ue);break}else throw new Error(Ue)}}return Y},re.inline=function(V){var Y,$,Z,fe,ye,Oe,Ue=V.length;for(Y=0;Y<Ue;Y++){Oe=V[Y];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},fe=Oe.header.length,$=0;$<fe;$++)Oe.tokens.header[$]=[],this.inlineTokens(Oe.header[$],Oe.tokens.header[$]);for(fe=Oe.cells.length,$=0;$<fe;$++)for(ye=Oe.cells[$],Oe.tokens.cells[$]=[],Z=0;Z<ye.length;Z++)Oe.tokens.cells[$][Z]=[],this.inlineTokens(ye[Z],Oe.tokens.cells[$][Z]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(fe=Oe.items.length,$=0;$<fe;$++)this.inline(Oe.items[$].tokens);break}}}return V},re.inlineTokens=function(V,Y,$,Z,fe){Y===void 0&&(Y=[]),$===void 0&&($=!1),Z===void 0&&(Z=!1),fe===void 0&&(fe="");var ye,Oe=V,Ue;if(this.tokens.links){var We=Object.keys(this.tokens.links);if(We.length>0)for(;(Ue=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)We.includes(Ue[0].slice(Ue[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,Ue.index)+"["+"a".repeat(Ue[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ue=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,Ue.index)+"["+"a".repeat(Ue[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(ye=this.tokenizer.escape(V)){V=V.substring(ye.raw.length),Y.push(ye);continue}if(ye=this.tokenizer.tag(V,$,Z)){V=V.substring(ye.raw.length),$=ye.inLink,Z=ye.inRawBlock,Y.push(ye);continue}if(ye=this.tokenizer.link(V)){V=V.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,Z)),Y.push(ye);continue}if(ye=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,Z)),Y.push(ye);continue}if(ye=this.tokenizer.strong(V,Oe,fe)){V=V.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],$,Z),Y.push(ye);continue}if(ye=this.tokenizer.em(V,Oe,fe)){V=V.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],$,Z),Y.push(ye);continue}if(ye=this.tokenizer.codespan(V)){V=V.substring(ye.raw.length),Y.push(ye);continue}if(ye=this.tokenizer.br(V)){V=V.substring(ye.raw.length),Y.push(ye);continue}if(ye=this.tokenizer.del(V)){V=V.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],$,Z),Y.push(ye);continue}if(ye=this.tokenizer.autolink(V,_e)){V=V.substring(ye.raw.length),Y.push(ye);continue}if(!$&&(ye=this.tokenizer.url(V,_e))){V=V.substring(ye.raw.length),Y.push(ye);continue}if(ye=this.tokenizer.inlineText(V,Z,He)){V=V.substring(ye.raw.length),fe=ye.raw.slice(-1),Y.push(ye);continue}if(V){var Ne="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ne);break}else throw new Error(Ne)}}return Y},j(se,null,[{key:"rules",get:function(){return{block:Ie,inline:Fe}}}]),se}(),Se=H.defaults,X=D.cleanUrl,ne=D.escape,ue=function(){function se(ae){this.options=ae||Se}var re=se.prototype;return re.code=function(V,Y,$){var Z=(Y||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(V,Z);fe!=null&&fe!==V&&($=!0,V=fe)}return Z?'<pre><code class="'+this.options.langPrefix+ne(Z,!0)+'">'+($?V:ne(V,!0))+`</code></pre>
`:"<pre><code>"+($?V:ne(V,!0))+`</code></pre>
`},re.blockquote=function(V){return`<blockquote>
`+V+`</blockquote>
`},re.html=function(V){return V},re.heading=function(V,Y,$,Z){return this.options.headerIds?"<h"+Y+' id="'+this.options.headerPrefix+Z.slug($)+'">'+V+"</h"+Y+`>
`:"<h"+Y+">"+V+"</h"+Y+`>
`},re.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},re.list=function(V,Y,$){var Z=Y?"ol":"ul",fe=Y&&$!==1?' start="'+$+'"':"";return"<"+Z+fe+`>
`+V+"</"+Z+`>
`},re.listitem=function(V){return"<li>"+V+`</li>
`},re.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function(V){return"<p>"+V+`</p>
`},re.table=function(V,Y){return Y&&(Y="<tbody>"+Y+"</tbody>"),`<table>
<thead>
`+V+`</thead>
`+Y+`</table>
`},re.tablerow=function(V){return`<tr>
`+V+`</tr>
`},re.tablecell=function(V,Y){var $=Y.header?"th":"td",Z=Y.align?"<"+$+' align="'+Y.align+'">':"<"+$+">";return Z+V+"</"+$+`>
`},re.strong=function(V){return"<strong>"+V+"</strong>"},re.em=function(V){return"<em>"+V+"</em>"},re.codespan=function(V){return"<code>"+V+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function(V){return"<del>"+V+"</del>"},re.link=function(V,Y,$){if(V=X(this.options.sanitize,this.options.baseUrl,V),V===null)return $;var Z='<a href="'+ne(V)+'"';return Y&&(Z+=' title="'+Y+'"'),Z+=">"+$+"</a>",Z},re.image=function(V,Y,$){if(V=X(this.options.sanitize,this.options.baseUrl,V),V===null)return $;var Z='<img src="'+V+'" alt="'+$+'"';return Y&&(Z+=' title="'+Y+'"'),Z+=this.options.xhtml?"/>":">",Z},re.text=function(V){return V},se}(),de=function(){function se(){}var re=se.prototype;return re.strong=function(V){return V},re.em=function(V){return V},re.codespan=function(V){return V},re.del=function(V){return V},re.html=function(V){return V},re.text=function(V){return V},re.link=function(V,Y,$){return""+$},re.image=function(V,Y,$){return""+$},re.br=function(){return""},se}(),xe=function(){function se(){this.seen={}}var re=se.prototype;return re.slug=function(V){var Y=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var $=Y;do this.seen[$]++,Y=$+"-"+this.seen[$];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},se}(),Te=H.defaults,Le=D.unescape,Pe=function(){function se(ae){this.options=ae||Te,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new de,this.slugger=new xe}se.parse=function(V,Y){var $=new se(Y);return $.parse(V)};var re=se.prototype;return re.parse=function(V,Y){Y===void 0&&(Y=!0);var $="",Z,fe,ye,Oe,Ue,We,Ne,Ve,qe,ze,rt,lt,ct,et,ut,gt,Lt,Ye,xt=V.length;for(Z=0;Z<xt;Z++){ze=V[Z];switch(ze.type){case"space":continue;case"hr":{$+=this.renderer.hr();continue}case"heading":{$+=this.renderer.heading(this.parseInline(ze.tokens),ze.depth,Le(this.parseInline(ze.tokens,this.textRenderer)),this.slugger);continue}case"code":{$+=this.renderer.code(ze.text,ze.lang,ze.escaped);continue}case"table":{for(Ve="",Ne="",Oe=ze.header.length,fe=0;fe<Oe;fe++)Ne+=this.renderer.tablecell(this.parseInline(ze.tokens.header[fe]),{header:!0,align:ze.align[fe]});for(Ve+=this.renderer.tablerow(Ne),qe="",Oe=ze.cells.length,fe=0;fe<Oe;fe++){for(We=ze.tokens.cells[fe],Ne="",Ue=We.length,ye=0;ye<Ue;ye++)Ne+=this.renderer.tablecell(this.parseInline(We[ye]),{header:!1,align:ze.align[ye]});qe+=this.renderer.tablerow(Ne)}$+=this.renderer.table(Ve,qe);continue}case"blockquote":{qe=this.parse(ze.tokens),$+=this.renderer.blockquote(qe);continue}case"list":{for(rt=ze.ordered,lt=ze.start,ct=ze.loose,Oe=ze.items.length,qe="",fe=0;fe<Oe;fe++)ut=ze.items[fe],gt=ut.checked,Lt=ut.task,et="",ut.task&&(Ye=this.renderer.checkbox(gt),ct?ut.tokens.length>0&&ut.tokens[0].type==="text"?(ut.tokens[0].text=Ye+" "+ut.tokens[0].text,ut.tokens[0].tokens&&ut.tokens[0].tokens.length>0&&ut.tokens[0].tokens[0].type==="text"&&(ut.tokens[0].tokens[0].text=Ye+" "+ut.tokens[0].tokens[0].text)):ut.tokens.unshift({type:"text",text:Ye}):et+=Ye),et+=this.parse(ut.tokens,ct),qe+=this.renderer.listitem(et,Lt,gt);$+=this.renderer.list(qe,rt,lt);continue}case"html":{$+=this.renderer.html(ze.text);continue}case"paragraph":{$+=this.renderer.paragraph(this.parseInline(ze.tokens));continue}case"text":{for(qe=ze.tokens?this.parseInline(ze.tokens):ze.text;Z+1<xt&&V[Z+1].type==="text";)ze=V[++Z],qe+=`
`+(ze.tokens?this.parseInline(ze.tokens):ze.text);$+=Y?this.renderer.paragraph(qe):qe;continue}default:{var Je='Token with "'+ze.type+'" type was not found.';if(this.options.silent){console.error(Je);return}else throw new Error(Je)}}}return $},re.parseInline=function(V,Y){Y=Y||this.renderer;var $="",Z,fe,ye=V.length;for(Z=0;Z<ye;Z++){fe=V[Z];switch(fe.type){case"escape":{$+=Y.text(fe.text);break}case"html":{$+=Y.html(fe.text);break}case"link":{$+=Y.link(fe.href,fe.title,this.parseInline(fe.tokens,Y));break}case"image":{$+=Y.image(fe.href,fe.title,fe.text);break}case"strong":{$+=Y.strong(this.parseInline(fe.tokens,Y));break}case"em":{$+=Y.em(this.parseInline(fe.tokens,Y));break}case"codespan":{$+=Y.codespan(fe.text);break}case"br":{$+=Y.br();break}case"del":{$+=Y.del(this.parseInline(fe.tokens,Y));break}case"text":{$+=Y.text(fe.text);break}default:{var Oe='Token with "'+fe.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return $},se}(),oe=D.merge,ke=D.checkSanitizeDeprecation,De=D.escape,Ce=H.getDefaults,Ge=H.changeDefaults,Be=H.defaults;function ve(se,re,ae){if(typeof se=="undefined"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof re=="function"&&(ae=re,re=null),re=oe({},ve.defaults,re||{}),ke(re),ae){var V=re.highlight,Y;try{Y=Ae.lex(se,re)}catch(ye){return ae(ye)}var $=function(Oe){var Ue;if(!Oe)try{Ue=Pe.parse(Y,re)}catch(We){Oe=We}return re.highlight=V,Oe?ae(Oe):ae(null,Ue)};if(!V||V.length<3)return $();if(delete re.highlight,!Y.length)return $();var Z=0;ve.walkTokens(Y,function(ye){ye.type==="code"&&(Z++,setTimeout(function(){V(ye.text,ye.lang,function(Oe,Ue){if(Oe)return $(Oe);Ue!=null&&Ue!==ye.text&&(ye.text=Ue,ye.escaped=!0),Z--,Z===0&&$()})},0))}),Z===0&&$();return}try{var fe=Ae.lex(se,re);return re.walkTokens&&ve.walkTokens(fe,re.walkTokens),Pe.parse(fe,re)}catch(ye){if(ye.message+=`
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+De(ye.message+"",!0)+"</pre>";throw ye}}ve.options=ve.setOptions=function(se){return oe(ve.defaults,se),Ge(ve.defaults),ve},ve.getDefaults=Ce,ve.defaults=Be,ve.use=function(se){var re=oe({},se);if(se.renderer&&function(){var V=ve.defaults.renderer||new ue,Y=function(fe){var ye=V[fe];V[fe]=function(){for(var Oe=arguments.length,Ue=new Array(Oe),We=0;We<Oe;We++)Ue[We]=arguments[We];var Ne=se.renderer[fe].apply(V,Ue);return Ne===!1&&(Ne=ye.apply(V,Ue)),Ne}};for(var $ in se.renderer)Y($);re.renderer=V}(),se.tokenizer&&function(){var V=ve.defaults.tokenizer||new he,Y=function(fe){var ye=V[fe];V[fe]=function(){for(var Oe=arguments.length,Ue=new Array(Oe),We=0;We<Oe;We++)Ue[We]=arguments[We];var Ne=se.tokenizer[fe].apply(V,Ue);return Ne===!1&&(Ne=ye.apply(V,Ue)),Ne}};for(var $ in se.tokenizer)Y($);re.tokenizer=V}(),se.walkTokens){var ae=ve.defaults.walkTokens;re.walkTokens=function(V){se.walkTokens(V),ae&&ae(V)}}ve.setOptions(re)},ve.walkTokens=function(se,re){for(var ae=C(se),V;!(V=ae()).done;){var Y=V.value;re(Y);switch(Y.type){case"table":{for(var $=C(Y.tokens.header),Z;!(Z=$()).done;){var fe=Z.value;ve.walkTokens(fe,re)}for(var ye=C(Y.tokens.cells),Oe;!(Oe=ye()).done;)for(var Ue=Oe.value,We=C(Ue),Ne;!(Ne=We()).done;){var Ve=Ne.value;ve.walkTokens(Ve,re)}break}case"list":{ve.walkTokens(Y.items,re);break}default:Y.tokens&&ve.walkTokens(Y.tokens,re)}}},ve.Parser=Pe,ve.parser=Pe.parse,ve.Renderer=ue,ve.TextRenderer=de,ve.Lexer=Ae,ve.lexer=Ae.lex,ve.Tokenizer=he,ve.Slugger=xe,ve.parse=ve;var be=ve;return be})},FWmy:function(Ze,le,K){"use strict";K.d(le,"a",function(){return te});function te(j,A){if(!j)throw new Error(A?`Assertion failed (${A})`:"Assertion Failed")}},JYp7:function(Ze,le,K){"use strict";K.d(le,"a",function(){return te});var te;(function(j){function A(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}j.is=A;const B=Object.freeze([]);function C(){return B}j.empty=C;function*I(t){yield t}j.single=I;function H(t){return t||B}j.from=H;function U(t){return!t||t[Symbol.iterator]().next().done===!0}j.isEmpty=U;function e(t){return t[Symbol.iterator]().next().value}j.first=e;function R(t,_){for(const f of t)if(_(f))return!0;return!1}j.some=R;function p(t,_){for(const f of t)if(_(f))return f;return}j.find=p;function*d(t,_){for(const f of t)_(f)&&(yield f)}j.filter=d;function*l(t,_){let f=0;for(const v of t)yield _(v,f++)}j.map=l;function*n(...t){for(const _ of t)for(const f of _)yield f}j.concat=n;function*o(t){for(const _ of t)for(const f of _)yield f}j.concatNested=o;function u(t,_,f){let v=f;for(const x of t)v=_(v,x);return v}j.reduce=u;function*a(t,_,f=t.length){for(_<0&&(_+=t.length),f<0?f+=t.length:f>t.length&&(f=t.length);_<f;_++)yield t[_]}j.slice=a;function r(t,_=Number.POSITIVE_INFINITY){const f=[];if(_===0)return[f,t];const v=t[Symbol.iterator]();for(let x=0;x<_;x++){const b=v.next();if(b.done)return[f,j.empty()];f.push(b.value)}return[f,{[Symbol.iterator](){return v}}]}j.consume=r;function i(t,_,f=(v,x)=>v===x){const v=t[Symbol.iterator](),x=_[Symbol.iterator]();for(;;){const b=v.next(),m=x.next();if(b.done!==m.done)return!1;if(b.done)return!0;if(!f(b.value,m.value))return!1}}j.equals=i})(te||(te={}))},LdHM:function(Ze,le,K){"use strict";K.d(le,"b",function(){return t}),K.d(le,"a",function(){return f});var te=K("1OyB"),j=K("vuIU"),A=K("Ji7U"),B=K("LK+K"),C=K("q1tI"),I=K("rePB"),H=K("Ff2n"),U=K("ODXe"),e=K("4IlW"),R=K("bX4T"),p=K("YrtM"),d=K("TSYQ"),l=K.n(d),n=K("+nKL"),o=K("8OUc"),u=function(W,z){var Q=W.prefixCls,q=W.id,me=W.flattenOptions,he=W.childrenAsData,ce=W.values,pe=W.searchValue,ge=W.multiple,ee=W.defaultActiveFirstOption,J=W.height,Re=W.itemHeight,Me=W.notFoundContent,Ie=W.open,Fe=W.menuItemSelectedIcon,He=W.virtual,_e=W.onSelect,Ae=W.onToggleOpen,Se=W.onActiveValue,X=W.onScroll,ne=W.onMouseEnter,ue="".concat(Q,"-item"),de=Object(p.a)(function(){return me},[Ie,me],function(be,se){return se[0]&&be[1]!==se[1]}),xe=C.useRef(null),Te=function(se){se.preventDefault()},Le=function(se){xe.current&&xe.current.scrollTo({index:se})},Pe=function(se){for(var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=de.length,V=0;V<ae;V+=1){var Y=(se+V*re+ae)%ae,$=de[Y],Z=$.group,fe=$.data;if(!Z&&!fe.disabled)return Y}return-1},oe=C.useState(function(){return Pe(0)}),ke=Object(U.a)(oe,2),De=ke[0],Ce=ke[1],Ge=function(se){Ce(se);var re=de[se];if(!re){Se(null,-1);return}Se(re.data.value,se)};C.useEffect(function(){Ge(ee!==!1?Pe(0):-1)},[de.length,pe]),C.useEffect(function(){var be=setTimeout(function(){if(!ge&&Ie&&ce.size===1){var se=Array.from(ce)[0],re=de.findIndex(function(ae){var V=ae.data;return V.value===se});Ge(re),Le(re)}});return function(){return clearTimeout(be)}},[Ie]);var Be=function(se){se!==void 0&&_e(se,{selected:!ce.has(se)}),ge||Ae(!1)};if(C.useImperativeHandle(z,function(){return{onKeyDown:function(se){var re=se.which;switch(re){case e.a.UP:case e.a.DOWN:{var ae=0;if(re===e.a.UP?ae=-1:re===e.a.DOWN&&(ae=1),ae!==0){var V=Pe(De+ae,ae);Le(V),Ge(V)}break}case e.a.ENTER:{var Y=de[De];Y&&!Y.data.disabled?Be(Y.data.value):Be(void 0),Ie&&se.preventDefault();break}case e.a.ESC:Ae(!1)}},onKeyUp:function(){},scrollTo:function(se){Le(se)}}}),de.length===0)return C.createElement("div",{role:"listbox",id:"".concat(q,"_list"),className:"".concat(ue,"-empty"),onMouseDown:Te},Me);function ve(be){var se=de[be];if(!se)return null;var re=se.data||{},ae=re.value,V=re.label,Y=re.children,$=Object(R.a)(re,!0),Z=he?Y:V;return se?C.createElement("div",Object.assign({"aria-label":typeof Z=="string"?Z:null},$,{key:be,role:"option",id:"".concat(q,"_list_").concat(be),"aria-selected":ce.has(ae)}),ae):null}return C.createElement(C.Fragment,null,C.createElement("div",{role:"listbox",id:"".concat(q,"_list"),style:{height:0,width:0,overflow:"hidden"}},ve(De-1),ve(De),ve(De+1)),C.createElement(n.a,{itemKey:"key",ref:xe,data:de,height:J,itemHeight:Re,fullHeight:!1,onMouseDown:Te,onScroll:X,virtual:He,onMouseEnter:ne},function(be,se){var re,ae=be.group,V=be.groupOption,Y=be.data,$=Y.label,Z=Y.key;if(ae)return C.createElement("div",{className:l()(ue,"".concat(ue,"-group"))},$!==void 0?$:Z);var fe=Y.disabled,ye=Y.value,Oe=Y.title,Ue=Y.children,We=Y.style,Ne=Y.className,Ve=Object(H.a)(Y,["disabled","value","title","children","style","className"]),qe=ce.has(ye),ze="".concat(ue,"-option"),rt=l()(ue,ze,Ne,(re={},Object(I.a)(re,"".concat(ze,"-grouped"),V),Object(I.a)(re,"".concat(ze,"-active"),De===se&&!fe),Object(I.a)(re,"".concat(ze,"-disabled"),fe),Object(I.a)(re,"".concat(ze,"-selected"),qe),re)),lt=he?Ue:$,ct=!Fe||typeof Fe=="function"||qe;return C.createElement("div",Object.assign({},Ve,{"aria-selected":qe,className:rt,title:Oe,onMouseMove:function(){if(De===se||fe)return;Ge(se)},onClick:function(){fe||Be(ye)},style:We}),C.createElement("div",{className:"".concat(ze,"-content")},lt||ye),C.isValidElement(Fe)||qe,ct&&C.createElement(o.a,{className:"".concat(ue,"-option-state"),customizeIcon:Fe,customizeIconProps:{isSelected:qe}},qe?"\u2713":null))}))},a=C.forwardRef(u);a.displayName="OptionList";var r=a,i=function(){return null};i.isSelectOption=!0;var t=i,_=function(){return null};_.isSelectOptGroup=!0;var f=_,v=K("VTBJ"),x=K("Zm9Q");function b(O){var W=O.key,z=O.props,Q=z.children,q=z.value,me=Object(H.a)(z,["children","value"]);return Object(v.a)({key:W,value:q!==void 0?q:W,children:Q},me)}function m(O){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(x.a)(O).map(function(z,Q){if(!C.isValidElement(z)||!z.type)return null;var q=z.type.isSelectOptGroup,me=z.key,he=z.props,ce=he.children,pe=Object(H.a)(he,["children"]);return W||!q?b(z):Object(v.a)(Object(v.a)({key:"__RC_SELECT_GRP__".concat(me===null?Q:me,"__"),label:me},pe),{},{options:m(ce)})}).filter(function(z){return z})}var s=K("2Qr1"),g=K("qNPg"),h=K("U8pU"),T=K("Kwbf"),y=K("WKfj");function w(O){var W=O.mode,z=O.options,Q=O.children,q=O.backfill,me=O.allowClear,he=O.placeholder,ce=O.getInputElement,pe=O.showSearch,ge=O.onSearch,ee=O.defaultOpen,J=O.autoFocus,Re=O.labelInValue,Me=O.value,Ie=O.inputValue,Fe=O.optionLabelProp,He=W==="multiple"||W==="tags",_e=pe!==void 0?pe:He||W==="combobox",Ae=z||m(Q);if(Object(T.a)(W!=="tags"||Ae.every(function(ue){return!ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Se=Ae.some(function(ue){return ue.options?ue.options.some(function(de){return typeof("value"in de?de.value:de.key)=="number"}):typeof("value"in ue?ue.value:ue.key)=="number"});Object(T.a)(!Se,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(W!=="combobox"||!Fe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(W==="combobox"||!q,"`backfill` only works with `combobox` mode."),Object(T.a)(W==="combobox"||!ce,"`getInputElement` only work with `combobox` mode."),Object(T.b)(W!=="combobox"||!ce||!me||!he,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ge&&!_e&&W!=="combobox"&&W!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ee||J,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Me!=null){var X=Object(y.d)(Me);Object(T.a)(!Re||X.every(function(ue){return Object(h.a)(ue)==="object"&&("key"in ue||"value"in ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!He||Array.isArray(Me),"`value` should be array when `mode` is `multiple` or `tags`")}if(Q){var ne=null;Object(x.a)(Q).some(function(ue){if(!C.isValidElement(ue)||!ue.type)return!1;var de=ue.type;if(de.isSelectOption)return!1;if(de.isSelectOptGroup){var xe=Object(x.a)(ue.props.children).every(function(Te){return!C.isValidElement(Te)||!ue.type||Te.type.isSelectOption?!0:(ne=Te.type,!1)});return!xe}return ne=de,!0}),ne&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ne.displayName||ne.name||ne,"`.")),Object(T.a)(Ie===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=w,L=Object(g.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:m,flattenOptions:s.d,getLabeledValue:s.e,filterOptions:s.b,isValueDisabled:s.g,findValueOption:s.c,warningProps:P,fillOptionsWithMissingValue:s.a}),S=function(O){Object(A.a)(z,O);var W=Object(B.a)(z);function z(){var Q;return Object(te.a)(this,z),Q=W.apply(this,arguments),Q.selectRef=C.createRef(),Q.focus=function(){Q.selectRef.current.focus()},Q.blur=function(){Q.selectRef.current.blur()},Q}return Object(j.a)(z,[{key:"render",value:function(){return C.createElement(L,Object.assign({ref:this.selectRef},this.props))}}]),z}(C.Component);S.Option=t,S.OptGroup=f;var D=S,F=le.c=D},MI8n:function(Ze,le,K){"use strict";K.d(le,"c",function(){return C}),K.d(le,"b",function(){return e}),K.d(le,"e",function(){return R}),K.d(le,"a",function(){return p}),K.d(le,"d",function(){return d}),K.d(le,"f",function(){return l});var te=K("/cxE"),j=K("pmY6"),A=K("24hK"),B=K("5Y4S"),C;(function(n){n.None=()=>j.a.None;function o(w){return(P,L=null,S)=>{let D=!1,F;return F=w(O=>D?void 0:(F?F.dispose():D=!0,P.call(L,O)),null,S),D&&F.dispose(),F}}n.once=o;function u(w,P){return f((L,S=null,D)=>w(F=>L.call(S,P(F)),null,D))}n.map=u;function a(w,P){return f((L,S=null,D)=>w(F=>{P(F),L.call(S,F)},null,D))}n.forEach=a;function r(w,P){return f((L,S=null,D)=>w(F=>P(F)&&L.call(S,F),null,D))}n.filter=r;function i(w){return w}n.signal=i;function t(...w){return(P,L=null,S)=>Object(j.e)(...w.map(D=>D(F=>P.call(L,F),null,S)))}n.any=t;function _(w,P,L){let S=L;return u(w,D=>(S=P(S,D),S))}n.reduce=_;function f(w){let P;const L=new e({onFirstListenerAdd(){P=w(L.fire,L)},onLastListenerRemove(){P.dispose()}});return L.event}function v(w,P,L=100,S=!1,D){let F,O,W,z=0;const Q=new e({leakWarningThreshold:D,onFirstListenerAdd(){F=w(q=>{z++,O=P(O,q),S&&!W&&(Q.fire(O),O=void 0),clearTimeout(W),W=setTimeout(()=>{const me=O;O=void 0,W=void 0,(!S||z>1)&&Q.fire(me),z=0},L)})},onLastListenerRemove(){F.dispose()}});return Q.event}n.debounce=v;function x(w,P=(L,S)=>L===S){let L=!0,S;return r(w,D=>{const F=L||!P(D,S);return L=!1,S=D,F})}n.latch=x;function b(w,P){return[n.filter(w,P),n.filter(w,L=>!P(L))]}n.split=b;function m(w,P=!1,L=[]){let S=L.slice(),D=w(W=>{S?S.push(W):O.fire(W)});const F=()=>{S&&S.forEach(W=>O.fire(W)),S=null},O=new e({onFirstListenerAdd(){D||(D=w(W=>O.fire(W)))},onFirstListenerDidAdd(){S&&(P?setTimeout(F):F())},onLastListenerRemove(){D&&D.dispose(),D=null}});return O.event}n.buffer=m;class s{constructor(w){this.event=w}map(w){return new s(u(this.event,w))}forEach(w){return new s(a(this.event,w))}filter(w){return new s(r(this.event,w))}reduce(w,P){return new s(_(this.event,w,P))}latch(){return new s(x(this.event))}debounce(w,P=100,L=!1,S){return new s(v(this.event,w,P,L,S))}on(w,P,L){return this.event(w,P,L)}once(w,P,L){return o(this.event)(w,P,L)}}function g(w){return new s(w)}n.chain=g;function h(w,P,L=S=>S){const S=(...W)=>O.fire(L(...W)),D=()=>w.on(P,S),F=()=>w.removeListener(P,S),O=new e({onFirstListenerAdd:D,onLastListenerRemove:F});return O.event}n.fromNodeEventEmitter=h;function T(w,P,L=S=>S){const S=(...W)=>O.fire(L(...W)),D=()=>w.addEventListener(P,S),F=()=>w.removeEventListener(P,S),O=new e({onFirstListenerAdd:D,onLastListenerRemove:F});return O.event}n.fromDOMEventEmitter=T;function y(w){return new Promise(P=>o(w)(P))}n.toPromise=y})(C||(C={}));class I{constructor(n){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${n}_${I._idPool++}`}start(n){this._stopWatch=new B.a(!0),this._listenerCount=n}stop(){if(this._stopWatch){const n=this._stopWatch.elapsed();this._elapsedOverall+=n,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${n.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}I._idPool=0;let H=-1;class U{constructor(n,o=Math.random().toString(18).slice(2,5)){this.customThreshold=n,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(n){let o=H;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||n<o)return;this._stacks||(this._stacks=new Map);const u=new Error().stack.split(`
`).slice(3).join(`
`),a=this._stacks.get(u)||0;if(this._stacks.set(u,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let r,i=0;for(const[t,_]of this._stacks)(!r||i<_)&&(r=t,i=_);console.warn(`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${i}):`),console.warn(r)}return()=>{const r=this._stacks.get(u)||0;this._stacks.set(u,r-1)}}}class e{constructor(n){var o;this._disposed=!1,this._options=n,this._leakageMon=H>0?new U(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new I(this._options._profName):void 0}get event(){return this._event||(this._event=(n,o,u)=>{var a;this._listeners||(this._listeners=new A.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(o?[n,o]:n);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,n,o);const t=(a=this._leakageMon)===null||a===void 0?void 0:a.check(this._listeners.size),_=Object(j.i)(()=>{if(t&&t(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const f=this._listeners&&!this._listeners.isEmpty();f||this._options.onLastListenerRemove(this)}});return u instanceof j.b?u.add(_):Array.isArray(u)&&u.push(_),_}),this._event}fire(n){var o,u;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new A.a);for(let a of this._listeners)this._deliveryQueue.push([a,n]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[a,r]=this._deliveryQueue.shift();try{typeof a=="function"?a.call(void 0,r):a[0].call(a[1],r)}catch(i){Object(te.f)(i)}}(u=this._perfMon)===null||u===void 0||u.stop()}}dispose(){var n,o,u,a,r;this._disposed||(this._disposed=!0,(n=this._listeners)===null||n===void 0||n.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(a=(u=this._options)===null||u===void 0?void 0:u.onLastListenerRemove)===null||a===void 0||a.call(u),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class R extends e{constructor(n){super(n);this._isPaused=0,this._eventQueue=new A.a,this._mergeFn=n==null?void 0:n.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const n=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(n))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(n){this._listeners&&(this._isPaused!==0?this._eventQueue.push(n):super.fire(n))}}class p extends R{constructor(n){var o;super(n);this._delay=(o=n.delay)!==null&&o!==void 0?o:100}fire(n){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(n)}}class d{constructor(){this.buffers=[]}wrapEvent(n){return(o,u,a)=>n(r=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>o.call(u,r)):o.call(u,r)},void 0,a)}bufferEvents(n){const o=[];this.buffers.push(o);const u=n();return this.buffers.pop(),o.forEach(a=>a()),u}}class l{constructor(){this.listening=!1,this.inputEvent=C.None,this.inputEventListener=j.a.None,this.emitter=new e({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(n){this.inputEvent=n,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=n(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ze,le,K){"use strict";(function(te,j){K.d(le,"b",function(){return u}),K.d(le,"i",function(){return t}),K.d(le,"f",function(){return _}),K.d(le,"d",function(){return f}),K.d(le,"g",function(){return v}),K.d(le,"h",function(){return x}),K.d(le,"c",function(){return b}),K.d(le,"k",function(){return m}),K.d(le,"j",function(){return s}),K.d(le,"a",function(){return g}),K.d(le,"e",function(){return y});var A;const B="en";let C=!1,I=!1,H=!1,U=!1,e=!1,R=!1,p=!1,d,l=B,n,o;const u=typeof self=="object"?self:typeof te=="object"?te:{};let a;typeof u.vscode!="undefined"&&typeof u.vscode.process!="undefined"?a=u.vscode.process:typeof j!="undefined"&&(a=j);const r=typeof((A=a==null?void 0:a.versions)===null||A===void 0?void 0:A.electron)=="string"&&a.type==="renderer";if(typeof navigator=="object"&&!r)o=navigator.userAgent,C=o.indexOf("Windows")>=0,I=o.indexOf("Macintosh")>=0,p=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=o.indexOf("Linux")>=0,R=!0,d=navigator.language,l=d;else if(typeof a=="object"){C=a.platform==="win32",I=a.platform==="darwin",H=a.platform==="linux",U=H&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,d=B,l=B;const w=a.env.VSCODE_NLS_CONFIG;if(w)try{const P=JSON.parse(w),L=P.availableLanguages["*"];d=P.locale,l=L||B,n=P._translationsConfigFile}catch(P){}e=!0}else console.error("Unable to resolve platform.");let i=0;I?i=1:C?i=3:H&&(i=2);const t=C,_=I,f=H,v=e,x=R,b=p,m=o,s=function(){if(u.setImmediate)return u.setImmediate.bind(u);if(typeof u.postMessage=="function"&&!u.importScripts){let L=[];u.addEventListener("message",D=>{if(D.data&&D.data.vscodeSetImmediateId)for(let F=0,O=L.length;F<O;F++){const W=L[F];if(W.id===D.data.vscodeSetImmediateId){L.splice(F,1),W.callback();return}}});let S=0;return D=>{const F=++S;L.push({id:F,callback:D}),u.postMessage({vscodeSetImmediateId:F},"*")}}if(typeof(a==null?void 0:a.nextTick)=="function")return a.nextTick.bind(a);const P=Promise.resolve();return L=>P.then(L)}(),g=I||p?2:C?1:3;let h=!0,T=!1;function y(){if(!T){T=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const P=new Uint16Array(w.buffer);h=P[0]===(2<<8)+1}return h}}).call(this,K("IyRk"),K("Q2Ig"))},N0LK:function(Ze,le,K){"use strict";K.d(le,"C",function(){return te}),K.d(le,"v",function(){return A}),K.d(le,"s",function(){return B}),K.d(le,"t",function(){return C}),K.d(le,"U",function(){return I}),K.d(le,"J",function(){return H}),K.d(le,"O",function(){return U}),K.d(le,"p",function(){return e}),K.d(le,"T",function(){return R}),K.d(le,"q",function(){return p}),K.d(le,"N",function(){return d}),K.d(le,"M",function(){return l}),K.d(le,"Q",function(){return n}),K.d(le,"u",function(){return o}),K.d(le,"x",function(){return u}),K.d(le,"I",function(){return a}),K.d(le,"f",function(){return r}),K.d(le,"h",function(){return i}),K.d(le,"g",function(){return t}),K.d(le,"i",function(){return _}),K.d(le,"G",function(){return f}),K.d(le,"H",function(){return v}),K.d(le,"r",function(){return x}),K.d(le,"R",function(){return b}),K.d(le,"d",function(){return m}),K.d(le,"e",function(){return s}),K.d(le,"E",function(){return g}),K.d(le,"F",function(){return h}),K.d(le,"j",function(){return T}),K.d(le,"z",function(){return y}),K.d(le,"K",function(){return P}),K.d(le,"L",function(){return L}),K.d(le,"m",function(){return D}),K.d(le,"k",function(){return O}),K.d(le,"A",function(){return z}),K.d(le,"a",function(){return Q}),K.d(le,"n",function(){return q}),K.d(le,"l",function(){return me}),K.d(le,"D",function(){return he}),K.d(le,"B",function(){return ce}),K.d(le,"b",function(){return pe}),K.d(le,"S",function(){return ge}),K.d(le,"o",function(){return ee}),K.d(le,"P",function(){return J}),K.d(le,"w",function(){return Re}),K.d(le,"c",function(){return Me}),K.d(le,"y",function(){return He});function te(X){return!X||typeof X!="string"?!0:X.trim().length===0}const j=/{(\d+)}/g;function A(X,...ne){return ne.length===0?X:X.replace(j,function(ue,de){const xe=parseInt(de,10);return isNaN(xe)||xe<0||xe>=ne.length?ue:ne[xe]})}function B(X){return X.replace(/[<>&]/g,function(ne){switch(ne){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ne}})}function C(X){return X.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function I(X,ne=" "){const ue=H(X,ne);return U(ue,ne)}function H(X,ne){if(!X||!ne)return X;const ue=ne.length;if(ue===0||X.length===0)return X;let de=0;for(;X.indexOf(ne,de)===de;)de=de+ue;return X.substring(de)}function U(X,ne){if(!X||!ne)return X;const ue=ne.length,de=X.length;if(ue===0||de===0)return X;let xe=de,Te=-1;for(;!(Te=X.lastIndexOf(ne,xe-1),Te===-1||Te+ue!==xe);){if(Te===0)return"";xe=Te}return X.substring(0,xe)}function e(X){return X.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(X){return X.replace(/\*/g,"")}function p(X,ne,ue={}){if(!X)throw new Error("Cannot create regex from empty string");ne||(X=C(X)),ue.wholeWord&&(/\B/.test(X.charAt(0))||(X="\\b"+X),/\B/.test(X.charAt(X.length-1))||(X=X+"\\b"));let de="";return ue.global&&(de+="g"),ue.matchCase||(de+="i"),ue.multiline&&(de+="m"),ue.unicode&&(de+="u"),new RegExp(X,de)}function d(X){if(X.source==="^"||X.source==="^$"||X.source==="$"||X.source==="^\\s*$")return!1;const ne=X.exec("");return!!(ne&&X.lastIndex===0)}function l(X){return(X.global?"g":"")+(X.ignoreCase?"i":"")+(X.multiline?"m":"")+(X.unicode?"u":"")}function n(X){return X.split(/\r\n|\r|\n/)}function o(X){for(let ne=0,ue=X.length;ne<ue;ne++){const de=X.charCodeAt(ne);if(de!==32&&de!==9)return ne}return-1}function u(X,ne=0,ue=X.length){for(let de=ne;de<ue;de++){const xe=X.charCodeAt(de);if(xe!==32&&xe!==9)return X.substring(ne,de)}return X.substring(ne,ue)}function a(X,ne=X.length-1){for(let ue=ne;ue>=0;ue--){const de=X.charCodeAt(ue);if(de!==32&&de!==9)return ue}return-1}function r(X,ne){return X<ne?-1:X>ne?1:0}function i(X,ne,ue=0,de=X.length,xe=0,Te=ne.length){for(;ue<de&&xe<Te;ue++,xe++){let oe=X.charCodeAt(ue),ke=ne.charCodeAt(xe);if(oe<ke)return-1;if(oe>ke)return 1}const Le=de-ue,Pe=Te-xe;return Le<Pe?-1:Le>Pe?1:0}function t(X,ne){return _(X,ne,0,X.length,0,ne.length)}function _(X,ne,ue=0,de=X.length,xe=0,Te=ne.length){for(;ue<de&&xe<Te;ue++,xe++){let oe=X.charCodeAt(ue),ke=ne.charCodeAt(xe);if(oe===ke)continue;if(oe>=128||ke>=128)return i(X.toLowerCase(),ne.toLowerCase(),ue,de,xe,Te);f(oe)&&(oe-=32),f(ke)&&(ke-=32);const De=oe-ke;if(De===0)continue;return De}const Le=de-ue,Pe=Te-xe;return Le<Pe?-1:Le>Pe?1:0}function f(X){return X>=97&&X<=122}function v(X){return X>=65&&X<=90}function x(X,ne){return X.length===ne.length&&_(X,ne)===0}function b(X,ne){const ue=ne.length;return ne.length>X.length?!1:_(X,ne,0,ue)===0}function m(X,ne){let ue,de=Math.min(X.length,ne.length);for(ue=0;ue<de;ue++)if(X.charCodeAt(ue)!==ne.charCodeAt(ue))return ue;return de}function s(X,ne){let ue,de=Math.min(X.length,ne.length);const xe=X.length-1,Te=ne.length-1;for(ue=0;ue<de;ue++)if(X.charCodeAt(xe-ue)!==ne.charCodeAt(Te-ue))return ue;return de}function g(X){return 55296<=X&&X<=56319}function h(X){return 56320<=X&&X<=57343}function T(X,ne){return(X-55296<<10)+(ne-56320)+65536}function y(X,ne,ue){const de=X.charCodeAt(ue);if(g(de)&&ue+1<ne){const xe=X.charCodeAt(ue+1);if(h(xe))return T(de,xe)}return de}function w(X,ne){const ue=X.charCodeAt(ne-1);if(h(ue)&&ne>1){const de=X.charCodeAt(ne-2);if(g(de))return T(de,ue)}return ue}function P(X,ne){const ue=Ie.getInstance(),de=ne,xe=X.length,Te=y(X,xe,ne);ne+=Te>=65536?2:1;let Le=ue.getGraphemeBreakType(Te);for(;ne<xe;){const Pe=y(X,xe,ne),oe=ue.getGraphemeBreakType(Pe);if(Me(Le,oe))break;ne+=Pe>=65536?2:1,Le=oe}return ne-de}function L(X,ne){const ue=Ie.getInstance(),de=ne,xe=w(X,ne);ne-=xe>=65536?2:1;let Te=ue.getGraphemeBreakType(xe);for(;ne>0;){const Le=w(X,ne),Pe=ue.getGraphemeBreakType(Le);if(Me(Pe,Te))break;ne-=Le>=65536?2:1,Te=Pe}return de-ne}const S=/(?:[\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 D(X){return S.test(X)}const F=/(?:[\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 O(X){return F.test(X)}const W=/^[\t\n\r\x20-\x7E]*$/;function z(X){return W.test(X)}const Q=/[\u2028\u2029]/;function q(X){return Q.test(X)}function me(X){for(let ne=0,ue=X.length;ne<ue;ne++)if(he(X.charCodeAt(ne)))return!0;return!1}function he(X){return X=+X,X>=11904&&X<=55215||X>=63744&&X<=64255||X>=65281&&X<=65374}function ce(X){return X>=127462&&X<=127487||X===8986||X===8987||X===9200||X===9203||X>=9728&&X<=10175||X===11088||X===11093||X>=127744&&X<=128591||X>=128640&&X<=128764||X>=128992&&X<=129003||X>=129280&&X<=129535||X>=129648&&X<=129750}const pe=String.fromCharCode(65279);function ge(X){return!!(X&&X.length>0&&X.charCodeAt(0)===65279)}function ee(X,ne=!1){return X?(ne&&(X=X.replace(/\\./g,"")),X.toLowerCase()!==X):!1}function J(X){const ne=90-65+1;return X=X%(2*ne),X<ne?String.fromCharCode(97+X):String.fromCharCode(65+X-ne)}function Re(X){const ne=Ie.getInstance();return ne.getGraphemeBreakType(X)}function Me(X,ne){return X===0?ne!==5&&ne!==7:X===2&&ne===3?!1:X===4||X===2||X===3||(ne===4||ne===2||ne===3)?!0:X===8&&(ne===8||ne===9||ne===11||ne===12)||((X===11||X===9)&&(ne===9||ne===10)||((X===12||X===10)&&ne===10||(ne===5||ne===13||(ne===7||(X===1||X===13&&ne===14)))))?!1:!(X===6&&ne===6)}class Ie{constructor(){this._data=Fe()}static getInstance(){return Ie._INSTANCE||(Ie._INSTANCE=new Ie),Ie._INSTANCE}getGraphemeBreakType(X){if(X<32)return X===10?3:X===13?2:4;if(X<127)return 0;const ne=this._data,ue=ne.length/3;let de=1;for(;de<=ue;)if(X<ne[3*de])de=2*de;else if(X>ne[3*de+1])de=2*de+1;else return ne[3*de+2];return 0}}Ie._INSTANCE=null;function Fe(){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 He(X,ne){if(X===0)return 0;const ue=_e(X,ne);if(ue!==void 0)return ue;const de=w(ne,X);return X-=Ae(de),X}function _e(X,ne){let ue=w(ne,X);for(X-=Ae(ue);Se(ue)||ue===65039||ue===8419;){if(X===0)return;ue=w(ne,X),X-=Ae(ue)}if(!ce(ue))return;if(X>=0){const de=w(ne,X);de===8205&&(X-=Ae(de))}return X}function Ae(X){return X>=65536?2:1}function Se(X){return 127995<=X&&X<=127999}},SJMd:function(Ze,le){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var K,te,j,A=!1,B,C;window.PR_SHOULD_USE_CONTINUATION=!0;var I,H;(function(){var U=window,e=["break,continue,do,else,for,if,return,while"],R=[e,"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"],p=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[p,"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"],l=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[p,"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"],o="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",u=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",r=[e,"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"],i=[e,"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"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],_=[d,n,l,u,a,r,i,t],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,v="str",x="kwd",b="com",m="typ",s="lit",g="pun",h="pln",T="tag",y="dec",w="src",P="atn",L="atv",S="nocode",D="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(_e){for(var Ae=0,Se=!1,X=!1,ne=0,ue=_e.length;ne<ue;++ne){var de=_e[ne];if(de.ignoreCase)X=!0;else if(/[a-z]/i.test(de.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Se=!0,X=!1;break}}var xe={b:8,t:9,n:10,v:11,f:12,r:13};function Te(De){var Ce=De.charCodeAt(0);if(Ce!==92)return Ce;var Ge=De.charAt(1);return Ce=xe[Ge],Ce||("0"<=Ge&&Ge<="7"?parseInt(De.substring(1),8):Ge==="u"||Ge==="x"?parseInt(De.substring(2),16):De.charCodeAt(1))}function Le(De){if(De<32)return(De<16?"\\x0":"\\x")+De.toString(16);var Ce=String.fromCharCode(De);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function Pe(De){var Ce=De.substring(1,De.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ge=[],Be=Ce[0]==="^",ve=["["];Be&&ve.push("^");for(var be=Be?1:0,se=Ce.length;be<se;++be){var re=Ce[be];if(/\\[bdsw]/i.test(re))ve.push(re);else{var ae=Te(re),V;be+2<se&&Ce[be+1]==="-"?(V=Te(Ce[be+2]),be+=2):V=ae,Ge.push([ae,V]),V<65||ae>122||(V<65||ae>90||Ge.push([Math.max(65,ae)|32,Math.min(V,90)|32]),V<97||ae>122||Ge.push([Math.max(97,ae)&~32,Math.min(V,122)&~32]))}}Ge.sort(function(fe,ye){return fe[0]-ye[0]||ye[1]-fe[1]});for(var Y=[],$=[],be=0;be<Ge.length;++be){var Z=Ge[be];Z[0]<=$[1]+1?$[1]=Math.max($[1],Z[1]):Y.push($=Z)}for(var be=0;be<Y.length;++be){var Z=Y[be];ve.push(Le(Z[0])),Z[1]>Z[0]&&(Z[1]+1>Z[0]&&ve.push("-"),ve.push(Le(Z[1])))}return ve.push("]"),ve.join("")}function oe(De){for(var Ce=De.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")),Ge=Ce.length,Be=[],ve=0,be=0;ve<Ge;++ve){var se=Ce[ve];if(se==="(")++be;else if(se.charAt(0)==="\\"){var re=+se.substring(1);re&&(re<=be?Be[re]=-1:Ce[ve]=Le(re))}}for(var ve=1;ve<Be.length;++ve)Be[ve]===-1&&(Be[ve]=++Ae);for(var ve=0,be=0;ve<Ge;++ve){var se=Ce[ve];if(se==="(")++be,Be[be]||(Ce[ve]="(?:");else if(se.charAt(0)==="\\"){var re=+se.substring(1);re&&re<=be&&(Ce[ve]="\\"+Be[re])}}for(var ve=0;ve<Ge;++ve)Ce[ve]==="^"&&Ce[ve+1]!=="^"&&(Ce[ve]="");if(De.ignoreCase&&Se)for(var ve=0;ve<Ge;++ve){var se=Ce[ve],ae=se.charAt(0);se.length>=2&&ae==="["?Ce[ve]=Pe(se):ae!=="\\"&&(Ce[ve]=se.replace(/[a-zA-Z]/g,function($){var Z=$.charCodeAt(0);return"["+String.fromCharCode(Z&~32,Z|32)+"]"}))}return Ce.join("")}for(var ke=[],ne=0,ue=_e.length;ne<ue;++ne){var de=_e[ne];if(de.global||de.multiline)throw new Error(""+de);ke.push("(?:"+oe(de)+")")}return new RegExp(ke.join("|"),X?"gi":"g")}function O(_e,Ae){var Se=/(?:^|\s)nocode(?:\s|$)/,X=[],ne=0,ue=[],de=0;function xe(Te){var Le=Te.nodeType;if(Le==1){if(Se.test(Te.className))return;for(var Pe=Te.firstChild;Pe;Pe=Pe.nextSibling)xe(Pe);var oe=Te.nodeName.toLowerCase();(oe==="br"||oe==="li")&&(X[de]=`
`,ue[de<<1]=ne++,ue[de++<<1|1]=Te)}else if(Le==3||Le==4){var ke=Te.nodeValue;ke.length&&(Ae?ke=ke.replace(/\r\n?/g,`
`):ke=ke.replace(/[ \t\r\n]+/g," "),X[de]=ke,ue[de<<1]=ne,ne+=ke.length,ue[de++<<1|1]=Te)}}return xe(_e),{sourceCode:X.join("").replace(/\n$/,""),spans:ue}}function W(_e,Ae,Se,X,ne){if(!Se)return;var ue={sourceNode:_e,pre:1,langExtension:null,numberLines:null,sourceCode:Se,spans:null,basePos:Ae,decorations:null};X(ue),ne.push.apply(ne,ue.decorations)}var z=/\S/;function Q(_e){for(var Ae=void 0,Se=_e.firstChild;Se;Se=Se.nextSibling){var X=Se.nodeType;Ae=X===1?Ae?_e:Se:X===3&&z.test(Se.nodeValue)?_e:Ae}return Ae===_e?void 0:Ae}function q(_e,Ae){var Se={},X;(function(){for(var de=_e.concat(Ae),xe=[],Te={},Le=0,Pe=de.length;Le<Pe;++Le){var oe=de[Le],ke=oe[3];if(ke)for(var De=ke.length;--De>=0;)Se[ke.charAt(De)]=oe;var Ce=oe[1],Ge=""+Ce;Te.hasOwnProperty(Ge)||(xe.push(Ce),Te[Ge]=null)}xe.push(/[\0-\uffff]/),X=F(xe)})();var ne=Ae.length,ue=function(de){for(var xe=de.sourceCode,Te=de.basePos,Le=de.sourceNode,Pe=[Te,h],oe=0,ke=xe.match(X)||[],De={},Ce=0,Ge=ke.length;Ce<Ge;++Ce){var Be=ke[Ce],ve=De[Be],be=void 0,se;if(typeof ve=="string")se=!1;else{var re=Se[Be.charAt(0)];if(re)be=Be.match(re[1]),ve=re[0];else{for(var ae=0;ae<ne;++ae)if(re=Ae[ae],be=Be.match(re[1]),be){ve=re[0];break}be||(ve=h)}se=ve.length>=5&&ve.substring(0,5)==="lang-",se&&!(be&&typeof be[1]=="string")&&(se=!1,ve=w),se||(De[Be]=ve)}var V=oe;if(oe+=Be.length,!se)Pe.push(Te+V,ve);else{var Y=be[1],$=Be.indexOf(Y),Z=$+Y.length;be[2]&&(Z=Be.length-be[2].length,$=Z-Y.length);var fe=ve.substring(5);W(Le,Te+V,Be.substring(0,$),ue,Pe),W(Le,Te+V+$,Y,J(fe,Y),Pe),W(Le,Te+V+Z,Be.substring(Z),ue,Pe)}}de.decorations=Pe};return ue}function me(_e){var Ae=[],Se=[];_e.tripleQuotedStrings?Ae.push([v,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_e.multiLineStrings?Ae.push([v,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ae.push([v,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_e.verbatimStrings&&Se.push([v,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var X=_e.hashComments;X&&(_e.cStyleComments?(X>1?Ae.push([b,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ae.push([b,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Se.push([v,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ae.push([b,/^#[^\r\n]*/,null,"#"])),_e.cStyleComments&&(Se.push([b,/^\/\/[^\r\n]*/,null]),Se.push([b,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ne=_e.regexLiterals;if(ne){var ue=ne>1?"":`
\r`,de=ue?".":"[\\S\\s]",xe="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+de+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+de+")*(?:\\x5D|$))+/";Se.push(["lang-regex",RegExp("^"+D+"("+xe+")")])}var Te=_e.types;Te&&Se.push([m,Te]);var Le=(""+_e.keywords).replace(/^ | $/g,"");Le.length&&Se.push([x,new RegExp("^(?:"+Le.replace(/[\s,]+/g,"|")+")\\b"),null]),Ae.push([h,/^\s+/,null,` \r
\xA0`]);var Pe="^.[^\\s\\w.$@'\"`/\\\\]*";return _e.regexLiterals&&(Pe+="(?!s*/)"),Se.push([s,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[s,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[g,new RegExp(Pe),null]),q(Ae,Se)}var he=me({keywords:_,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ce(_e,Ae,Se){for(var X=/(?:^|\s)nocode(?:\s|$)/,ne=/\r\n?|\n/,ue=_e.ownerDocument,de=ue.createElement("li");_e.firstChild;)de.appendChild(_e.firstChild);var xe=[de];function Te(Ce){var Ge=Ce.nodeType;if(Ge==1&&!X.test(Ce.className))if(Ce.nodeName==="br")Le(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var Be=Ce.firstChild;Be;Be=Be.nextSibling)Te(Be);else if((Ge==3||Ge==4)&&Se){var ve=Ce.nodeValue,be=ve.match(ne);if(be){var se=ve.substring(0,be.index);Ce.nodeValue=se;var re=ve.substring(be.index+be[0].length);if(re){var ae=Ce.parentNode;ae.insertBefore(ue.createTextNode(re),Ce.nextSibling)}Le(Ce),se||Ce.parentNode.removeChild(Ce)}}}function Le(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Ge(be,se){var re=se?be.cloneNode(!1):be,ae=be.parentNode;if(ae){var V=Ge(ae,1),Y=be.nextSibling;V.appendChild(re);for(var $=Y;$;$=Y)Y=$.nextSibling,V.appendChild($)}return re}for(var Be=Ge(Ce.nextSibling,0),ve;(ve=Be.parentNode)&&ve.nodeType===1;)Be=ve;xe.push(Be)}for(var Pe=0;Pe<xe.length;++Pe)Te(xe[Pe]);Ae===(Ae|0)&&xe[0].setAttribute("value",Ae);var oe=ue.createElement("ol");oe.className="linenums";for(var ke=Math.max(0,Ae-1|0)||0,Pe=0,De=xe.length;Pe<De;++Pe)de=xe[Pe],de.className="L"+(Pe+ke)%10,de.firstChild||de.appendChild(ue.createTextNode("\xA0")),oe.appendChild(de);_e.appendChild(oe)}function pe(_e){var Ae=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ae=Ae&&+Ae[1]<=8;var Se=/\n/g,X=_e.sourceCode,ne=X.length,ue=0,de=_e.spans,xe=de.length,Te=0,Le=_e.decorations,Pe=Le.length,oe=0;Le[Pe]=ne;var ke,De;for(De=ke=0;De<Pe;)Le[De]!==Le[De+2]?(Le[ke++]=Le[De++],Le[ke++]=Le[De++]):De+=2;for(Pe=ke,De=ke=0;De<Pe;){for(var Ce=Le[De],Ge=Le[De+1],Be=De+2;Be+2<=Pe&&Le[Be+1]===Ge;)Be+=2;Le[ke++]=Ce,Le[ke++]=Ge,De=Be}Pe=Le.length=ke;var ve=_e.sourceNode,be="";ve&&(be=ve.style.display,ve.style.display="none");try{for(var se=null;Te<xe;){var re=de[Te],ae=de[Te+2]||ne,V=Le[oe+2]||ne,Be=Math.min(ae,V),Y=de[Te+1],$;if(Y.nodeType!==1&&($=X.substring(ue,Be))){Ae&&($=$.replace(Se,"\r")),Y.nodeValue=$;var Z=Y.ownerDocument,fe=Z.createElement("span");fe.className=Le[oe+1];var ye=Y.parentNode;ye.replaceChild(fe,Y),fe.appendChild(Y),ue<ae&&(de[Te+1]=Y=Z.createTextNode(X.substring(Be,ae)),ye.insertBefore(Y,fe.nextSibling))}ue=Be,ue>=ae&&(Te+=2),ue>=V&&(oe+=2)}}finally{ve&&(ve.style.display=be)}}var ge={};function ee(_e,Ae){for(var Se=Ae.length;--Se>=0;){var X=Ae[Se];ge.hasOwnProperty(X)?U.console&&console.warn("cannot override language handler %s",X):ge[X]=_e}}function J(_e,Ae){return _e&&ge.hasOwnProperty(_e)||(_e=/^\s*</.test(Ae)?"default-markup":"default-code"),ge[_e]}ee(he,["default-code"]),ee(q([],[[h,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[b,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ee(q([[h,/^[\s]+/,null,` \r
`],[L,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["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"]),ee(q([],[[L,/^[\s\S]+/]]),["uq.val"]),ee(me({keywords:d,hashComments:!0,cStyleComments:!0,types:f}),["c","cc","cpp","cxx","cyc","m"]),ee(me({keywords:"null,true,false"}),["json"]),ee(me({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:f}),["cs"]),ee(me({keywords:l,cStyleComments:!0}),["java"]),ee(me({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(me({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(me({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(me({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(me({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(me({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(q([],[[v,/^[\s\S]+/]]),["regex"]);function Re(_e){var Ae=_e.langExtension;try{var Se=O(_e.sourceNode,_e.pre),X=Se.sourceCode;_e.sourceCode=X,_e.spans=Se.spans,_e.basePos=0,J(Ae,X)(_e),pe(_e)}catch(ne){U.console&&console.log(ne&&ne.stack||ne)}}function Me(_e,Ae,Se){var X=Se||!1,ne=Ae||null,ue=document.createElement("div");ue.innerHTML="<pre>"+_e+"</pre>",ue=ue.firstChild,X&&ce(ue,X,!0);var de={langExtension:ne,numberLines:X,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Re(de),ue.innerHTML}function Ie(_e,Ae){var Se=Ae||document.body,X=Se.ownerDocument||document;function ne(re){return Se.getElementsByTagName(re)}for(var ue=[ne("pre"),ne("code"),ne("xmp")],de=[],xe=0;xe<ue.length;++xe)for(var Te=0,Le=ue[xe].length;Te<Le;++Te)de.push(ue[xe][Te]);ue=null;var Pe=Date;Pe.now||(Pe={now:function(){return+new Date}});var oe=0,ke=/\blang(?:uage)?-([\w.]+)(?!\S)/,De=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,Ge=/pre|xmp/i,Be=/^code$/i,ve=/^(?:pre|code|xmp)$/i,be={};function se(){for(var re=U.PR_SHOULD_USE_CONTINUATION?Pe.now()+250:Infinity;oe<de.length&&Pe.now()<re;oe++){for(var ae=de[oe],V=be,Y=ae;Y=Y.previousSibling;){var $=Y.nodeType,Z=($===7||$===8)&&Y.nodeValue;if(Z?!/^\??prettify\b/.test(Z):$!==3||/\S/.test(Y.nodeValue))break;if(Z){V={},Z.replace(/\b(\w+)=([\w:.%+-]+)/g,function(et,ut,gt){V[ut]=gt});break}}var fe=ae.className;if((V!==be||De.test(fe))&&!Ce.test(fe)){for(var ye=!1,Oe=ae.parentNode;Oe;Oe=Oe.parentNode){var Ue=Oe.tagName;if(ve.test(Ue)&&Oe.className&&De.test(Oe.className)){ye=!0;break}}if(!ye){ae.className+=" prettyprinted";var We=V.lang;if(!We){We=fe.match(ke);var Ne;!We&&(Ne=Q(ae))&&Be.test(Ne.tagName)&&(We=Ne.className.match(ke)),We&&(We=We[1])}var Ve;if(Ge.test(ae.tagName))Ve=1;else{var qe=ae.currentStyle,ze=X.defaultView,rt=qe?qe.whiteSpace:ze&&ze.getComputedStyle?ze.getComputedStyle(ae,null).getPropertyValue("white-space"):0;Ve=rt&&rt.substring(0,3)==="pre"}var lt=V.linenums;(lt=lt==="true"||+lt)||(lt=fe.match(/\blinenums\b(?::(\d+))?/),lt=lt?lt[1]&&lt[1].length?+lt[1]:!0:!1),lt&&ce(ae,lt,Ve);var ct={langExtension:We,sourceNode:ae,numberLines:lt,pre:Ve,sourceCode:null,basePos:null,spans:null,decorations:null};Re(ct)}}}oe<de.length?U.setTimeout(se,250):typeof _e=="function"&&_e()}se()}var Fe=U.PR={createSimpleLexer:q,registerLangHandler:ee,sourceDecorator:me,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:L,PR_COMMENT:b,PR_DECLARATION:y,PR_KEYWORD:x,PR_LITERAL:s,PR_NOCODE:S,PR_PLAIN:h,PR_PUNCTUATION:g,PR_SOURCE:w,PR_STRING:v,PR_TAG:T,PR_TYPE:m,prettyPrintOne:A?U.prettyPrintOne=Me:I=Me,prettyPrint:H=A?U.prettyPrint=Ie:H=Ie},He=U.define;typeof He=="function"&&He.amd&&He("google-code-prettify",[],function(){return Fe})})()},T8No:function(Ze,le,K){"use strict";K.d(le,"a",function(){return H}),K.d(le,"e",function(){return U}),K.d(le,"c",function(){return g}),K.d(le,"b",function(){return h}),K.d(le,"d",function(){return T}),K.d(le,"f",function(){return P});var te=K("MNsG"),j=K("N0LK"),A=K("Cg/j");let B=te.k||"";const C=new Map;C.set("false",!1),C.set("true",!0),C.set("isMac",te.f),C.set("isLinux",te.d),C.set("isWindows",te.i),C.set("isWeb",te.h),C.set("isMacNative",te.f&&!te.h),C.set("isEdge",B.indexOf("Edg/")>=0),C.set("isFirefox",B.indexOf("Firefox")>=0),C.set("isChrome",B.indexOf("Chrome")>=0),C.set("isSafari",B.indexOf("Safari")>=0);const I=Object.prototype.hasOwnProperty;class H{static has(S){return d.create(S)}static equals(S,D){return l.create(S,D)}static regex(S,D){return v.create(S,D)}static not(S){return a.create(S)}static and(...S){return m.create(S,null)}static or(...S){return s.create(S,null,!0)}static deserialize(S,D=!1){return S?this._deserializeOrExpression(S,D):void 0}static _deserializeOrExpression(S,D){let F=S.split("||");return s.create(F.map(O=>this._deserializeAndExpression(O,D)),null,!0)}static _deserializeAndExpression(S,D){let F=S.split("&&");return m.create(F.map(O=>this._deserializeOne(O,D)),null)}static _deserializeOne(S,D){if(S=S.trim(),S.indexOf("!=")>=0){let F=S.split("!=");return u.create(F[0].trim(),this._deserializeValue(F[1],D))}if(S.indexOf("==")>=0){let F=S.split("==");return l.create(F[0].trim(),this._deserializeValue(F[1],D))}if(S.indexOf("=~")>=0){let F=S.split("=~");return v.create(F[0].trim(),this._deserializeRegexValue(F[1],D))}if(S.indexOf(" in ")>=0){let F=S.split(" in ");return n.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const F=S.split(">=");return t.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const F=S.split(">");return i.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const F=S.split("<=");return f.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const F=S.split("<");return _.create(F[0].trim(),F[1].trim())}return/^\!\s*/.test(S)?a.create(S.substr(1).trim()):d.create(S)}static _deserializeValue(S,D){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let F=/^'([^']*)'$/.exec(S);return F?F[1].trim():S}static _deserializeRegexValue(S,D){if(Object(j.C)(S)){if(D)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let F=S.indexOf("/"),O=S.lastIndexOf("/");if(F===O||F<0){if(D)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let W=S.slice(F+1,O),z=S[O+1]==="i"?"i":"";try{return new RegExp(W,z)}catch(Q){if(D)throw new Error(`bad regexp-value '${S}', parse error: ${Q}`);return console.warn(`bad regexp-value '${S}', parse error: ${Q}`),null}}}function U(S,D){const F=S?S.substituteConstants():void 0,O=D?D.substituteConstants():void 0;return!F&&!O?!0:!F||!O?!1:F.equals(O)}function e(S,D){return S.cmp(D)}class R{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return p.INSTANCE}}R.INSTANCE=new R;class p{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return R.INSTANCE}}p.INSTANCE=new p;class d{constructor(S,D){this.key=S,this.negated=D,this.type=2}static create(S,D=null){const F=C.get(S);return typeof F=="boolean"?F?p.INSTANCE:R.INSTANCE:new d(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:y(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=C.get(this.key);return typeof S=="boolean"?S?p.INSTANCE:R.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this)),this.negated}}class l{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=4}static create(S,D,F=null){if(typeof D=="boolean")return D?d.create(S,F):a.create(S,F);const O=C.get(S);if(typeof O=="boolean"){const W=O?"true":"false";return D===W?p.INSTANCE:R.INSTANCE}return new l(S,D,F)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=C.get(this.key);if(typeof S=="boolean"){const D=S?"true":"false";return this.value===D?p.INSTANCE:R.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class n{constructor(S,D){this.key=S,this.valueKey=D,this.type=10,this.negated=null}static create(S,D){return new n(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const D=S.getValue(this.valueKey),F=S.getValue(this.key);return Array.isArray(D)?D.indexOf(F)>=0:typeof F=="string"&&typeof D=="object"&&D!==null?I.call(D,F):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(S){this._actual=S,this.type=11}static create(S){return new o(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class u{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=5}static create(S,D,F=null){if(typeof D=="boolean")return D?a.create(S,F):d.create(S,F);const O=C.get(S);if(typeof O=="boolean"){const W=O?"true":"false";return D===W?R.INSTANCE:p.INSTANCE}return new u(S,D,F)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=C.get(this.key);if(typeof S=="boolean"){const D=S?"true":"false";return this.value===D?R.INSTANCE:p.INSTANCE}return this}evaluate(S){return S.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class a{constructor(S,D){this.key=S,this.negated=D,this.type=3}static create(S,D=null){const F=C.get(S);return typeof F=="boolean"?F?R.INSTANCE:p.INSTANCE:new a(S,D)}cmp(S){return S.type!==this.type?this.type-S.type:y(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=C.get(this.key);return typeof S=="boolean"?S?R.INSTANCE:p.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function r(S,D){if(typeof S=="string"){const F=parseFloat(S);isNaN(F)||(S=F)}return typeof S=="string"||typeof S=="number"?D(S):R.INSTANCE}class i{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=12}static create(S,D,F=null){return r(D,O=>new i(S,O,F))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class t{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=13}static create(S,D,F=null){return r(D,O=>new t(S,O,F))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class _{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=14}static create(S,D,F=null){return r(D,O=>new _(S,O,F))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class f{constructor(S,D,F){this.key=S,this.value=D,this.negated=F,this.type=15}static create(S,D,F=null){return r(D,O=>new f(S,O,F))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class v{constructor(S,D){this.key=S,this.regexp=D,this.type=7,this.negated=null}static create(S,D){return new v(S,D)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const D=this.regexp?this.regexp.source:"",F=S.regexp?S.regexp.source:"";return D<F?-1:D>F?1:0}equals(S){if(S.type===this.type){const D=this.regexp?this.regexp.source:"",F=S.regexp?S.regexp.source:"";return this.key===S.key&&D===F}return!1}substituteConstants(){return this}evaluate(S){let D=S.getValue(this.key);return this.regexp?this.regexp.test(D):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this)),this.negated}}class x{constructor(S){this._actual=S,this.type=8}static create(S){return new x(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function b(S){let D=null;for(let F=0,O=S.length;F<O;F++){const W=S[F].substituteConstants();if(S[F]!==W&&D===null){D=[];for(let z=0;z<F;z++)D[z]=S[z]}D!==null&&(D[F]=W)}return D===null?S:D}class m{constructor(S,D){this.expr=S,this.negated=D,this.type=6}static create(S,D){return m._normalizeArr(S,D)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let D=0,F=this.expr.length;D<F;D++){const O=e(this.expr[D],S.expr[D]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let D=0,F=this.expr.length;D<F;D++)if(!this.expr[D].equals(S.expr[D]))return!1;return!0}return!1}substituteConstants(){const S=b(this.expr);return S===this.expr?this:m.create(S,this.negated)}evaluate(S){for(let D=0,F=this.expr.length;D<F;D++)if(!this.expr[D].evaluate(S))return!1;return!0}static _normalizeArr(S,D){const F=[];let O=!1;for(const W of S){if(!W)continue;if(W.type===1){O=!0;continue}if(W.type===0)return R.INSTANCE;if(W.type===6){F.push(...W.expr);continue}F.push(W)}if(F.length===0&&O)return p.INSTANCE;if(F.length===0)return;if(F.length===1)return F[0];F.sort(e);for(let W=1;W<F.length;W++)F[W-1].equals(F[W])&&(F.splice(W,1),W--);if(F.length===1)return F[0];for(;F.length>1;){const W=F[F.length-1];if(W.type!==9)break;F.pop();const z=F.pop(),Q=F.length===0,q=s.create(W.expr.map(me=>m.create([me,z],null)),null,Q);q&&(F.push(q),F.sort(e))}return F.length===1?F[0]:new m(F,D)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let D of this.expr)S.push(...D.keys());return S}negate(){if(!this.negated){const S=[];for(let D of this.expr)S.push(D.negate());this.negated=s.create(S,this,!0)}return this.negated}}class s{constructor(S,D){this.expr=S,this.negated=D,this.type=9}static create(S,D,F){return s._normalizeArr(S,D,F)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let D=0,F=this.expr.length;D<F;D++){const O=e(this.expr[D],S.expr[D]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let D=0,F=this.expr.length;D<F;D++)if(!this.expr[D].equals(S.expr[D]))return!1;return!0}return!1}substituteConstants(){const S=b(this.expr);return S===this.expr?this:s.create(S,this.negated,!1)}evaluate(S){for(let D=0,F=this.expr.length;D<F;D++)if(this.expr[D].evaluate(S))return!0;return!1}static _normalizeArr(S,D,F){let O=[],W=!1;if(S){for(let z=0,Q=S.length;z<Q;z++){const q=S[z];if(!q)continue;if(q.type===0){W=!0;continue}if(q.type===1)return p.INSTANCE;if(q.type===9){O=O.concat(q.expr);continue}O.push(q)}if(O.length===0&&W)return R.INSTANCE;O.sort(e)}if(O.length===0)return;if(O.length===1)return O[0];for(let z=1;z<O.length;z++)O[z-1].equals(O[z])&&(O.splice(z,1),z--);if(O.length===1)return O[0];if(F){for(let z=0;z<O.length;z++)for(let Q=z+1;Q<O.length;Q++)P(O[z],O[Q])&&(O.splice(Q,1),Q--);if(O.length===1)return O[0]}return new s(O,D)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let D of this.expr)S.push(...D.keys());return S}negate(){if(!this.negated){let S=[];for(let D of this.expr)S.push(D.negate());for(;S.length>1;){const D=S.shift(),F=S.shift(),O=[];for(const z of L(D))for(const Q of L(F))O.push(m.create([z,Q],null));const W=S.length===0;S.unshift(s.create(O,null,W))}this.negated=S[0]}return this.negated}}class g extends d{constructor(S,D,F){super(S,null);this._defaultValue=D,typeof F=="object"?g._info.push(Object.assign(Object.assign({},F),{key:S})):F!==!0&&g._info.push({key:S,description:F,type:D!=null?typeof D:void 0})}static all(){return g._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return l.create(this.key,S)}}g._info=[];const h=Object(A.c)("contextKeyService"),T="setContext";function y(S,D){return S<D?-1:S>D?1:0}function w(S,D,F,O){return S<F?-1:S>F?1:D<O?-1:D>O?1:0}function P(S,D){if(D.type===6&&S.type!==9&&S.type!==6){for(const W of D.expr)if(S.equals(W))return!0}const F=S.negate(),O=L(F).concat(L(D));O.sort(e);for(let W=0;W<O.length;W++){const z=O[W],Q=z.negate();for(let q=W+1;q<O.length;q++){const me=O[q];if(Q.equals(me))return!0}}return!1}function L(S){return S.type===9?S.expr:[S]}},TXwP:function(Ze,le,K){var te,j;(function(){var A;(function(){"use strict";var C=[,,function(e){function R(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=[]}R.prototype.clone_empty=function(){var l=new R(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},R.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},R.prototype.has_match=function(l){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(l))return!0;return!1},R.prototype.set_indent=function(l,n){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=n||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 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},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(l){this.__items.push(l);var n=l.lastIndexOf(`
`);n!==-1?this.__character_count=l.length-n:this.__character_count+=l.length},R.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},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 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,n){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)),n=n||"",l.indent_level>0&&(n=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}p.prototype.get_indent_size=function(l,n){var o=this.__base_string_length;return n=n||0,l<0&&(o=0),o+=l*this.__indent_size,o+=n,o},p.prototype.get_indent_string=function(l,n){var o=this.__base_string;return n=n||0,l<0&&(l=0,o=""),n+=l*this.__indent_size,this.__ensure_cache(n),o+=this.__cache[n],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,n=0,o="";this.__indent_size&&l>=this.__indent_size&&(n=Math.floor(l/this.__indent_size),l-=n*this.__indent_size,o=new Array(n+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function d(l,n){this.__indent_cache=new p(l,n),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 R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(l,n){return this.__indent_cache.get_indent_string(l,n)},d.prototype.get_indent_size=function(l,n){return this.__indent_cache.get_indent_size(l,n)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(l){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return l!==`
`&&(o=o.replace(/[\n]/g,l)),o},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(l,n){return l=l||0,n=n||0,this.next_line.set_indent(l,n),this.__lines.length>1?(this.current_line.set_indent(l,n),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(l){for(var n=0;n<l.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(l){for(var n=this.__lines.length;l<n;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(l,n){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==n){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},e.exports.Output=d},,,,function(e){function R(l,n){this.raw_options=p(l,n),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(l,n){var o=this.raw_options[l],u=n||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},R.prototype._get_boolean=function(l,n){var o=this.raw_options[l],u=o===void 0?!!n:!!o;return u},R.prototype._get_characters=function(l,n){var o=this.raw_options[l],u=n||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},R.prototype._get_number=function(l,n){var o=this.raw_options[l];n=parseInt(n,10),isNaN(n)&&(n=0);var u=parseInt(o,10);return isNaN(u)&&(u=n),u},R.prototype._get_selection=function(l,n,o){var u=this._get_selection_list(l,n,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return u[0]},R.prototype._get_selection_list=function(l,n,o){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[n[0]],!this._is_valid_selection(o,n))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,n))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return u},R.prototype._is_valid_selection=function(l,n){return l.length&&n.length&&!l.some(function(o){return n.indexOf(o)===-1})};function p(l,n){var o={};l=d(l);var u;for(u in l)u!==n&&(o[u]=l[u]);if(n&&l[n])for(u in l[n])o[u]=l[n][u];return o}function d(l){var n={},o;for(o in l){var u=o.replace(/-/g,"_");n[u]=l[o]}return n}e.exports.Options=R,e.exports.normalizeOpts=d,e.exports.mergeOpts=p},,function(e){var R=RegExp.prototype.hasOwnProperty("sticky");function p(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},p.prototype.peek=function(d){var l=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(l=this.__input.charAt(d)),l},p.prototype.__match=function(d,l){d.lastIndex=l;var n=d.exec(this.__input);return n&&!(R&&d.sticky)&&(n.index!==l&&(n=null)),n},p.prototype.test=function(d,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(d,l):!1},p.prototype.testChar=function(d,l){var n=this.peek(l);return d.lastIndex=0,n!==null&&d.test(n)},p.prototype.match=function(d){var l=this.__match(d,this.__position);return l?this.__position+=l[0].length:l=null,l},p.prototype.read=function(d,l,n){var o="",u;return d&&(u=this.match(d),u&&(o+=u[0])),l&&(u||!d)&&(o+=this.readUntil(l,n)),o},p.prototype.readUntil=function(d,l){var n="",o=this.__position;d.lastIndex=this.__position;var u=d.exec(this.__input);return u?(o=u.index,l&&(o+=u[0].length)):o=this.__input_length,n=this.__input.substring(this.__position,o),this.__position=o,n},p.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},p.prototype.get_regexp=function(d,l){var n=null,o="g";return l&&R&&(o="y"),typeof d=="string"&&d!==""?n=new RegExp(d,o):d&&(n=new RegExp(d.source,o)),n},p.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(d){var l=this.__position,n=this.readUntilAfter(d);return this.__position=l,n},p.prototype.lookBack=function(d){var l=this.__position-1;return l>=d.length&&this.__input.substring(l-d.length,l).toLowerCase()===d},e.exports.InputScanner=p},,,,,function(e){function R(p,d){p=typeof p=="string"?p:p.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+d,"g")}R.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(p);l;)d[l[1]]=l[2],l=this.__directive_pattern.exec(p);return d},R.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=R},,function(e,R,p){var d=p(16).Beautifier,l=p(17).Options;function n(o,u){var a=new d(o,u);return a.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new l}},function(e,R,p){var d=p(17).Options,l=p(2).Output,n=p(8).InputScanner,o=p(13).Directives,u=new o(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,i=/\s/,t=/(?:\s|\n)+/g,_=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,f=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function v(x,b){this._source_text=x||"",this._options=new d(b),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"]}v.prototype.eatString=function(x){var b="";for(this._ch=this._input.next();this._ch;){if(b+=this._ch,this._ch==="\\")b+=this._input.next();else if(x.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return b},v.prototype.eatWhitespace=function(x){for(var b=i.test(this._input.peek()),m=0;i.test(this._input.peek());)this._ch=this._input.next(),x&&this._ch===`
`&&((m===0||m<this._options.max_preserve_newlines)&&(m++,this._output.add_new_line(!0)));return b},v.prototype.foundNestedPseudoClass=function(){for(var x=0,b=1,m=this._input.peek(b);m;){if(m==="{")return!0;if(m==="(")x+=1;else if(m===")"){if(x===0)return!1;x-=1}else if(m===";"||m==="}")return!1;b++,m=this._input.peek(b)}return!1},v.prototype.print_string=function(x){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(x)},v.prototype.preserveSingleSpace=function(x){x&&(this._output.space_before_token=!0)},v.prototype.indent=function(){this._indentLevel++},v.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,b=this._options.eol;b==="auto"&&(b=`
`,x&&a.test(x||"")&&(b=x.match(a)[0])),x=x.replace(r,`
`);var m=x.match(/^[\t ]*/)[0];this._output=new l(this._options,m),this._input=new n(x),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var s=0,g=!1,h=!1,T=!1,y=!1,w=!1,P=!1,L=this._ch,S=!1,D,F,O;D=this._input.read(t),F=D!=="",O=L,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),L=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(_),z=u.get_directives(W);z&&z.ignore==="start"&&(W+=u.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(f)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(F),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Q.match(/[ :]$/)&&(Q=this.eatString(": ").replace(/\s$/,""),this.print_string(Q),this._output.space_before_token=!0),Q=Q.replace(/\s$/,""),Q==="extend"?y=!0:Q==="import"&&(w=!0),Q in this.NESTED_AT_RULE?(this._nestedLevel+=1,Q in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!g&&s===0&&Q.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),T?(T=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),w=!1,y=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),g=!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 q=0;q<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;q++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[q])){S=!0;break}(g||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&s===0?(this.print_string(":"),h||(h=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var me=O==='"'||O==="'";this.preserveSingleSpace(me||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,s===0?(h&&(this.outdent(),h=!1),y=!1,w=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()));else{var he=!1;this._input.lookBack("with")&&(he=!0),this.preserveSingleSpace(F||he),this.print_string(this._ch),h&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),s++,this.indent())}else if(this._ch===")")s&&(s--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||P)&&s===0&&!w&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&s===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&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.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 ce=O==='"'||O==="'";this.preserveSingleSpace(ce||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&S&&this._output.add_new_line()}var pe=this._output.get_code(b);return pe},e.exports.Beautifier=v},function(e,R,p){var d=p(6).Options;function l(n){d.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<u.length;a++)u[a]!=="expand"?this.brace_style="collapse":this.brace_style=u[a]}l.prototype=new d,e.exports.Options=l}],I={};function H(e){var R=I[e];if(R!==void 0)return R.exports;var p=I[e]={exports:{}};return C[e](p,p.exports,H),p.exports}var U=H(15);A=U})();var B=A;!(te=[],j=function(){return{css_beautify:B}}.apply(le,te),j!==void 0&&(Ze.exports=j))})()},VSi8:function(Ze,le,K){"use strict";K.r(le);var te=K("+L6B"),j=K("2/Rp"),A=K("5NDa"),B=K("5rEg"),C=K("5Dmo"),I=K("3S7+"),H=K("14J3"),U=K("BMrR"),e=K("jCWc"),R=K("kPKH"),p=K("sPJy"),d=K("bE4q"),l=K("/zsF"),n=K("PArb"),o=K("miYZ"),u=K("tsqr"),a=K("9og8"),r=K("k1fw"),i=K("oBTY"),t=K("y8nQ"),_=K("Vl3Y"),f=K("tJVT"),v=K("PpiC"),x=K("WmNS"),b=K.n(x),m=K("q1tI"),s=K.n(m),g=K("Ty5D"),h=K("55Ip"),T=K("9kvl"),y=K("w5pM"),w=K("tgas"),P=K("OaEy"),L=K("2fM7"),S=K("sRBo"),D=K("kaz8"),F=K("2qtc"),O=K("kLXV"),W=K("9Bee"),z=K("otbz"),Q=K.n(z),q=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],me=function(X,ne){var ue=X.problemset,de=X.globalSetting,xe=X.loading,Te=X.dispatch,Le=X.onRef,Pe=Le===void 0?function(){}:Le,oe=X.editData,ke=X.editKey,De=X.callback,Ce=Object(v.a)(X,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),Ge=Object(m.useState)([]),Be=Object(f.a)(Ge,2),ve=Be[0],be=Be[1],se=Object(m.useState)(),re=Object(f.a)(se,2),ae=re[0],V=re[1],Y=Object(m.useState)([]),$=Object(f.a)(Y,2),Z=$[0],fe=$[1],ye=Object(m.useState)(""),Oe=Object(f.a)(ye,2),Ue=Oe[0],We=Oe[1],Ne=Object(m.useState)(0),Ve=Object(f.a)(Ne,2),qe=Ve[0],ze=Ve[1],rt=Object(m.useState)(!0),lt=Object(f.a)(rt,2),ct=lt[0],et=lt[1],ut=Object(m.useState)(!1),gt=Object(f.a)(ut,2),Lt=gt[0],Ye=gt[1],xt=Object(g.i)(),Je=Object(m.useState)(""),Ke=Object(f.a)(Je,2),Qe=Ke[0],tt=Ke[1],vt=Object(m.useState)(""),st=Object(f.a)(vt,2),at=st[0],ot=st[1];Object(m.useEffect)(function(){var wt,dt,Xe,pt,St,Rt,mt,M;if(!(oe!=null&&(wt=oe.question)!==null&&wt!==void 0&&wt.question_title)){be([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),et(!0),We(""),Ye(!1);return}tt(oe==null||((dt=oe.question)===null||dt===void 0)?void 0:dt.max_choices),ot(oe==null||((Xe=oe.question)===null||Xe===void 0)?void 0:Xe.min_choices),We(oe==null||((pt=oe.question)===null||pt===void 0)?void 0:pt.question_title),et(!!(oe!=null&&(St=oe.question)!==null&&St!==void 0&&St.is_necessary)),be(oe==null||((Rt=oe.question)===null||Rt===void 0)?void 0:Rt.answers.map(function(c){return{value:c.answer_text,disabled:c.answer_text==="\u5176\u5B83"}})),Ye(!!(oe!=null&&(mt=oe.question)!==null&&mt!==void 0&&(M=mt.answers)!==null&&M!==void 0&&M.find(function(c){return c.answer_text==="\u5176\u5B83"})))},[oe]),Object(m.useImperativeHandle)(ne,function(){return{onSave:it}});var it=function(){var wt=Object(a.a)(b.a.mark(function dt(Xe){var pt,St,Rt,mt,M,c;return b.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!(Qe&&!at||!Qe&&at)){k.next=3;break}return u.b.info('\u53EF\u9009\uFF1A\u6700\u5C0F\u548C\u6700\u5927\u9650\u5236\u987B\u540C\u65F6\u4E3A\u6570\u503C\u6216\u8005\u201C--"'),k.abrupt("return");case 3:if(!(at>Qe)){k.next=6;break}return u.b.info("\u53EF\u9009\u7684\u6700\u5927\u9650\u5236\u4E0D\u80FD\u5C0F\u4E8E\u6700\u5C0F\u9650\u5236"),k.abrupt("return");case 6:if(Ue){k.next=9;break}return u.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),k.abrupt("return",!1);case 9:if(St=ve.findIndex(function(G){return!G.value}),!(St>-1)){k.next=13;break}return u.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(q[St]," \u9009\u9879\u7684\u5185\u5BB9")),k.abrupt("return",!1);case 13:if(mt={question_title:Ue,question_type:2,insert_id:oe.insert_id,is_necessary:Math.ceil(ct),max_choices:Qe,min_choices:at,question_answers:ve.map(function(G){return G.value})},!((pt=oe.question)!==null&&pt!==void 0&&pt.id)){k.next=20;break}return k.next=17,Object(w.w)(Object(r.a)({pollsId:oe.question.id},mt));case 17:Rt=k.sent,k.next=23;break;case 20:return k.next=22,Object(w.c)(Object(r.a)({exercise_bank_id:xt.topicId},mt));case 22:Rt=k.sent;case 23:if(!(Rt.status===0)){k.next=30;break}return u.b.success("\u4FDD\u5B58\u6210\u529F"),De("edit",-1),k.next=28,Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)});case 28:M=k.sent,Xe&&(mt.answers=mt.question_answers.map(function(G){return{answer_text:G}}),c=[].concat(Object(i.a)(M==null?void 0:M.questions),[{question:Object(r.a)({type:2,insert_id:oe.question.id,key:oe.key,question_type:2},mt)}]),De("addContinue",{editData:c}));case 30:case"end":return k.stop()}},dt)}));return function(Xe){return wt.apply(this,arguments)}}(),ft=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],Et=function(){var wt=Object(a.a)(b.a.mark(function dt(Xe){var pt,St;return b.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:mt.t0=Xe.id,mt.next=mt.t0==="del"?3:mt.t0==="up"||mt.t0==="down"?5:mt.t0==="edit"?9:mt.t0==="add"?11:13;break;case 3:return O.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(b.a.mark(function c(){var E;return b.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(w.e)({pollsId:oe==null||((E=oe.question)===null||E===void 0)?void 0:E.id});case 2:Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)});case 3:case"end":return G.stop()}},c)}))()}}),mt.abrupt("break",13);case 5:return mt.next=7,Object(w.i)({pollsId:oe==null||((pt=oe.question)===null||pt===void 0)?void 0:pt.id,opr:Xe.id});case 7:return Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)}),mt.abrupt("break",13);case 9:return De("edit",oe.key),mt.abrupt("break",13);case 11:return De("add",{type:2,key:oe.key,insert_id:oe==null||((St=oe.question)===null||St===void 0)?void 0:St.id,question_type:2}),mt.abrupt("break",13);case 13:case"end":return mt.stop()}},dt)}));return function(Xe){return wt.apply(this,arguments)}}(),ht=function(){var dt,Xe,pt,St;return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16"},"\u7B2C",oe.key,"\u9898"),s.a.createElement("span",{className:"font16 c-light-black ml10"},"\u591A\u9009\u9898"),s.a.createElement("span",{className:"tag-grey-eae ml10 mr10"},(oe==null||((dt=oe.question)===null||dt===void 0)?void 0:dt.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54"),"\u53EF\u9009",oe==null||((Xe=oe.question)===null||Xe===void 0)?void 0:Xe.min_choices,"-",oe==null||((pt=oe.question)===null||pt===void 0)?void 0:pt.max_choices,"\u9879"),ft.map(function(Rt,mt){return Rt.id==="up"&&oe.key===1||Rt.id==="down"&&oe.key===oe.len?null:s.a.createElement(I.a,{key:mt,placement:"bottom",title:Rt.name},s.a.createElement("span",{onClick:function(){return Et(Rt)},className:Rt.icon}))})),s.a.createElement("div",{className:"mt5"},s.a.createElement(W.a,{value:oe.question.question_title})),s.a.createElement("div",{className:Q.a.questionChoices},oe==null||((St=oe.question.answers)===null||St===void 0)?void 0:St.map(function(Rt,mt){return s.a.createElement(U.a,null,s.a.createElement(R.a,null,s.a.createElement(D.a,{key:mt,disabled:!0},s.a.createElement("span",{className:"c-black font14"},Rt.answer_text))))})))},It=function(){return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16 c-blue"},"\u591A\u9009\u9898")," ",s.a.createElement(D.a,{checked:!!ct,className:"ml10",onChange:function(Xe){return et(Xe.target.checked)}},"\u5FC5\u7B54"))),s.a.createElement("p",{className:Q.a.titleWrap},s.a.createElement(B.a.TextArea,{autoSize:{maxRows:5},rows:1,value:Ue,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(Xe){return We(Xe.target.value)}})),ve.map(function(dt,Xe){return s.a.createElement(U.a,{className:Q.a.choiceWrap,key:Xe,gutter:[12,12]},s.a.createElement(R.a,null,s.a.createElement("span",{className:"font16"},"\u9009\u9879")),s.a.createElement(R.a,{className:Q.a.editorWrap,flex:"1"},s.a.createElement(B.a.TextArea,{autoSize:{maxRows:5},value:ve[Xe].value,rows:1,disabled:!!dt.disabled,onChange:function(St){ve[Xe].value=St.target.value,be(Object(i.a)(ve))}})),s.a.createElement(R.a,null,Xe>1&&s.a.createElement(I.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(Q.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){be(ve.filter(function(St,Rt){return Rt!==Xe})),dt.disabled&&Ye(!1)}}))))}),s.a.createElement(U.a,{gutter:[12,12]},s.a.createElement(R.a,null,"\u53EF\u9009"),s.a.createElement(R.a,null,s.a.createElement(L.a,{value:at||"",style:{width:120},onChange:function(Xe){return ot(Xe)}},s.a.createElement(L.a.Option,{value:""},"--"),ve.map(function(dt,Xe){return s.a.createElement(L.a.Option,{value:String(Xe+2)},Xe+2)})),s.a.createElement("span",{className:"ml10 mr10"},"~"),s.a.createElement(L.a,{style:{width:120},value:Qe||"",onChange:function(Xe){return tt(Xe)}},s.a.createElement(L.a.Option,{value:""},"--"),ve.map(function(dt,Xe){return s.a.createElement(L.a.Option,{value:String(Xe+2)},Xe+2)})),s.a.createElement("span",{className:"font14 c-grey-999"},"\uFF08\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u7CFB\u7EDF\u5BF9\u5176\u9009\u62E9\u7684\u9009\u9879\u4E2A\u6570\u8FDB\u884C\u9650\u5236\uFF0C--\u8868\u793A\u4E0D\u9650\u5236\uFF09"))),s.a.createElement(U.a,{gutter:[12,12]},s.a.createElement(R.a,{flex:"1"},s.a.createElement(j.a,{type:"default",onClick:function(){ve.find(function(Xe){return Xe.value==="\u5176\u5B83"})?be([].concat(Object(i.a)(ve.filter(function(Xe){return Xe.value!=="\u5176\u5B83"})),[{value:""},{value:"\u5176\u5B83",disabled:!0}])):be([].concat(Object(i.a)(ve),[{value:""}]))}},"\u65B0\u589E\u9009\u9879"),!Lt&&s.a.createElement(j.a,{type:"default",className:"ml20",onClick:function(){be([].concat(Object(i.a)(ve),[{disabled:!0,value:"\u5176\u5B83"}])),Ye(!0)}},"\u65B0\u589E\u5176\u5B83\u9009\u9879")),s.a.createElement(R.a,{className:"tl"},s.a.createElement(j.a,{type:"default",onClick:function(){var Xe;(Xe=oe.question)!==null&&Xe!==void 0&&Xe.id?De("edit",-1):De("del",oe.key)}},"\u53D6\u6D88"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return it()}},"\u4FDD\u5B58"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return it(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return s.a.createElement("section",{className:Q.a.wrap},ke!==oe.key&&ht(),ke===oe.key&&It())},he=Object(T.a)(function(Se){var X=Se.problemset,ne=Se.loading,ue=Se.globalSetting;return{problemset:X,globalSetting:ue,loading:ne.effects}},null,null,{forwardRef:!0})(Object(m.forwardRef)(me)),ce=K("7Kak"),pe=K("9yH6"),ge=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ee=function(X,ne){var ue=X.problemset,de=X.globalSetting,xe=X.loading,Te=X.dispatch,Le=X.onRef,Pe=Le===void 0?function(){}:Le,oe=X.editData,ke=X.editKey,De=X.callback,Ce=Object(v.a)(X,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),Ge=Object(m.useState)([]),Be=Object(f.a)(Ge,2),ve=Be[0],be=Be[1],se=Object(m.useState)(),re=Object(f.a)(se,2),ae=re[0],V=re[1],Y=Object(m.useState)([]),$=Object(f.a)(Y,2),Z=$[0],fe=$[1],ye=Object(m.useState)(""),Oe=Object(f.a)(ye,2),Ue=Oe[0],We=Oe[1],Ne=Object(m.useState)(0),Ve=Object(f.a)(Ne,2),qe=Ve[0],ze=Ve[1],rt=Object(m.useState)(!1),lt=Object(f.a)(rt,2),ct=lt[0],et=lt[1],ut=Object(m.useState)(!1),gt=Object(f.a)(ut,2),Lt=gt[0],Ye=gt[1],xt=Object(g.i)();Object(m.useEffect)(function(){var st,at,ot,it,ft,Et;if(!(oe!=null&&(st=oe.question)!==null&&st!==void 0&&st.question_title)){be([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),et(!1),We(""),Ye(!1);return}We(oe==null||((at=oe.question)===null||at===void 0)?void 0:at.question_title),et(!!(oe!=null&&(ot=oe.question)!==null&&ot!==void 0&&ot.is_necessary)),be(oe==null||((it=oe.question)===null||it===void 0)?void 0:it.answers.map(function(ht){return{value:ht.answer_text,disabled:ht.answer_text==="\u5176\u5B83"}})),Ye(!!(oe!=null&&(ft=oe.question)!==null&&ft!==void 0&&(Et=ft.answers)!==null&&Et!==void 0&&Et.find(function(ht){return ht.answer_text==="\u5176\u5B83"})))},[oe]),Object(m.useImperativeHandle)(ne,function(){return{onSave:Je}});var Je=function(){var st=Object(a.a)(b.a.mark(function at(ot){var it,ft,Et,ht,It,wt;return b.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:if(Ue){Xe.next=3;break}return u.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Xe.abrupt("return",!1);case 3:if(ft=ve.findIndex(function(pt){return!pt.value}),!(ft>-1)){Xe.next=7;break}return u.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ge[ft]," \u9009\u9879\u7684\u5185\u5BB9")),Xe.abrupt("return",!1);case 7:if(ht={question_title:Ue,question_type:1,insert_id:oe.insert_id,is_necessary:Math.ceil(ct),question_answers:ve.map(function(pt){return pt.value})},!((it=oe.question)!==null&&it!==void 0&&it.id)){Xe.next=14;break}return Xe.next=11,Object(w.w)(Object(r.a)({pollsId:oe.question.id},ht));case 11:Et=Xe.sent,Xe.next=17;break;case 14:return Xe.next=16,Object(w.c)(Object(r.a)({exercise_bank_id:xt.topicId},ht));case 16:Et=Xe.sent;case 17:if(!(Et.status===0)){Xe.next=24;break}return u.b.success("\u4FDD\u5B58\u6210\u529F"),De("edit",-1),Xe.next=22,Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)});case 22:It=Xe.sent,ot&&(ht.answers=ht.question_answers.map(function(pt){return{answer_text:pt}}),wt=[].concat(Object(i.a)(It==null?void 0:It.questions),[{question:Object(r.a)({type:1,insert_id:oe.question.id,key:oe.key,question_type:1},ht)}]),De("addContinue",{editData:wt}));case 24:case"end":return Xe.stop()}},at)}));return function(ot){return st.apply(this,arguments)}}(),Ke=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],Qe=function(){var st=Object(a.a)(b.a.mark(function at(ot){var it,ft;return b.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:ht.t0=ot.id,ht.next=ht.t0==="del"?3:ht.t0==="up"||ht.t0==="down"?5:ht.t0==="edit"?9:ht.t0==="add"?11:13;break;case 3:return O.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(b.a.mark(function wt(){var dt;return b.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(w.e)({pollsId:oe==null||((dt=oe.question)===null||dt===void 0)?void 0:dt.id});case 2:Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)});case 3:case"end":return pt.stop()}},wt)}))()}}),ht.abrupt("break",13);case 5:return ht.next=7,Object(w.i)({pollsId:oe==null||((it=oe.question)===null||it===void 0)?void 0:it.id,opr:ot.id});case 7:return Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},xt)}),ht.abrupt("break",13);case 9:return De("edit",oe.key),ht.abrupt("break",13);case 11:return De("add",{type:1,key:oe.key,insert_id:oe==null||((ft=oe.question)===null||ft===void 0)?void 0:ft.id,question_type:1}),ht.abrupt("break",13);case 13:case"end":return ht.stop()}},at)}));return function(ot){return st.apply(this,arguments)}}(),tt=function(){var at,ot;return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16"},"\u7B2C",oe.key,"\u9898"),s.a.createElement("span",{className:"font16 c-light-black ml10"},"\u5355\u9009\u9898"),s.a.createElement("span",{className:"tag-grey-eae ml10"},(oe==null||((at=oe.question)===null||at===void 0)?void 0:at.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54")),Ke.map(function(it,ft){return it.id==="up"&&oe.key===1||it.id==="down"&&oe.key===oe.len?null:s.a.createElement(I.a,{key:ft,placement:"bottom",title:it.name},s.a.createElement("span",{onClick:function(){return Qe(it)},className:it.icon}))})),s.a.createElement("div",{className:"mt5"},s.a.createElement(W.a,{value:oe.question.question_title})),s.a.createElement("div",{className:Q.a.questionChoices},oe==null||((ot=oe.question.answers)===null||ot===void 0)?void 0:ot.map(function(it,ft){return s.a.createElement(U.a,null,s.a.createElement(R.a,null,s.a.createElement(pe.a,{key:ft,disabled:!0})),s.a.createElement(R.a,{flex:"1"},s.a.createElement("span",{className:"c-black font14"},it.answer_text)))})))},vt=function(){return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16 c-blue"},"\u5355\u9009\u9898")," ",s.a.createElement(D.a,{checked:!!ct,className:"ml10",onChange:function(ot){return et(ot.target.checked)}},"\u5FC5\u7B54"))),s.a.createElement("p",{className:Q.a.titleWrap},s.a.createElement(B.a.TextArea,{autoSize:{maxRows:5},rows:1,value:Ue,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(ot){return We(ot.target.value)}})),ve.map(function(at,ot){return s.a.createElement(U.a,{className:Q.a.choiceWrap,key:ot,gutter:[12,12]},s.a.createElement(R.a,null,s.a.createElement("span",{className:"font16"},"\u9009\u9879")),s.a.createElement(R.a,{className:Q.a.editorWrap,flex:"1"},s.a.createElement(B.a.TextArea,{autoSize:{maxRows:5},value:ve[ot].value,rows:1,disabled:!!at.disabled,onChange:function(ft){ve[ot].value=ft.target.value,be(Object(i.a)(ve))}})),s.a.createElement(R.a,null,ot>1&&s.a.createElement(I.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(Q.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){be(ve.filter(function(ft,Et){return Et!==ot})),at.disabled&&Ye(!1)}}))))}),s.a.createElement(U.a,{gutter:[12,12]},s.a.createElement(R.a,{flex:"1"},s.a.createElement(j.a,{type:"default",onClick:function(){ve.find(function(ot){return ot.value==="\u5176\u5B83"})?be([].concat(Object(i.a)(ve.filter(function(ot){return ot.value!=="\u5176\u5B83"})),[{value:""},{value:"\u5176\u5B83",disabled:!0}])):be([].concat(Object(i.a)(ve),[{value:""}]))}},"\u65B0\u589E\u9009\u9879"),!Lt&&s.a.createElement(j.a,{type:"default",className:"ml20",onClick:function(){be([].concat(Object(i.a)(ve),[{disabled:!0,value:"\u5176\u5B83"}])),Ye(!0)}},"\u65B0\u589E\u5176\u5B83\u9009\u9879")),s.a.createElement(R.a,{className:"tl"},s.a.createElement(j.a,{type:"default",onClick:function(){var ot;(ot=oe.question)!==null&&ot!==void 0&&ot.id?De("edit",-1):De("del",oe.key)}},"\u53D6\u6D88"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Je()}},"\u4FDD\u5B58"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return Je(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return s.a.createElement("section",{className:Q.a.wrap},ke!==oe.key&&tt(),ke===oe.key&&vt())},J=Object(T.a)(function(Se){var X=Se.problemset,ne=Se.loading,ue=Se.globalSetting;return{problemset:X,globalSetting:ue,loading:ne.effects}},null,null,{forwardRef:!0})(Object(m.forwardRef)(ee)),Re=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Me=function(X,ne){var ue=X.problemset,de=X.globalSetting,xe=X.loading,Te=X.dispatch,Le=X.onRef,Pe=Le===void 0?function(){}:Le,oe=X.editData,ke=X.editKey,De=X.callback,Ce=Object(v.a)(X,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]),Ge=Object(m.useState)(""),Be=Object(f.a)(Ge,2),ve=Be[0],be=Be[1],se=Object(m.useState)(!0),re=Object(f.a)(se,2),ae=re[0],V=re[1],Y=Object(g.i)();Object(m.useEffect)(function(){var Ue,We,Ne;if(!(oe!=null&&(Ue=oe.question)!==null&&Ue!==void 0&&Ue.question_title)){V(!0),be("");return}be(oe==null||((We=oe.question)===null||We===void 0)?void 0:We.question_title),V(!!(oe!=null&&(Ne=oe.question)!==null&&Ne!==void 0&&Ne.is_necessary))},[oe]),Object(m.useImperativeHandle)(ne,function(){return{onSave:$}});var $=function(){var Ue=Object(a.a)(b.a.mark(function We(Ne){var Ve,qe,ze,rt,lt;return b.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if(ve){et.next=3;break}return u.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),et.abrupt("return",!1);case 3:if(ze={question_title:ve,question_type:3,insert_id:oe.insert_id,is_necessary:Math.ceil(ae)},!((Ve=oe.question)!==null&&Ve!==void 0&&Ve.id)){et.next=10;break}return et.next=7,Object(w.w)(Object(r.a)({pollsId:oe.question.id},ze));case 7:qe=et.sent,et.next=13;break;case 10:return et.next=12,Object(w.c)(Object(r.a)({exercise_bank_id:Y.topicId},ze));case 12:qe=et.sent;case 13:if(!(qe.status===0)){et.next=20;break}return u.b.success("\u4FDD\u5B58\u6210\u529F"),De("edit",-1),et.next=18,Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},Y)});case 18:rt=et.sent,Ne&&(lt=[].concat(Object(i.a)(rt==null?void 0:rt.questions),[{question:Object(r.a)({type:3,insert_id:oe.question.id,key:oe.key,question_type:3},ze)}]),De("addContinue",{editData:lt}));case 20:case"end":return et.stop()}},We)}));return function(Ne){return Ue.apply(this,arguments)}}(),Z=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],fe=function(){var Ue=Object(a.a)(b.a.mark(function We(Ne){var Ve,qe;return b.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:rt.t0=Ne.id,rt.next=rt.t0==="del"?3:rt.t0==="up"||rt.t0==="down"?5:rt.t0==="edit"?9:rt.t0==="add"?11:13;break;case 3:return O.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(b.a.mark(function ct(){var et;return b.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(w.e)({pollsId:oe==null||((et=oe.question)===null||et===void 0)?void 0:et.id});case 2:Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},Y)});case 3:case"end":return gt.stop()}},ct)}))()}}),rt.abrupt("break",13);case 5:return rt.next=7,Object(w.i)({pollsId:oe==null||((Ve=oe.question)===null||Ve===void 0)?void 0:Ve.id,opr:Ne.id});case 7:return Te({type:"polls/getExerciseBanks",payload:Object(r.a)({},Y)}),rt.abrupt("break",13);case 9:return De("edit",oe.key),rt.abrupt("break",13);case 11:return De("add",{type:3,key:oe.key,insert_id:oe==null||((qe=oe.question)===null||qe===void 0)?void 0:qe.id,question_type:3}),rt.abrupt("break",13);case 13:case"end":return rt.stop()}},We)}));return function(Ne){return Ue.apply(this,arguments)}}(),ye=function(){var We,Ne;return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16"},"\u7B2C",oe.key,"\u9898"),s.a.createElement("span",{className:"font16 c-light-black ml10"},"\u4E3B\u89C2\u9898"),s.a.createElement("span",{className:"tag-grey-eae ml10 mr10"},(oe==null||((We=oe.question)===null||We===void 0)?void 0:We.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54")),Z.map(function(Ve,qe){return Ve.id==="up"&&oe.key===1||Ve.id==="down"&&oe.key===oe.len?null:s.a.createElement(I.a,{key:qe,placement:"bottom",title:Ve.name},s.a.createElement("span",{onClick:function(){return fe(Ve)},className:Ve.icon}))})),s.a.createElement("div",{className:"mt5"},s.a.createElement(W.a,{value:oe.question.question_title}),s.a.createElement("div",{className:"mt15"},s.a.createElement(B.a.TextArea,{placeholder:"\u5728\u6B64\u586B\u5165\u7B54\u6848",rows:5,disabled:!0}))),s.a.createElement("div",{className:Q.a.questionChoices},oe==null||((Ne=oe.question.answers)===null||Ne===void 0)?void 0:Ne.map(function(Ve,qe){return s.a.createElement(U.a,null,s.a.createElement(R.a,null,s.a.createElement(D.a,{key:qe,disabled:!0},s.a.createElement("span",{className:"c-black font14"},Ve.answer_text))))})))},Oe=function(){return s.a.createElement("aside",null,s.a.createElement("div",{className:Q.a.questionType},s.a.createElement("div",null,s.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898")," ",s.a.createElement(D.a,{checked:!!ae,className:"ml10",onChange:function(Ne){return V(Ne.target.checked)}},"\u5FC5\u7B54"))),s.a.createElement("p",{className:Q.a.titleWrap},s.a.createElement(B.a.TextArea,{autoSize:{maxRows:5},rows:1,value:ve,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:function(Ne){return be(Ne.target.value)}})),s.a.createElement(U.a,{gutter:[12,12]},s.a.createElement(R.a,{flex:"1"}),s.a.createElement(R.a,{className:"tl"},s.a.createElement(j.a,{type:"default",onClick:function(){var Ne;(Ne=oe.question)!==null&&Ne!==void 0&&Ne.id?De("edit",-1):De("del",oe.key)}},"\u53D6\u6D88"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return $()}},"\u4FDD\u5B58"),s.a.createElement(j.a,{className:"ml20",type:"primary",onClick:function(){return $(!0)}},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))))};return s.a.createElement("section",{className:Q.a.wrap},ke!==oe.key&&ye(),ke===oe.key&&Oe())},Ie=Object(T.a)(function(Se){var X=Se.problemset,ne=Se.loading,ue=Se.globalSetting;return{problemset:X,globalSetting:ue,loading:ne.effects}},null,null,{forwardRef:!0})(Object(m.forwardRef)(Me)),Fe=K("7iMQ"),He=K.n(Fe),_e=function(X){var ne,ue,de,xe,Te,Le,Pe,oe,ke,De,Ce,Ge,Be=X.polls,ve=X.globalSetting,be=X.loading,se=X.user,re=X.dispatch,ae=Object(v.a)(X,["polls","globalSetting","loading","user","dispatch"]),V=Object(g.i)(),Y=se.userInfo,$=_.a.useForm(),Z=Object(f.a)($,1),fe=Z[0],ye=Object(m.useState)([]),Oe=Object(f.a)(ye,2),Ue=Oe[0],We=Oe[1],Ne=Object(m.useState)(!1),Ve=Object(f.a)(Ne,2),qe=Ve[0],ze=Ve[1],rt=Object(m.useState)(-1),lt=Object(f.a)(rt,2),ct=lt[0],et=lt[1],ut=[{name:"\u5355\u9009\u9898",id:1},{name:"\u591A\u9009\u9898",id:2},{name:"\u4E3B\u89C2\u9898",id:3}],gt=Object(m.useRef)();Object(m.useEffect)(function(){var Ke;if((Ke=Be.exerciseBanks)!==null&&Ke!==void 0&&Ke.questions){var Qe,tt,vt,st,at;We(Object(i.a)((Qe=Be.exerciseBanks)===null||Qe===void 0?void 0:Qe.questions)),fe.setFieldsValue({exercise_name:(tt=Be.exerciseBanks)===null||tt===void 0||((vt=tt.poll)===null||vt===void 0)?void 0:vt.name,exercise_description:(st=Be.exerciseBanks)===null||st===void 0||((at=st.poll)===null||at===void 0)?void 0:at.description})}},[Be.exerciseBanks]),Object(m.useEffect)(function(){re({type:"polls/getExerciseBanks",payload:Object(r.a)({},V)})},[V.categoryId]);var Lt=function(){var Ke=Object(a.a)(b.a.mark(function Qe(){var tt;return b.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,fe.validateFields();case 2:return tt=fe.getFieldValue(),tt.is_md=!0,tt.topicId=V.topicId,ze(!1),st.next=8,Object(w.v)(Object(r.a)({},tt));case 8:re({type:"polls/getExerciseBanks",payload:Object(r.a)({},V)});case 9:case"end":return st.stop()}},Qe)}));return function(){return Ke.apply(this,arguments)}}(),Ye=function(){var Ke=Object(a.a)(b.a.mark(function Qe(tt){var vt;return b.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(vt=gt==null?void 0:gt.current,!(ct!==-1)){at.next=4;break}return u.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),at.abrupt("return");case 4:et(Ue.length+1),We([].concat(Object(i.a)(Ue),[{question:{question_type:tt}}]));case 6:case"end":return at.stop()}},Qe)}));return function(tt){return Ke.apply(this,arguments)}}(),xt=function(Qe,tt,vt){var st;switch(Qe){case"edit":if(tt!==-1&&ct!==-1&&tt!==ct){u.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}et(tt);return;case"add":if(ct!=-1){u.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}et(-1);break;case"addContinue":We(Object(i.a)(tt==null?void 0:tt.editData)),et(tt==null||((st=tt.editData)===null||st===void 0)?void 0:st.length);break;case"del":Ue.splice(tt-1,1),We(Object(i.a)(Ue)),et(-1);break}},Je=function(){return Ue==null?void 0:Ue.map(function(Qe,tt){var vt;if(Qe.key=tt+1,Qe.len=Ue.length,Qe.question.question_type===1)return s.a.createElement("aside",{key:Qe.id},s.a.createElement(J,{ref:gt,editKey:ct,callback:xt,editData:Qe}),s.a.createElement(n.a,null));if(Qe.question.question_type===2)return s.a.createElement("aside",{key:Qe.id},s.a.createElement(he,{ref:gt,editKey:ct,callback:xt,editData:Qe}),s.a.createElement(n.a,null));if(((vt=Qe.question)===null||vt===void 0?void 0:vt.question_type)===3)return s.a.createElement("aside",{key:Qe.id},s.a.createElement(Ie,{ref:gt,editKey:ct,callback:xt,editData:Qe}),s.a.createElement(n.a,null))})};return s.a.createElement("section",{className:"edu-container"},s.a.createElement("section",{className:"animated fadeIn"},s.a.createElement("aside",{className:"mt10"},Y&&s.a.createElement(d.a,{separator:">"},s.a.createElement(d.a.Item,null,s.a.createElement(h.a,{to:"/users/".concat(V.username,"/").concat(V.topictype==="personal"?"topics":"topicbank","/").concat(V.topictype)},V.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),s.a.createElement(d.a.Item,null,s.a.createElement(h.a,{to:"/users/".concat(Y==null?void 0:Y.login,"/topics/").concat(V.topicId,"/").concat(V.topictype,"/poll/detail")},"\u8BE6\u60C5")),s.a.createElement(d.a.Item,null,"\u7F16\u8F91"))),s.a.createElement("aside",{className:[He.a.title,"mt20"].join(" ")},s.a.createElement(U.a,{style:{width:"100%"}},s.a.createElement(R.a,{flex:"1"},s.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91")),s.a.createElement(R.a,null,s.a.createElement(h.a,{className:"font16 c-light-black",to:"/users/".concat(Y.login,"/topics/").concat(V.topictype)},"\u8FD4\u56DE"))))),s.a.createElement("section",{className:[He.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},!qe&&s.a.createElement("aside",null,s.a.createElement("div",{className:He.a.containerDesc},s.a.createElement("div",null,(ne=Be.exerciseBanks)===null||ne===void 0||((ue=ne.poll)===null||ue===void 0)?void 0:ue.name),s.a.createElement("div",null,s.a.createElement(I.a,{title:"\u7F16\u8F91"},s.a.createElement("span",{onClick:function(){return ze(!0)},className:"iconfont c-green ml30 icon-bianjidaibeijing"})))),s.a.createElement("div",{className:"c-light-black"},(de=Be.exerciseBanks)===null||de===void 0||((xe=de.poll)===null||xe===void 0)?void 0:xe.description)),qe&&s.a.createElement(_.a,{layout:"vertical",form:fe},s.a.createElement(_.a.Item,{name:"exercise_name",label:"\u95EE\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u95EE\u5377\u6807\u9898"}]},s.a.createElement(B.a,{maxLength:60,placeholder:"\u95EE\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),s.a.createElement(_.a.Item,{label:"\u95EE\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},s.a.createElement(B.a.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u95EE\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),s.a.createElement(_.a.Item,{className:"tr"},s.a.createElement(j.a,{type:"primary",onClick:function(){Lt()}},"\u4FDD\u5B58")))),s.a.createElement("section",{className:"mt20"},s.a.createElement(U.a,null,s.a.createElement(R.a,{flex:1},s.a.createElement("span",{className:"c-light-black mr20"},"\u5355\u9009\u9898 ",(Te=Be.exerciseBanks)===null||Te===void 0||((Le=Te.question_types)===null||Le===void 0)?void 0:Le.q_singles," \u9898"),s.a.createElement("span",{className:"c-light-black mr20"},"\u591A\u9009\u9898 ",(Pe=Be.exerciseBanks)===null||Pe===void 0||((oe=Pe.question_types)===null||oe===void 0)?void 0:oe.q_doubles," \u9898"),s.a.createElement("span",{className:"c-light-black"},"\u4E3B\u89C2\u9898 ",(ke=Be.exerciseBanks)===null||ke===void 0||((De=ke.question_types)===null||De===void 0)?void 0:De.q_mains," \u9898")),s.a.createElement(R.a,{className:"c-light-black"},"\u5408\u8BA1"," ",s.a.createElement("span",{className:"c-orange"},(Ce=Be.exerciseBanks)===null||Ce===void 0||((Ge=Ce.question_types)===null||Ge===void 0)?void 0:Ge.q_counts)," ","\u9898"))),Ue!=""&&s.a.createElement("section",{className:[He.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Je()),s.a.createElement("section",{className:[He.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},ut.map(function(Ke,Qe){return s.a.createElement(j.a,{className:"mr20",type:"primary",onClick:function(){return Ye(Ke.id)}},s.a.createElement(y.a,{className:"mr5"}),Ke.name)})))},Ae=le.default=Object(T.a)(function(Se){var X=Se.polls,ne=Se.loading,ue=Se.user,de=Se.globalSetting;return{polls:X,globalSetting:de,user:ue,loading:ne.effects}})(_e)},Vhoy:function(Ze,le,K){"use strict";K.d(le,"d",function(){return B}),K.d(le,"e",function(){return C}),K.d(le,"c",function(){return I}),K.d(le,"b",function(){return H}),K.d(le,"a",function(){return U});var te=K("MI8n");class j{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(e){const R=this._icons.get(e.id);R?e.description?R.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const A=new j,B=A;function C(e,R){return new H(e,R)}function I(e){return e?e.replace(/\$\((.*?)\)/g,(R,p)=>` ${p} `).trim():""}class H{constructor(e,R,p){this.id=e,this.definition=R,this.description=p,A.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var U;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const R=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function p(n){if(n instanceof H)return["codicon","codicon-"+n.id];const o=R.exec(n.id);if(!o)return p(H.error);let[,u,a]=o;const r=["codicon","codicon-"+u];return a&&r.push("codicon-modifier-"+a.substr(1)),r}e.asClassNameArray=p;function d(n){return p(n).join(" ")}e.asClassName=d;function l(n){return"."+p(n).join(".")}e.asCSSSelector=l})(U||(U={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(H||(H={}))},Y1PL:function(Ze,le,K){"use strict";K.r(le),K.d(le,"ResizableTextArea",function(){return Q});var te=K("wx14"),j=K("1OyB"),A=K("vuIU"),B=K("Ji7U"),C=K("LK+K"),I=K("q1tI"),H=K("VTBJ"),U=K("rePB"),e=K("Zm9Q"),R=K("Kwbf"),p=K("c+Xe"),d=K("m+aA"),l=K("bdgK"),n=new Map;function o(he){he.forEach(function(ce){var pe,ge=ce.target;(pe=n.get(ge))===null||pe===void 0||pe.forEach(function(ee){return ee(ge)})})}var u=new l.default(o),a=null,r=null;function i(he,ce){n.has(he)||(n.set(he,new Set),u.observe(he)),n.get(he).add(ce)}function t(he,ce){n.has(he)&&(n.get(he).delete(ce),n.get(he).size||(u.unobserve(he),n.delete(he)))}var _=function(he){Object(B.a)(pe,he);var ce=Object(C.a)(pe);function pe(){return Object(j.a)(this,pe),ce.apply(this,arguments)}return Object(A.a)(pe,[{key:"render",value:function(){return this.props.children}}]),pe}(I.Component),f=I.createContext(null);function v(he){var ce=he.children,pe=he.onBatchResize,ge=I.useRef(0),ee=I.useRef([]),J=I.useContext(f),Re=I.useCallback(function(Me,Ie,Fe){ge.current+=1;var He=ge.current;ee.current.push({size:Me,element:Ie,data:Fe}),Promise.resolve().then(function(){He===ge.current&&(pe==null||pe(ee.current),ee.current=[])}),J==null||J(Me,Ie,Fe)},[pe,J]);return I.createElement(f.Provider,{value:Re},ce)}function x(he){var ce=he.children,pe=he.disabled,ge=I.useRef(null),ee=I.useRef(null),J=I.useContext(f),Re=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Me=I.isValidElement(ce)&&Object(p.c)(ce),Ie=Me?ce.ref:null,Fe=I.useMemo(function(){return Object(p.a)(Ie,ge)},[Ie,ge]),He=I.useRef(he);He.current=he;var _e=I.useCallback(function(Ae){var Se=He.current,X=Se.onResize,ne=Se.data,ue=Ae.getBoundingClientRect(),de=ue.width,xe=ue.height,Te=Ae.offsetWidth,Le=Ae.offsetHeight,Pe=Math.floor(de),oe=Math.floor(xe);if(Re.current.width!==Pe||Re.current.height!==oe||Re.current.offsetWidth!==Te||Re.current.offsetHeight!==Le){var ke={width:Pe,height:oe,offsetWidth:Te,offsetHeight:Le};Re.current=ke;var De=Te===Math.round(de)?de:Te,Ce=Le===Math.round(xe)?xe:Le,Ge=Object(H.a)(Object(H.a)({},ke),{},{offsetWidth:De,offsetHeight:Ce});J==null||J(Ge,Ae,ne),X&&Promise.resolve().then(function(){X(Ge,Ae)})}},[]);return I.useEffect(function(){var Ae=Object(d.a)(ge.current)||Object(d.a)(ee.current);return Ae&&!pe&&i(Ae,_e),function(){return t(Ae,_e)}},[ge.current,pe]),I.createElement(_,{ref:ee},Me?I.cloneElement(ce,{ref:Fe}):ce)}var b="rc-observer-key";function m(he){var ce=he.children,pe=Object(e.a)(ce);return pe.map(function(ge,ee){var J=(ge==null?void 0:ge.key)||"".concat(b,"-").concat(ee);return I.createElement(x,Object(te.a)({},he,{key:J}),ge)})}m.Collection=v;var s=m,g=K("bT9E"),h=K("TSYQ"),T=K.n(h),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
`,w=["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"],P={},L;function S(he){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=he.getAttribute("id")||he.getAttribute("data-reactid")||he.getAttribute("name");if(ce&&P[pe])return P[pe];var ge=window.getComputedStyle(he),ee=ge.getPropertyValue("box-sizing")||ge.getPropertyValue("-moz-box-sizing")||ge.getPropertyValue("-webkit-box-sizing"),J=parseFloat(ge.getPropertyValue("padding-bottom"))+parseFloat(ge.getPropertyValue("padding-top")),Re=parseFloat(ge.getPropertyValue("border-bottom-width"))+parseFloat(ge.getPropertyValue("border-top-width")),Me=w.map(function(Fe){return"".concat(Fe,":").concat(ge.getPropertyValue(Fe))}).join(";"),Ie={sizingStyle:Me,paddingSize:J,borderSize:Re,boxSizing:ee};return ce&&pe&&(P[pe]=Ie),Ie}function D(he){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ge=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;L||(L=document.createElement("textarea"),L.setAttribute("tab-index","-1"),L.setAttribute("aria-hidden","true"),document.body.appendChild(L)),he.getAttribute("wrap")?L.setAttribute("wrap",he.getAttribute("wrap")):L.removeAttribute("wrap");var ee=S(he,ce),J=ee.paddingSize,Re=ee.borderSize,Me=ee.boxSizing,Ie=ee.sizingStyle;L.setAttribute("style","".concat(Ie,";").concat(y)),L.value=he.value||he.placeholder||"";var Fe=Number.MIN_SAFE_INTEGER,He=Number.MAX_SAFE_INTEGER,_e=L.scrollHeight,Ae;if(Me==="border-box"?_e+=Re:Me==="content-box"&&(_e-=J),pe!==null||ge!==null){L.value=" ";var Se=L.scrollHeight-J;pe!==null&&(Fe=Se*pe,Me==="border-box"&&(Fe=Fe+J+Re),_e=Math.max(Fe,_e)),ge!==null&&(He=Se*ge,Me==="border-box"&&(He=He+J+Re),Ae=_e>He?"":"hidden",_e=Math.min(He,_e))}return{height:_e,minHeight:Fe,maxHeight:He,overflowY:Ae,resize:"none"}}var F=K("Gytx"),O=K.n(F),W;(function(he){he[he.NONE=0]="NONE",he[he.RESIZING=1]="RESIZING",he[he.RESIZED=2]="RESIZED"})(W||(W={}));var z=function(he){Object(B.a)(pe,he);var ce=Object(C.a)(pe);function pe(ge){var ee;return Object(j.a)(this,pe),ee=ce.call(this,ge),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(J){ee.textArea=J},ee.handleResize=function(J){var Re=ee.state.resizeStatus,Me=ee.props,Ie=Me.autoSize,Fe=Me.onResize;if(Re!==W.NONE)return;typeof Fe=="function"&&Fe(J),Ie&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var J=ee.props.autoSize;if(!J||!ee.textArea)return;var Re=J.minRows,Me=J.maxRows,Ie=D(ee.textArea,!1,Re,Me);ee.setState({textareaStyles:Ie,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:W.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:W.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var J=ee.props,Re=J.prefixCls,Me=Re===void 0?"rc-textarea":Re,Ie=J.autoSize,Fe=J.onResize,He=J.className,_e=J.disabled,Ae=ee.state,Se=Ae.textareaStyles,X=Ae.resizeStatus,ne=Object(g.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ue=T()(Me,He,Object(U.a)({},"".concat(Me,"-disabled"),_e));"value"in ne&&(ne.value=ne.value||"");var de=Object(H.a)(Object(H.a)(Object(H.a)({},ee.props.style),Se),X===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(s,{onResize:ee.handleResize,disabled:!(Ie||Fe)},I.createElement("textarea",Object(te.a)({},ne,{className:ue,style:de,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:W.NONE},ee}return Object(A.a)(pe,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!O()(ee.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 ee=this.textArea.selectionStart,J=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,J)}}catch(Re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),pe}(I.Component),Q=z,q=function(he){Object(B.a)(pe,he);var ce=Object(C.a)(pe);function pe(ge){var ee;Object(j.a)(this,pe),ee=ce.call(this,ge),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(Re){ee.resizableTextArea=Re},ee.handleChange=function(Re){var Me=ee.props.onChange;ee.setValue(Re.target.value,function(){ee.resizableTextArea.resizeTextarea()}),Me&&Me(Re)},ee.handleKeyDown=function(Re){var Me=ee.props,Ie=Me.onPressEnter,Fe=Me.onKeyDown;Re.keyCode===13&&Ie&&Ie(Re),Fe&&Fe(Re)};var J=typeof ge.value=="undefined"||ge.value===null?ge.defaultValue:ge.value;return ee.state={value:J},ee}return Object(A.a)(pe,[{key:"setValue",value:function(ee,J){"value"in this.props||this.setState({value:ee},J)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(Q,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),pe}(I.Component),me=le.default=q},ZW9T:function(Ze,le,K){"use strict";K.d(le,"a",function(){return F});var te=K("k1fw"),j=K("oBTY"),A=K("miYZ"),B=K("tsqr"),C=K("rAM+"),I=K("tJVT"),H=K("PpiC"),U=K("q1tI"),e=K.n(U),R=K("bdgK"),p=K("9og8"),d=K("WmNS"),l=K.n(d),n={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"]},o={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"]},u={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},a={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(`
`)}]},r=K("5VLF"),i=K.n(r),t={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"]}},_=function(W,z){return z.map(function(Q){return{label:Q,kind:W.languages.CompletionItemKind.Keyword,insertText:Q}})},f=function(W){return Object.keys(t.tables).map(function(z){return{label:z,kind:W.languages.CompletionItemKind.Variable,insertText:z}})},v=function(W,z){var Q=t.tables[W];return Q?Q.map(function(q){return{label:q,kind:z.languages.CompletionItemKind.Field,insertText:q}}):[]};function x(O,W,z,Q,q){var me=W.getWordUntilPosition(z),he={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:me.startColumn,endColumn:me.endColumn},ce=Q.map(function(pe){return{label:pe,kind:O.languages.CompletionItemKind.Keyword,insertText:pe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}});return q.map(function(pe){ce.push(Object(te.a)(Object(te.a)({},pe),{},{range:he}))}),ce}var b=function(O){t.languages.map(function(q){return O.languages.registerDocumentFormattingEditProvider(q,{provideDocumentFormattingEdits:function(he,ce,pe){return Object(p.a)(l.a.mark(function ge(){var ee;return l.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return ee=i()(he.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}),Re.abrupt("return",[{range:he.getFullModelRange(),text:ee}]);case 2:case"end":return Re.stop()}},ge)}))()}}),q});var W=u.quickKey.map(function(q){return{label:q.label,kind:O.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=a.quickKey.map(function(q){return{label:q.label,kind:O.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=o.quickKey.map(function(q){return{label:q.label,kind:O.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(me,he){var ce=me.getWordUntilPosition(he),pe={startLineNumber:he.lineNumber,endLineNumber:he.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},ge=me.getLineContent(he.lineNumber).substring(ce.startColumn-2,ce.endColumn);return{suggestions:[].concat(Object(j.a)(u.keywords.map(function(ee){return{label:ee,kind:O.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(j.a)(u.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Function,documentation:ee.content,insertText:ge.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(me,he){var ce=me.getWordUntilPosition(he),pe={startLineNumber:he.lineNumber,endLineNumber:he.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn};return{suggestions:Object(j.a)(n.keywords.map(function(ge){return{label:ge,kind:O.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(me,he){var ce=me.getWordUntilPosition(he),pe={startLineNumber:he.lineNumber,endLineNumber:he.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},ge=me.getLineContent(he.lineNumber).substring(ce.startColumn-2,ce.endColumn);return{suggestions:[].concat(Object(j.a)(o.keywords.map(function(ee){return{label:ee,kind:O.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(j.a)(o.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Function,documentation:ee.content,insertText:ge.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(me,he){var ce=me.getWordUntilPosition(he),pe={startLineNumber:he.lineNumber,endLineNumber:he.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},ge=me.getLineContent(he.lineNumber).substring(ce.startColumn-2,ce.endColumn);return{suggestions:[].concat(Object(j.a)(a.keywords.map(function(ee){return{label:ee,kind:O.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(j.a)(a.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Function,documentation:ee.content,insertText:ge.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",s=K("fjLI"),g=K("LvDl"),h=K("+ua5");function T(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function y(){}var w=!1,P={"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 L(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=O;if(Array.isArray(O)){for(var z=0;z<O.length;z++){var Q=P[O[z]];if(Q)return Q}return W[0]}return P[W]||W}var S=null,D=le.b=function(O){var W=O.width,z=W===void 0?"100%":W,Q=O.height,q=Q===void 0?"100%":Q,me=O.value,he=O.language,ce=he===void 0?"javascript":he,pe=O.style,ge=pe===void 0?{}:pe,ee=O.options,J=ee===void 0?{}:ee,Re=O.overrideServices,Me=Re===void 0?{}:Re,Ie=O.theme,Fe=Ie===void 0?"vs-dark":Ie,He=O.onEditBlur,_e=O.onSave,Ae=O.autoHeight,Se=Ae===void 0?!1:Ae,X=O.forbidCopy,ne=X===void 0?!1:X,ue=O.onChange,de=ue===void 0?y:ue,xe=O.editorDidMount,Te=xe===void 0?y:xe,Le=O.onFocus,Pe=Le===void 0?y:Le,oe=O.filename,ke=oe===void 0?"educoder.txt":oe,De=O.errorLine,Ce=O.errorContent,Ge=Ce===void 0?"":Ce,Be=Object(H.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ve=Object(U.useRef)(),be=Object(U.useRef)({}),se=Object(U.useRef)(),re=Object(U.useRef)(),ae=Object(U.useRef)(!1),V=Object(U.useRef)(),Y=Object(U.useState)(!1),$=Object(I.a)(Y,2),Z=$[0],fe=$[1];function ye(){var Je;return ve.current&&(Je=new R.default(function(Ke){var Qe=Object(C.a)(Ke),tt;try{for(Qe.s();!(tt=Qe.n()).done;){var vt=tt.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&be.current.instance.layout()}}catch(st){Qe.e(st)}finally{Qe.f()}}),Je.observe(ve.current)),Je}function Oe(){B.b.warn(decodeURIComponent(m))}var Ue=function(){var Ke=be.current.instance;if(me!=null&&Ke&&Z){var Qe=Ke.getModel();Qe&&me!==Qe.getValue()&&(w=!0,Qe.setValue(me),Ke.layout(),w=!1)}};Object(U.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){Ue()},500)},[me,Z,be.current]),Object(U.useEffect)(function(){if(De&&be.current&&be.current.instance){var Je=be.current.instance;Je.changeViewZones(function(Qe){var tt=document.createElement("div");tt.style.padding="10px 20px",tt.style.width="calc(100% - 20px)",tt.className="my-error-line-wrp",tt.innerHTML=Ge,Qe.addZone({afterLineNumber:De||11,heightInLines:3,domNode:tt})});var Ke={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}};Je.addOverlayWidget(Ke),Je.revealPositionInCenter({lineNumber:20,column:1})}},[De,be.current,Z]);function We(){var Je=be.current.instance;if(Je){var Ke=Je.getSelection(),Qe=be.current.pastePos||{},tt=new S.Range(Qe.startLineNumber||Ke.endLineNumber,Qe.startColumn||Ke.endColumn,Qe.endLineNumber||Ke.endLineNumber,Qe.endColumn||Ke.endColumn);setTimeout(function(){Je.executeEdits("",[{range:tt,text:""}])},300)}}function Ne(Je){(window.navigator.platform.match("Mac")?Je.metaKey:Je.ctrlKey)&&Je.keyCode==83&&(Je.preventDefault(),_e())}var Ve=function(){if(Se&&be.current.instance){var Ke=be.current.instance.getContentHeight();Ye(Ke<q?q:Ke)}else Ye(q)};function qe(Je){var Ke=document.createEvent("MouseEvents");Ke.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Je.dispatchEvent(Ke)}function ze(Je,Ke){var Qe=window.URL||window.webkitURL||window,tt=new Blob([Ke]),vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");vt.href=Qe.createObjectURL(tt),vt.download=Je,qe(vt)}Object(U.useEffect)(function(){Ve()},[Ve]),Object(U.useEffect)(function(){ve.current&&!Z&&Promise.all([K.e(16),K.e(28)]).then(K.t.bind(null,"M/lh",7)).then(function(Je){try{S=Je,be.current.instance=S.editor.create(ve.current,{value:me,language:L(ce),theme:Fe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Me);var Ke=be.current.instance,Qe=s.d._menuItems,tt=Object(j.a)(Qe).find(function(it){return it[0]._debugName=="EditorContext"}),vt=tt[1],st=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],at=function(ft,Et){var ht=ft._first;do{var It,wt,dt=Et.includes((It=ht.element)===null||It===void 0||((wt=It.command)===null||wt===void 0)?void 0:wt.id);dt&&ft._remove(ht)}while(ht=ht.next)};if(Te(Ke,S),setTimeout(function(){Ve(),be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ze(ke||"educoder.txt",Ke.getValue())}}),Ke.getDomNode().addEventListener("input",function(){se.current.autoFormat&&Ke.getAction("editor.action.formatDocument").run()})},500),be.current.subscription=Ke.onDidChangeModelContent(function(it){ae.current?clearTimeout(V.current):(Ve(),de(Ke.getValue(),it)),V.current=setTimeout(function(){ae.current=!1},500)}),window.Monaco||b(S,L(ce)),ne&&(at(vt,st),ve.current.classList.add("noCopyPaste"),Ke.onKeyDown(function(it){var ft=it.keyCode,Et=it.ctrlKey,ht=it.metaKey;(ft===33||ft===52)&&(ht||Et)&&(Oe(),it.preventDefault())})),window.Monaco=S,He&&Ke.onDidBlurEditorWidget(function(){He(Ke.getValue())}),Pe&&Ke.onDidFocusEditorText(function(){Pe(Ke.getValue())}),ne){Ke.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Oe(),null}),Ke.onDidPaste(function(it){be.current.pastePos=it});try{window.addEventListener("paste",We)}catch(it){}}var ot=ye();return fe(!0),function(){var it=be.current.instance;it.dispose();var ft=it.getModel();ft&&ft.dispose(),be.current.subscription&&be.current.subscription.dispose(),ne&&window.removeEventListener("paste",We),ot.unobserve(ve.current)}}catch(it){}})},[]),Object(U.useEffect)(function(){var Je=be.current.instance;if(Je&&Z)return document.addEventListener("keydown",Ne,!1),function(){document.removeEventListener("keydown",Ne)}},[_e,Z]),Object(U.useEffect)(function(){var Je=be.current.instance;if(Je&&Z){var Ke=L(ce);S.editor.setModelLanguage(Je.getModel(),Ke),console.log("language:",ce,Je.getModel(),Ke)}},[ce,Z]),Object(U.useEffect)(function(){var Je=be.current.instance;Je&&Z&&S.editor.setTheme(Fe)},[Fe,Z]),Object(U.useEffect)(function(){var Je=be.current.instance;se.current=J,Je&&Z&&(Je.updateOptions(Object(te.a)({},J)),setTimeout(function(){Je.getModel().updateOptions(Object(te.a)({},J))},200))},[JSON.stringify(J),Z]),Object(U.useEffect)(function(){var Je=be.current.instance;Je&&Z&&Je.layout()},[z,q,Z]);var rt=Object(U.useState)(T(z)),lt=Object(I.a)(rt,2),ct=lt[0],et=lt[1],ut=Object(U.useState)(T(q)),gt=Object(I.a)(ut,2),Lt=gt[0],Ye=gt[1],xt=Object(te.a)(Object(te.a)({},ge),{},{width:ct,height:Lt});return e.a.createElement("div",{className:"my-monaco-editor",ref:ve,style:xt})};function F(O){var W=O.width,z=W===void 0?"100%":W,Q=O.height,q=Q===void 0?"100%":Q,me=O.original,he=O.modified,ce=O.language,pe=O.options,ge=pe===void 0?{}:pe,ee=Object(U.useRef)(),J=Object(U.useState)(null),Re=Object(I.a)(J,2),Me=Re[0],Ie=Re[1];function Fe(Se){var X;return ee.current&&(X=new R.default(function(ne){var ue=Object(C.a)(ne),de;try{for(ue.s();!(de=ue.n()).done;){var xe=de.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&Se.layout()}}catch(Te){ue.e(Te)}finally{ue.f()}}),X.observe(ee.current)),X}Object(U.useEffect)(function(){ee.current&&Promise.all([K.e(16),K.e(28)]).then(K.t.bind(null,"M/lh",7)).then(function(Se){S=Se;var X=S.editor.createDiffEditor(ee.current,Object(te.a)(Object(te.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},ge),{},{wordWrap:!0}));Ie(X);var ne=Fe(X);return function(){X.dispose();var ue=X.getModel();ue&&ue.dispose(),ne.unobserve(ee.current)}})},[]),Object(U.useEffect)(function(){Me&&Me.setModel({original:S.editor.createModel(me,ce),modified:S.editor.createModel(he,ce)})},[me,he,ce,Me]);var He=T(z),_e=T(q),Ae={width:He,height:_e};return e.a.createElement("div",{className:"my-diff-editor",ref:ee,style:Ae})}},ZpRC:function(Ze,le,K){"use strict";function te(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function j(p,d){return(!d||p!=="hidden")&&p!=="visible"&&p!=="clip"}function A(p,d){if(p.clientHeight<p.scrollHeight||p.clientWidth<p.scrollWidth){var l=getComputedStyle(p,null);return j(l.overflowY,d)||j(l.overflowX,d)||function(n){var o=function(u){if(!u.ownerDocument||!u.ownerDocument.defaultView)return null;try{return u.ownerDocument.defaultView.frameElement}catch(a){return null}}(n);return!!o&&(o.clientHeight<n.scrollHeight||o.clientWidth<n.scrollWidth)}(p)}return!1}function B(p,d,l,n,o,u,a,r){return u<p&&a>d||u>p&&a<d?0:u<=p&&r<=l||a>=d&&r>=l?u-p-n:a>d&&r<l||u<p&&r>l?a-d+o:0}var C=function(p,d){var l=window,n=d.scrollMode,o=d.block,u=d.inline,a=d.boundary,r=d.skipOverflowHiddenElements,i=typeof a=="function"?a:function(Se){return Se!==a};if(!te(p))throw new TypeError("Invalid target");for(var t=document.scrollingElement||document.documentElement,_=[],f=p;te(f)&&i(f);){if((f=f.parentElement)===t){_.push(f);break}f!=null&&f===document.body&&A(f)&&!A(document.documentElement)||f!=null&&A(f,r)&&_.push(f)}for(var v=l.visualViewport?l.visualViewport.width:innerWidth,x=l.visualViewport?l.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,s=p.getBoundingClientRect(),g=s.height,h=s.width,T=s.top,y=s.right,w=s.bottom,P=s.left,L=o==="start"||o==="nearest"?T:o==="end"?w:T+g/2,S=u==="center"?P+h/2:u==="end"?y:P,D=[],F=0;F<_.length;F++){var O=_[F],W=O.getBoundingClientRect(),z=W.height,Q=W.width,q=W.top,me=W.right,he=W.bottom,ce=W.left;if(n==="if-needed"&&T>=0&&P>=0&&w<=x&&y<=v&&T>=q&&w<=he&&P>=ce&&y<=me)return D;var pe=getComputedStyle(O),ge=parseInt(pe.borderLeftWidth,10),ee=parseInt(pe.borderTopWidth,10),J=parseInt(pe.borderRightWidth,10),Re=parseInt(pe.borderBottomWidth,10),Me=0,Ie=0,Fe="offsetWidth"in O?O.offsetWidth-O.clientWidth-ge-J:0,He="offsetHeight"in O?O.offsetHeight-O.clientHeight-ee-Re:0;if(t===O)Me=o==="start"?L:o==="end"?L-x:o==="nearest"?B(m,m+x,x,ee,Re,m+L,m+L+g,g):L-x/2,Ie=u==="start"?S:u==="center"?S-v/2:u==="end"?S-v:B(b,b+v,v,ge,J,b+S,b+S+h,h),Me=Math.max(0,Me+m),Ie=Math.max(0,Ie+b);else{Me=o==="start"?L-q-ee:o==="end"?L-he+Re+He:o==="nearest"?B(q,he,z,ee,Re+He,L,L+g,g):L-(q+z/2)+He/2,Ie=u==="start"?S-ce-ge:u==="center"?S-(ce+Q/2)+Fe/2:u==="end"?S-me+J+Fe:B(ce,me,Q,ge,J+Fe,S,S+h,h);var _e=O.scrollLeft,Ae=O.scrollTop;L+=Ae-(Me=Math.max(0,Math.min(Ae+Me,O.scrollHeight-z+He))),S+=_e-(Ie=Math.max(0,Math.min(_e+Ie,O.scrollWidth-Q+Fe)))}D.push({el:O,top:Me,left:Ie})}return D};function I(p){return p===Object(p)&&Object.keys(p).length!==0}function H(p,d){d===void 0&&(d="auto");var l="scrollBehavior"in document.body.style;p.forEach(function(n){var o=n.el,u=n.top,a=n.left;o.scroll&&l?o.scroll({top:u,left:a,behavior:d}):(o.scrollTop=u,o.scrollLeft=a)})}function U(p){return p===!1?{block:"end",inline:"nearest"}:I(p)?p:{block:"start",inline:"nearest"}}function e(p,d){var l=!p.ownerDocument.documentElement.contains(p);if(I(d)&&typeof d.behavior=="function")return d.behavior(l?[]:C(p,d));if(l)return;var n=U(d);return H(C(p,n),n.behavior)}var R=le.a=e},bT9E:function(Ze,le,K){"use strict";K.d(le,"a",function(){return j});var te=K("VTBJ");function j(A,B){var C=Object(te.a)({},A);return Array.isArray(B)&&B.forEach(function(I){delete C[I]}),C}},fjLI:function(Ze,le,K){"use strict";K.d(le,"f",function(){return l}),K.d(le,"b",function(){return n}),K.d(le,"a",function(){return o}),K.d(le,"d",function(){return u}),K.d(le,"e",function(){return a}),K.d(le,"c",function(){return r});var te=K("8HAY"),j=K("Vhoy"),A=K("MI8n"),B=K("JYp7"),C=K("pmY6"),I=K("24hK"),H=K("nnTU"),U=K("T8No"),e=K("Cg/j"),R=K("t9D7"),p=function(i,t,_,f){var v=arguments.length,x=v<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,_):f,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(i,t,_,f);else for(var m=i.length-1;m>=0;m--)(b=i[m])&&(x=(v<3?b(x):v>3?b(t,_,x):b(t,_))||x);return v>3&&x&&Object.defineProperty(t,_,x),x},d=function(i,t){return function(_,f){t(_,f,i)}};function l(i){return i.command!==void 0}class n{constructor(i){this.id=n._idPool++,this._debugName=i}}n._idPool=0,n.CommandPalette=new n("CommandPalette"),n.EditorContext=new n("EditorContext"),n.SimpleEditorContext=new n("SimpleEditorContext"),n.EditorContextCopy=new n("EditorContextCopy"),n.EditorContextPeek=new n("EditorContextPeek"),n.MenubarEditMenu=new n("MenubarEditMenu"),n.MenubarCopy=new n("MenubarCopy"),n.MenubarGoMenu=new n("MenubarGoMenu"),n.MenubarSelectionMenu=new n("MenubarSelectionMenu"),n.InlineCompletionsActions=new n("InlineCompletionsActions");const o=Object(e.c)("menuService"),u=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new A.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===n.CommandPalette}}addCommand(i){return this.addCommands(B.a.single(i))}addCommands(i){for(const t of i)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(C.i)(()=>{let t=!1;for(const _ of i)t=this._commands.delete(_.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((t,_)=>i.set(_,t)),i}appendMenuItem(i,t){return this.appendMenuItems(B.a.single({id:i,item:t}))}appendMenuItems(i){const t=new Set,_=new I.a;for(const{id:f,item:v}of i){let x=this._menuItems.get(f);x||(x=new I.a,this._menuItems.set(f,x)),_.push(x.push(v)),t.add(f)}return this._onDidChangeMenu.fire(t),Object(C.i)(()=>{if(_.size>0){for(let f of _)f();this._onDidChangeMenu.fire(t),_.clear()}})}getMenuItems(i){let t;return this._menuItems.has(i)?t=[...this._menuItems.get(i)]:t=[],i===n.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(i){const t=new Set;for(const _ of i)l(_)&&(t.add(_.command.id),_.alt&&t.add(_.alt.id));this._commands.forEach((_,f)=>{t.has(f)||i.push({command:_})})}};class a extends te.e{constructor(i,t,_,f){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=t,this._contextKeyService=_,this._options=f}get actions(){const i=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),_=t.getActions(this._options);t.dispose();for(const[,f]of _)f.length>0&&(i.push(...f),i.push(new te.d));return i.length&&i.pop(),i}}let r=class i{constructor(t,_,f,v,x){var b,m;if(this._commandService=x,this.id=t.id,this.label=(f==null?void 0:f.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(m=typeof t.tooltip=="string"?t.tooltip:(b=t.tooltip)===null||b===void 0?void 0:b.value)!==null&&m!==void 0?m:"",this.enabled=!t.precondition||v.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const s=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=v.contextMatchesRules(s.condition),this.checked&&s.tooltip&&(this.tooltip=typeof s.tooltip=="string"?s.tooltip:s.tooltip.value),s.title&&(this.label=typeof s.title=="string"?s.title:s.title.value)}this.item=t,this.alt=_?new i(_,void 0,f,v,x):void 0,this._options=f,R.d.isThemeIcon(t.icon)&&(this.class=j.a.asClassName(t.icon))}dispose(){}run(...t){var _,f;let v=[];return((_=this._options)===null||_===void 0?void 0:_.arg)&&(v=[...v,this._options.arg]),((f=this._options)===null||f===void 0?void 0:f.shouldForwardArgs)&&(v=[...v,...t]),this._commandService.executeCommand(this.id,...v)}};r=p([d(3,U.b),d(4,H.b)],r)},ic2d:function(Ze,le,K){"use strict";K.d(le,"a",function(){return B});var te=K("FWmy"),j=K("746U");class A{constructor(){this.data=new Map}add(C,I){te.a(j.l(C)),te.a(j.k(I)),te.a(!this.data.has(C),"There is already an extension with this id"),this.data.set(C,I)}as(C){return this.data.get(C)||null}}const B=new A},nEHx:function(Ze,le,K){"use strict";K.d(le,"a",function(){return te});var te;(function(j){j.DARK="dark",j.LIGHT="light",j.HIGH_CONTRAST="hc"})(te||(te={}))},nnTU:function(Ze,le,K){"use strict";K.d(le,"b",function(){return H}),K.d(le,"a",function(){return U});var te=K("MI8n"),j=K("JYp7"),A=K("pmY6"),B=K("24hK"),C=K("746U"),I=K("Cg/j");const H=Object(I.c)("commandService"),U=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,R){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!R)throw new Error("invalid command");return this.registerCommand({id:e,handler:R})}if(e.description){const o=[];for(let a of e.description.args)o.push(a.constraint);const u=e.handler;e.handler=function(a,...r){return Object(C.o)(r,o),u(a,...r)}}const{id:p}=e;let d=this._commands.get(p);d||(d=new B.a,this._commands.set(p,d));let l=d.unshift(e),n=Object(A.i)(()=>{l();const o=this._commands.get(p);(o==null?void 0:o.isEmpty())&&this._commands.delete(p)});return this._onDidRegisterCommand.fire(p),n}registerCommandAlias(e,R){return U.registerCommand(e,(p,...d)=>p.get(H).executeCommand(R,...d))}getCommand(e){const R=this._commands.get(e);return!R||R.isEmpty()?void 0:j.a.first(R)}getCommands(){const e=new Map;for(const R of this._commands.keys()){const p=this.getCommand(R);p&&e.set(R,p)}return e}};U.registerCommand("noop",()=>{})},otbz:function(Ze,le,K){Ze.exports={flex_box_center:"flex_box_center___3WVQg",flex_space_between:"flex_space_between___qOmUA",flex_box_vertical_center:"flex_box_vertical_center___3Tvh1",flex_box_center_end:"flex_box_center_end___vdEZx",flex_box_column:"flex_box_column___1y_IJ",wrap:"wrap___ciPTn",modal:"modal___2lr4h",titleWrap:"titleWrap___2Szy4",required:"required___2OpIu",title:"title___hZmu6",colorGray:"colorGray___32oND",choiceWrap:"choiceWrap___24IrF",answer:"answer___3w_7N",activeAnswer:"activeAnswer___f89lY",deleteIcon:"deleteIcon___qd0T4",addIcon:"addIcon___GQKIw",editorWrap:"editorWrap___iuxhH",htmlWrap:"htmlWrap___17kgS",radio:"radio___3IfyE",color333:"color333___1rjEP",color999:"color999___25PqS",questionType:"questionType___3G5uc",questionChoices:"questionChoices___GBK2t"}},p5ED:function(Ze,le,K){"use strict";var te=K("+L6B"),j=K("2/Rp"),A=K("5Dmo"),B=K("3S7+"),C=K("k1fw"),I=K("9og8"),H=K("tJVT"),U=K("WmNS"),e=K.n(U),R=K("q1tI"),p=K.n(R),d=K("vHTk"),l=K.n(d),n=K("yEEn"),o=K("ZW9T"),u=K("1vsH"),a=K("V0Rq"),r=K("m3rI");le.a=function(i){var t,_,f,v,x,b,m,s=i.editOffice,g=s===void 0?"view":s,h=i.data,T=i.theme,y=i.type,w=i.filename,P=i.monacoEditor,L=i.className,S=i.style,D=i.close,F=i.onClose,O=i.hasMask,W=i.disabledDownload,z=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Q=Object(H.a)(z,2),q=Q[0],me=Q[1],he=Object(R.useState)(""),ce=Object(H.a)(he,2),pe=ce[0],ge=ce[1],ee=Object(R.useState)(),J=Object(H.a)(ee,2),Re=J[0],Me=J[1],Ie=window.ENV==="build"?"/react/build":"",Fe=r.a.PROXY_SERVER||location.origin,He,_e=1024*1024,Ae=10*_e,Se=Object(R.useRef)();(t=h)!==null&&t!==void 0&&t.startsWith("/api")&&y!=="txt"&&(h=r.a.API_SERVER+h),y==="office"&&(He=Object(u.T)(h).filesize,He>Ae&&(y="other")),w&&P&&(P.filename=w),Object(R.useEffect)(function(){var de,xe,Te=(de=document.cookie)===null||de===void 0||((xe=de.replace(/\s/g,""))===null||xe===void 0)?void 0:xe.split(";");Te==null||Te.map(function(Le){var Pe=Le.split("=");Pe[0]==="_educoder_session"&&ge(Pe[1])})},[]),Object(R.useEffect)(function(){y==="office"&&X()},[y,h]);var X=function(){var de=Object(I.a)(e.a.mark(function xe(){var Te,Le,Pe;return e.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return console.log("data:",h),Te=h,h.startsWith("http")||(Te=location.origin+Te),Le=new URL(Te).pathname.split("/").pop(),ke.next=6,Object(a.W)({attachment_id:Le});case 6:Pe=ke.sent,Me(Pe);case 8:case"end":return ke.stop()}},xe)}));return function(){return de.apply(this,arguments)}}(),ne=function(){if(h.startsWith("http")||h.startsWith("blob:")){ue();return}Object(u.z)(w||"educoder",h,w)},ue=function(){Object(u.x)(w||"educoder",decodeURIComponent(h))};return p.a.createElement("div",{style:Object(C.a)({},S||{}),className:"".concat(O&&l.a.bgBlack," ").concat(y?l.a.wrp:"hide")},D&&p.a.createElement("div",{className:l.a.close,ref:Se},!W&&p.a.createElement(B.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Se.current}},p.a.createElement("span",{onClick:ue},p.a.createElement("i",{className:"icon-quxiaozhiding"}))),p.a.createElement(B.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Se.current}},p.a.createElement("span",{className:"",onClick:F},p.a.createElement("i",{className:"icon-guanbi1"})))),p.a.createElement("div",{className:"".concat(l.a[L]," ").concat(L," ").concat(l.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&p.a.createElement(o.b,P)),y==="audio"&&p.a.createElement("audio",{src:"".concat(((_=h)===null||_===void 0?void 0:_.indexOf("http://"))>-1||((f=h)===null||f===void 0?void 0:f.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),y==="video"&&p.a.createElement(p.a.Fragment,null,((v=h)===null||v===void 0?void 0:v.indexOf("http"))>-1?p.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):p.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),y==="office"&&Re&&p.a.createElement("iframe",{src:"".concat(Ie,"/office.html?key=").concat(Re.key,"&url=").concat(Fe+Re.url,"&callbackUrl=").concat(Fe+Re.callbackUrl,"&fileType=").concat(Re.fileType,"&title=").concat(Re.title,"&model=").concat(g,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),y==="html"&&p.a.createElement("iframe",{src:h+"&disposition=inline"}),y==="pdf"&&p.a.createElement("iframe",{src:"".concat(Ie,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!W)}),y==="image"&&p.a.createElement("img",{src:"".concat(((x=h)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((b=h)===null||b===void 0?void 0:b.indexOf("https://"))>-1||(m=h)!==null&&m!==void 0&&m.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),y==="other"&&p.a.createElement("div",null,p.a.createElement(j.a,{type:"primary",size:"large",onClick:ne},p.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&p.a.createElement(j.a,{type:"primary",size:"large",onClick:ne},p.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Ze,le,K){"use strict";K.d(le,"h",function(){return R}),K.d(le,"g",function(){return d}),K.d(le,"f",function(){return l}),K.d(le,"e",function(){return n}),K.d(le,"i",function(){return o}),K.d(le,"b",function(){return u}),K.d(le,"a",function(){return a}),K.d(le,"d",function(){return r}),K.d(le,"c",function(){return i});var te=K("C/vA"),j=K("JYp7");const A=!1;let B=null;function C(t){B=t}if(A){const t="__is_disposable_tracked__";C(new class{trackDisposable(_){const f=new Error("Potentially leaked disposable").stack;setTimeout(()=>{_[t]||console.log(f)},3e3)}setParent(_,f){if(_&&_!==a.None)try{_[t]=!0}catch(v){}}markAsDisposed(_){if(_&&_!==a.None)try{_[t]=!0}catch(f){}}markAsSingleton(_){}})}function I(t){return B==null||B.trackDisposable(t),t}function H(t){B==null||B.markAsDisposed(t)}function U(t,_){B==null||B.setParent(t,_)}function e(t,_){if(!B)return;for(const f of t)B.setParent(f,_)}function R(t){return B==null||B.markAsSingleton(t),t}class p extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function d(t){return typeof t.dispose=="function"&&t.dispose.length===0}function l(t){if(j.a.is(t)){let _=[];for(const f of t)if(f)try{f.dispose()}catch(v){_.push(v)}if(_.length===1)throw _[0];if(_.length>1)throw new p(_);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function n(...t){const _=o(()=>l(t));return e(t,_),_}function o(t){const _=I({dispose:Object(te.a)(()=>{H(_),t()})});return _}class u{constructor(){this._toDispose=new Set,this._isDisposed=!1,I(this)}dispose(){if(this._isDisposed)return;H(this),this._isDisposed=!0,this.clear()}clear(){try{l(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return U(t,this),this._isDisposed?u.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(t),t}}u.DISABLE_DISPOSED_WARNING=!1;class a{constructor(){this._store=new u,I(this),U(this._store,this)}dispose(){H(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}a.None=Object.freeze({dispose(){}});class r{constructor(){this._isDisposed=!1,I(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var _;if(this._isDisposed||t===this._value)return;(_=this._value)===null||_===void 0||_.dispose(),t&&U(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,H(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&U(t,null),t}}class i{constructor(t){this.object=t}dispose(){}}},psGv:function(Ze,le,K){var te,j;(function(){var A;(function(){"use strict";var H=[,,function(p){function d(o){this.__parent=o,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=[]}d.prototype.clone_empty=function(){var o=new d(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},d.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},d.prototype.has_match=function(o){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(o))return!0;return!1},d.prototype.set_indent=function(o,u){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(o){this.__items.push(o);var u=o.lastIndexOf(`
`);u!==-1?this.__character_count=o.length-u:this.__character_count+=o.length},d.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function l(o,u){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),u=u||"",o.indent_level>0&&(u=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}l.prototype.get_indent_size=function(o,u){var a=this.__base_string_length;return u=u||0,o<0&&(a=0),a+=o*this.__indent_size,a+=u,a},l.prototype.get_indent_string=function(o,u){var a=this.__base_string;return u=u||0,o<0&&(o=0,a=""),u+=o*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},l.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var o=this.__cache.length,u=0,a="";this.__indent_size&&o>=this.__indent_size&&(u=Math.floor(o/this.__indent_size),o-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),o&&(a+=new Array(o+1).join(" ")),this.__cache.push(a)};function n(o,u){this.__indent_cache=new l(o,u),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(o,u){return this.__indent_cache.get_indent_string(o,u)},n.prototype.get_indent_size=function(o,u){return this.__indent_cache.get_indent_size(o,u)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(o){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 a=this.__lines.join(`
`);return o!==`
`&&(a=a.replace(/[\n]/g,o)),a},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(o,u){return o=o||0,u=u||0,this.next_line.set_indent(o,u),this.__lines.length>1?(this.current_line.set_indent(o,u),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(o){for(var u=0;u<o.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(o){for(var u=this.__lines.length;o<u;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(o,u){for(var a=this.__lines.length-2;a>=0;){var r=this.__lines[a];if(r.is_empty())break;if(r.item(0).indexOf(o)!==0&&r.item(-1)!==u){this.__lines.splice(a+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},p.exports.Output=n},function(p){function d(l,n,o,u){this.type=l,this.text=n,this.comments_before=null,this.newlines=o||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=d},,,function(p){function d(o,u){this.raw_options=l(o,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"])}d.prototype._get_array=function(o,u){var a=this.raw_options[o],r=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(r=a.concat()):typeof a=="string"&&(r=a.split(/[^a-zA-Z0-9_\/\-]+/)),r},d.prototype._get_boolean=function(o,u){var a=this.raw_options[o],r=a===void 0?!!u:!!a;return r},d.prototype._get_characters=function(o,u){var a=this.raw_options[o],r=u||"";return typeof a=="string"&&(r=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},d.prototype._get_number=function(o,u){var a=this.raw_options[o];u=parseInt(u,10),isNaN(u)&&(u=0);var r=parseInt(a,10);return isNaN(r)&&(r=u),r},d.prototype._get_selection=function(o,u,a){var r=this._get_selection_list(o,u,a);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[o]+"'");return r[0]},d.prototype._get_selection_list=function(o,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var r=this._get_array(o,a);if(!this._is_valid_selection(r,u))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[o]+"'");return r},d.prototype._is_valid_selection=function(o,u){return o.length&&u.length&&!o.some(function(a){return u.indexOf(a)===-1})};function l(o,u){var a={};o=n(o);var r;for(r in o)r!==u&&(a[r]=o[r]);if(u&&o[u])for(r in o[u])a[r]=o[u][r];return a}function n(o){var u={},a;for(a in o){var r=a.replace(/-/g,"_");u[r]=o[a]}return u}p.exports.Options=d,p.exports.normalizeOpts=n,p.exports.mergeOpts=l},,function(p){var d=RegExp.prototype.hasOwnProperty("sticky");function l(n){this.__input=n||"",this.__input_length=this.__input.length,this.__position=0}l.prototype.restart=function(){this.__position=0},l.prototype.back=function(){this.__position>0&&(this.__position-=1)},l.prototype.hasNext=function(){return this.__position<this.__input_length},l.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__input.charAt(this.__position),this.__position+=1),n},l.prototype.peek=function(n){var o=null;return n=n||0,n+=this.__position,n>=0&&n<this.__input_length&&(o=this.__input.charAt(n)),o},l.prototype.__match=function(n,o){n.lastIndex=o;var u=n.exec(this.__input);return u&&!(d&&n.sticky)&&(u.index!==o&&(u=null)),u},l.prototype.test=function(n,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(n,o):!1},l.prototype.testChar=function(n,o){var u=this.peek(o);return n.lastIndex=0,u!==null&&n.test(u)},l.prototype.match=function(n){var o=this.__match(n,this.__position);return o?this.__position+=o[0].length:o=null,o},l.prototype.read=function(n,o,u){var a="",r;return n&&(r=this.match(n),r&&(a+=r[0])),o&&(r||!n)&&(a+=this.readUntil(o,u)),a},l.prototype.readUntil=function(n,o){var u="",a=this.__position;n.lastIndex=this.__position;var r=n.exec(this.__input);return r?(a=r.index,o&&(a+=r[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},l.prototype.readUntilAfter=function(n){return this.readUntil(n,!0)},l.prototype.get_regexp=function(n,o){var u=null,a="g";return o&&d&&(a="y"),typeof n=="string"&&n!==""?u=new RegExp(n,a):n&&(u=new RegExp(n.source,a)),u},l.prototype.get_literal_regexp=function(n){return RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(n){var o=this.__position,u=this.readUntilAfter(n);return this.__position=o,u},l.prototype.lookBack=function(n){var o=this.__position-1;return o>=n.length&&this.__input.substring(o-n.length,o).toLowerCase()===n},p.exports.InputScanner=l},function(p,d,l){var n=l(8).InputScanner,o=l(3).Token,u=l(10).TokenStream,a=l(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,_){this._input=new n(t),this._options=_||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var t,_=new o(r.START,""),f=null,v=[],x=new u;_.type!==r.EOF;){for(t=this._get_next_token(_,f);this._is_comment(t);)x.add(t),t=this._get_next_token(_,f);x.isEmpty()||(t.comments_before=x,x=new u),t.parent=f,this._is_opening(t)?(v.push(f),f=t):f&&this._is_closing(t,f)&&(t.opened=f,f.closed=t,f=v.pop(),t.parent=f),t.previous=_,_.next=t,this.__tokens.add(t),_=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,_){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(r.RAW,f):this._create_token(r.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,_){return!1},i.prototype._create_token=function(t,_){var f=new o(t,_,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=i,p.exports.TOKEN=r},function(p){function d(l){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=l}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__tokens[this.__position],this.__position+=1),l},d.prototype.peek=function(l){var n=null;return l=l||0,l+=this.__position,l>=0&&l<this.__tokens_length&&(n=this.__tokens[l]),n},d.prototype.add=function(l){this.__parent_token&&(l.parent=this.__parent_token),this.__tokens.push(l),this.__tokens_length+=1},p.exports.TokenStream=d},function(p,d,l){var n=l(12).Pattern;function o(u,a){n.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new n,o.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},o.prototype.matching=function(u,a){var r=this._create();return r.__set_whitespace_patterns(u,a),r._update(),r},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(u,a){u.lastIndex=0;for(var r=0,i=[],t=u.exec(a);t;)i.push(a.substring(r,t.index)),r=t.index+t[0].length,t=u.exec(a);return r<a.length?i.push(a.substring(r,a.length)):i.push(""),i},p.exports.WhitespacePattern=o},function(p){function d(l,n){this._input=l,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,n&&(this._starting_pattern=this._input.get_regexp(n._starting_pattern,!0),this._match_pattern=this._input.get_regexp(n._match_pattern,!0),this._until_pattern=this._input.get_regexp(n._until_pattern),this._until_after=n._until_after)}d.prototype.read=function(){var l=this._input.read(this._starting_pattern);return(!this._starting_pattern||l)&&(l+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),l},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(l){var n=this._create();return n._until_after=!0,n._until_pattern=this._input.get_regexp(l),n._update(),n},d.prototype.until=function(l){var n=this._create();return n._until_after=!1,n._until_pattern=this._input.get_regexp(l),n._update(),n},d.prototype.starting_with=function(l){var n=this._create();return n._starting_pattern=this._input.get_regexp(l,!0),n._update(),n},d.prototype.matching=function(l){var n=this._create();return n._match_pattern=this._input.get_regexp(l,!0),n._update(),n},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},p.exports.Pattern=d},function(p){function d(l,n){l=typeof l=="string"?l:l.source,n=typeof n=="string"?n:n.source,this.__directives_block_pattern=new RegExp(l+/ beautify( \w+[:]\w+)+ /.source+n,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(l+/\sbeautify\signore:end\s/.source+n,"g")}d.prototype.get_directives=function(l){if(!l.match(this.__directives_block_pattern))return null;var n={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(l);o;)n[o[1]]=o[2],o=this.__directive_pattern.exec(l);return n},d.prototype.readIgnored=function(l){return l.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=d},function(p,d,l){var n=l(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,r){n.call(this,a,r),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new n(a);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new n,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var r=this._create();return r._disabled[a]=!0,r._update(),r},u.prototype.read_options=function(a){var r=this._create();for(var i in o)r._disabled[i]=a.templating.indexOf(i)===-1;return r._update(),r},u.prototype.exclude=function(a){var r=this._create();return r._excluded[a]=!0,r._update(),r},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),a+=r,r=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",r=this._input.peek();if(r==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(a=a||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},p.exports.TemplatablePattern=u},,,,function(p,d,l){var n=l(19).Beautifier,o=l(20).Options;function u(a,r,i,t){var _=new n(a,r,i,t);return _.beautify()}p.exports=u,p.exports.defaultOptions=function(){return new o}},function(p,d,l){var n=l(20).Options,o=l(2).Output,u=l(21).Tokenizer,a=l(21).TOKEN,r=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=function(T,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new o(T,y)};t.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},t.prototype.set_space_before_token=function(T,y){this._output.space_before_token=T,this._output.non_breaking_space=y},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},t.prototype.print_preserved_newlines=function(T){var y=0;T.type!==a.TEXT&&T.previous.type!==a.TEXT&&(y=T.newlines?1:0),this.preserve_newlines&&(y=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var w=0;w<y;w++)this.print_newline(w>0);return y!==0},t.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(T){this._output.add_new_line(T)},t.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var _=function(T){for(var y=null,w=T.next;w.type!==a.EOF&&T.closed!==w;){if(w.type===a.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===a.EQUALS&&w.next.next&&w.next.next.type===a.VALUE&&(y=w.next.next.text);break}w=w.next}return y},f=function(T,y){var w=null,P=null;return y.closed?(T==="script"?w="text/javascript":T==="style"&&(w="text/css"),w=_(y)||w,w.search("text/css")>-1?P="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":w.search(/test\/null/)>-1&&(P="null"),P):null};function v(T,y){return y.indexOf(T)!==-1}function x(T,y,w){this.parent=T||null,this.tag=y?y.tag_name:"",this.indent_level=w||0,this.parser_token=y||null}function b(T){this._printer=T,this._current_frame=null}b.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},b.prototype.record_tag=function(T){var y=new x(this._current_frame,T,this._printer.indent_level);this._current_frame=y},b.prototype._try_pop_frame=function(T){var y=null;return T&&(y=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),y},b.prototype._get_frame=function(T,y){for(var w=this._current_frame;w&&!(T.indexOf(w.tag)!==-1);){if(y&&y.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},b.prototype.try_pop=function(T,y){var w=this._get_frame([T],y);return this._try_pop_frame(w)},b.prototype.indent_to_tag=function(T){var y=this._get_frame(T);y&&(this._printer.indent_level=y.indent_level)};function m(T,y,w,P){this._source_text=T||"",y=y||{},this._js_beautify=w,this._css_beautify=P,this._tag_stack=null;var L=new n(y,"html");this._options=L,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"}m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,T&&r.test(T)&&(y=T.match(r)[0])),T=T.replace(i,`
`);var w=T.match(/^[\t ]*/)[0],P={text:"",type:""},L=new s,S=new t(this._options,w),D=new u(T,this._options).tokenize();this._tag_stack=new b(S);for(var F=null,O=D.next();O.type!==a.EOF;)O.type===a.TAG_OPEN||O.type===a.COMMENT?(F=this._handle_tag_open(S,O,L,P),L=F):O.type===a.ATTRIBUTE||O.type===a.EQUALS||O.type===a.VALUE||O.type===a.TEXT&&!L.tag_complete?F=this._handle_inside_tag(S,O,L,D):O.type===a.TAG_CLOSE?F=this._handle_tag_close(S,O,L):O.type===a.TEXT?F=this._handle_text(S,O,L):S.add_raw_token(O),P=F,O=D.next();var W=S._output.get_code(y);return W},m.prototype._handle_tag_close=function(T,y,w){var P={text:y.text,type:y.type};return T.alignment_size=0,w.tag_complete=!0,T.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),w.is_unformatted?T.add_raw_token(y):(w.tag_start_char==="<"&&(T.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(y)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(T.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&T.set_wrap_point(),P},m.prototype._handle_inside_tag=function(T,y,w,P){var L=w.has_wrapped_attrs,S={text:y.text,type:y.type};if(T.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),w.is_unformatted)T.add_raw_token(y);else if(w.tag_start_char==="{"&&y.type===a.TEXT)T.print_preserved_newlines(y)?(y.newlines=0,T.add_raw_token(y)):T.print_token(y);else{if(y.type===a.ATTRIBUTE?(T.set_space_before_token(!0),w.attr_count+=1):(y.type===a.EQUALS||y.type===a.VALUE&&y.previous.type===a.EQUALS)&&T.set_space_before_token(!1),y.type===a.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(y),L=L||y.newlines!==0),this._is_wrap_attributes_force)){var D=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var F=!0,O=0,W;do{if(W=P.peek(O),W.type===a.ATTRIBUTE){F=!1;break}O+=1}while(O<4&&W.type!==a.EOF&&W.type!==a.TAG_CLOSE);D=!F}D&&(T.print_newline(!1),L=!0)}T.print_token(y),L=L||T.previous_token_wrapped(),w.has_wrapped_attrs=L}return S},m.prototype._handle_text=function(T,y,w){var P={text:y.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(T,y,w):w.is_unformatted||w.is_content_unformatted?T.add_raw_token(y):(T.traverse_whitespace(y),T.print_token(y)),P},m.prototype._print_custom_beatifier_text=function(T,y,w){var P=this;if(y.text!==""){var L=y.text,S,D=1,F="",O="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:w.custom_beautifier_name==="html"&&(S=function(he,ce){var pe=new m(he,ce,P._js_beautify,P._css_beautify);return pe.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-T.indent_level);var W=T.get_full_indent(D);if(L=L.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&L[0]==="<"&&L.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(L);if(!z){T.add_raw_token(y);return}F=W+z[1]+`
`,L=z[4],z[5]&&(O=W+z[5]),L=L.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(y.whitespace_before=z[0]))}if(L)if(S){var Q=function(){this.eol=`
`};Q.prototype=this._options.raw_options;var q=new Q;L=S(W+L,q)}else{var me=y.whitespace_before;me&&(L=L.replace(new RegExp(`
(`+me+")?","g"),`
`)),L=W+L.replace(/\n/g,`
`+W)}F&&(L?L=F+L+`
`+O:L=F+O),T.print_newline(!1),L&&(y.text=L,y.whitespace_before="",y.newlines=0,T.add_raw_token(y),T.print_newline(!0))}},m.prototype._handle_tag_open=function(T,y,w,P){var L=this._get_tag_open_token(y);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&y.type===a.TAG_OPEN&&y.text.indexOf("</")===0?(T.add_raw_token(y),L.start_tag_token=this._tag_stack.try_pop(L.tag_name)):(T.traverse_whitespace(y),this._set_tag_position(T,y,L,w,P),L.is_inline_element||T.set_wrap_point(),T.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(L.alignment_size=y.text.length+1),!L.tag_complete&&!L.is_unformatted&&(T.alignment_size=L.alignment_size),L};var s=function(T,y){if(this.parent=T||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var w;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(w=y.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[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===a.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 P=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(P=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(P)))}};m.prototype._get_tag_open_token=function(T){var y=new s(this._tag_stack.get_parser_token(),T);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||v(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&&v(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&v(y.tag_check,this._options.content_unformatted),y.is_inline_element=v(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},m.prototype._set_tag_position=function(T,y,w,P,L){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=f(w.tag_check,y)))),v(w.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var S=T.current_line_has_match(/{{#if/);S||T.print_newline(!1)}w.tag_name==="!--"&&L.type===a.TAG_CLOSE&&P.is_end_tag&&w.text.indexOf(`
`)===-1||(w.is_inline_element||w.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,w))}else if(w.is_end_tag){var D=!1;D=w.start_tag_token&&w.start_tag_token.multiline_content,D=D||!w.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(L.type===a.TAG_CLOSE&&w.start_tag_token===P)&&L.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(D=!1),D&&T.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(L.type!=="TK_CONTENT"||w.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,w)},m.prototype._calcluate_parent_multiline=function(T,y){y.parent&&T._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var g=["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"],h=["a","audio","del","ins","map","noscript","video"];m.prototype._do_optional_end_element=function(T){var y=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(T.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&g.indexOf(T.tag_name)!==-1){var w=T.parent.parent;(!w||h.indexOf(w.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.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"])):T.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"])):(T.tag_name==="th"||T.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 T.parent=this._tag_stack.get_parser_token(),y},p.exports.Beautifier=m},function(p,d,l){var n=l(6).Options;function o(u){n.call(this,u,"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"])}o.prototype=new n,p.exports.Options=o},function(p,d,l){var n=l(9).Tokenizer,o=l(9).TOKEN,u=l(13).Directives,a=l(14).TemplatablePattern,r=l(12).Pattern,i={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:o.START,RAW:o.RAW,EOF:o.EOF},t=new u(/<\!--/,/-->/),_=function(f,v){n.call(this,f,v),this._current_tag_name="";var x=new a(this._input).read_options(this._options),b=new r(this._input);if(this.__patterns={word:x.until(/[\n\r\t <]/),single_quote:x.until_after(/'/),double_quote:x.until_after(/"/),attribute:x.until(/[\n\r\t =>]|\/>/),element_name:x.until(/[\n\r\t >\/]/),handlebars_comment:b.starting_with(/{{!--/).until_after(/--}}/),handlebars:b.starting_with(/{{/).until_after(/}}/),handlebars_open:b.until(/[\n\r\t }]/),handlebars_raw_close:b.until(/}}/),comment:b.starting_with(/<!--/).until_after(/-->/),cdata:b.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:b.starting_with(/<!\[/).until_after(/]>/),processing:b.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 m=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=b.matching(m).until_after(m)}};_.prototype=new n,_.prototype._is_comment=function(f){return!1},_.prototype._is_opening=function(f){return f.type===i.TAG_OPEN},_.prototype._is_closing=function(f,v){return f.type===i.TAG_CLOSE&&v&&((f.text===">"||f.text==="/>")&&v.text[0]==="<"||f.text==="}}"&&v.text[0]==="{"&&v.text[1]==="{")},_.prototype._reset=function(){this._current_tag_name=""},_.prototype._get_next_token=function(f,v){var x=null;this._readWhitespace();var b=this._input.peek();return b===null?this._create_token(i.EOF,""):(x=x||this._read_open_handlebars(b,v),x=x||this._read_attribute(b,f,v),x=x||this._read_close(b,v),x=x||this._read_raw_content(b,f,v),x=x||this._read_content_word(b),x=x||this._read_comment_or_cdata(b),x=x||this._read_processing(b),x=x||this._read_open(b,v),x=x||this._create_token(i.UNKNOWN,this._input.next()),x)},_.prototype._read_comment_or_cdata=function(f){var v=null,x=null,b=null;if(f==="<"){var m=this._input.peek(1);m==="!"&&(x=this.__patterns.comment.read(),x?(b=t.get_directives(x),b&&b.ignore==="start"&&(x+=t.readIgnored(this._input))):x=this.__patterns.cdata.read()),x&&(v=this._create_token(i.COMMENT,x),v.directives=b)}return v},_.prototype._read_processing=function(f){var v=null,x=null,b=null;if(f==="<"){var m=this._input.peek(1);(m==="!"||m==="?")&&(x=this.__patterns.conditional_comment.read(),x=x||this.__patterns.processing.read()),x&&(v=this._create_token(i.COMMENT,x),v.directives=b)}return v},_.prototype._read_open=function(f,v){var x=null,b=null;return v||f==="<"&&(x=this._input.next(),this._input.peek()==="/"&&(x+=this._input.next()),x+=this.__patterns.element_name.read(),b=this._create_token(i.TAG_OPEN,x)),b},_.prototype._read_open_handlebars=function(f,v){var x=null,b=null;return v||this._options.indent_handlebars&&f==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(x=this.__patterns.handlebars_comment.read(),x=x||this.__patterns.handlebars.read(),b=this._create_token(i.COMMENT,x)):(x=this.__patterns.handlebars_open.read(),b=this._create_token(i.TAG_OPEN,x))),b},_.prototype._read_close=function(f,v){var x=null,b=null;return v&&(v.text[0]==="<"&&(f===">"||f==="/"&&this._input.peek(1)===">")?(x=this._input.next(),f==="/"&&(x+=this._input.next()),b=this._create_token(i.TAG_CLOSE,x)):v.text[0]==="{"&&f==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),b=this._create_token(i.TAG_CLOSE,"}}"))),b},_.prototype._read_attribute=function(f,v,x){var b=null,m="";if(x&&x.text[0]==="<")if(f==="=")b=this._create_token(i.EQUALS,this._input.next());else if(f==='"'||f==="'"){var s=this._input.next();f==='"'?s+=this.__patterns.double_quote.read():s+=this.__patterns.single_quote.read(),b=this._create_token(i.VALUE,s)}else m=this.__patterns.attribute.read(),m&&(v.type===i.EQUALS?b=this._create_token(i.VALUE,m):b=this._create_token(i.ATTRIBUTE,m));return b},_.prototype._is_content_unformatted=function(f){return this._options.void_elements.indexOf(f)===-1&&(this._options.content_unformatted.indexOf(f)!==-1||this._options.unformatted.indexOf(f)!==-1)},_.prototype._read_raw_content=function(f,v,x){var b="";if(x&&x.text[0]==="{")b=this.__patterns.handlebars_raw_close.read();else if(v.type===i.TAG_CLOSE&&v.opened.text[0]==="<"&&v.text[0]!=="/"){var m=v.opened.text.substr(1).toLowerCase();if(m==="script"||m==="style"){var s=this._read_comment_or_cdata(f);if(s)return s.type=i.TEXT,s;b=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(m)&&(b=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig")))}return b?this._create_token(i.TEXT,b):null},_.prototype._read_content_word=function(f){var v="";if(this._options.unformatted_content_delimiter&&(f===this._options.unformatted_content_delimiter[0]&&(v=this.__patterns.unformatted_content_delimiter.read())),v||(v=this.__patterns.word.read()),v)return this._create_token(i.TEXT,v)},p.exports.Tokenizer=_,p.exports.TOKEN=i}],U={};function e(p){var d=U[p];if(d!==void 0)return d.exports;var l=U[p]={exports:{}};return H[p](l,l.exports,e),l.exports}var R=e(18);A=R})();var B=A;if(!0)!(te=[K,K("6UM0"),K("TXwP")],j=function(H){var U=K("6UM0"),e=K("TXwP");return{html_beautify:function(R,p){return B(R,p,U.js_beautify,e.css_beautify)}}}.apply(le,te),j!==void 0&&(Ze.exports=j));else var C,I})()},"rAM+":function(Ze,le,K){"use strict";K.d(le,"a",function(){return j});var te=K("Qw5x");function j(A,B){var C;if(typeof Symbol=="undefined"||A[Symbol.iterator]==null){if(Array.isArray(A)||(C=Object(te.a)(A))||B&&A&&typeof A.length=="number"){C&&(A=C);var I=0,H=function(){};return{s:H,n:function(){return I>=A.length?{done:!0}:{done:!1,value:A[I++]}},e:function(d){throw d},f: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.`)}var U=!0,e=!1,R;return{s:function(){C=A[Symbol.iterator]()},n:function(){var d=C.next();return U=d.done,d},e:function(d){e=!0,R=d},f:function(){try{!U&&C.return!=null&&C.return()}finally{if(e)throw R}}}}},rUJ1:function(Ze,le){const K=/[&<>"']/,te=/[&<>"']/g,j=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},C=b=>B[b];function I(b,m){if(m){if(K.test(b))return b.replace(te,C)}else if(j.test(b))return b.replace(A,C);return b}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(b){return b.replace(H,(m,s)=>(s=s.toLowerCase(),s==="colon"?":":s.charAt(0)==="#"?s.charAt(1)==="x"?String.fromCharCode(parseInt(s.substring(2),16)):String.fromCharCode(+s.substring(1)):""))}const e=/(^|[^\[])\^/g;function R(b,m){b=b.source||b,m=m||"";const s={replace:(g,h)=>(h=h.source||h,h=h.replace(e,"$1"),b=b.replace(g,h),s),getRegex:()=>new RegExp(b,m)};return s}const p=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l(b,m,s){if(b){let g;try{g=decodeURIComponent(U(s)).replace(p,"").toLowerCase()}catch(h){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}m&&!d.test(s)&&(s=r(m,s));try{s=encodeURI(s).replace(/%25/g,"%")}catch(g){return null}return s}const n={},o=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(b,m){n[" "+b]||(o.test(b)?n[" "+b]=b+"/":n[" "+b]=f(b,"/",!0)),b=n[" "+b];const s=b.indexOf(":")===-1;return m.substring(0,2)==="//"?s?m:b.replace(u,"$1")+m:m.charAt(0)==="/"?s?m:b.replace(a,"$1")+m:b+m}const i={exec:function(){}};function t(b){let m=1,s,g;for(;m<arguments.length;m++){s=arguments[m];for(g in s)Object.prototype.hasOwnProperty.call(s,g)&&(b[g]=s[g])}return b}function _(b,m){const s=b.replace(/\|/g,(T,y,w)=>{let P=!1,L=y;for(;--L>=0&&w[L]==="\\";)P=!P;return P?"|":" |"}),g=s.split(/ \|/);let h=0;if(g.length>m)g.splice(m);else for(;g.length<m;)g.push("");for(;h<g.length;h++)g[h]=g[h].trim().replace(/\\\|/g,"|");return g}function f(b,m,s){const g=b.length;if(g===0)return"";let h=0;for(;h<g;){const T=b.charAt(g-h-1);if(T===m&&!s)h++;else if(T!==m&&s)h++;else break}return b.substr(0,g-h)}function v(b,m){if(b.indexOf(m[1])===-1)return-1;const s=b.length;let g=0,h=0;for(;h<s;h++)if(b[h]==="\\")h++;else if(b[h]===m[0])g++;else if(b[h]===m[1]&&(g--,g<0))return h;return-1}function x(b){b&&b.sanitize&&!b.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Ze.exports={escape:I,unescape:U,edit:R,cleanUrl:l,resolveUrl:r,noopTest:i,merge:t,splitCells:_,rtrim:f,findClosingBracket:v,checkSanitizeDeprecation:x}},t9D7:function(Ze,le,K){"use strict";K.d(le,"b",function(){return H}),K.d(le,"g",function(){return e}),K.d(le,"d",function(){return R}),K.d(le,"e",function(){return p}),K.d(le,"a",function(){return d}),K.d(le,"f",function(){return o}),K.d(le,"c",function(){return u});var te=K("Vhoy"),j=K("MI8n"),A=K("pmY6"),B=K("Cg/j"),C=K("ic2d"),I=K("nEHx");const H=Object(B.c)("themeService");var U;(function(a){function r(i){return i&&typeof i=="object"&&typeof i.id=="string"}a.isThemeColor=r})(U||(U={}));function e(a){return{id:a}}var R;(function(a){function r(x){return x&&typeof x=="object"&&typeof x.id=="string"&&(typeof x.color=="undefined"||U.isThemeColor(x.color))}a.isThemeIcon=r;const i=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function t(x){const b=i.exec(x);if(!b)return;let[,m]=b;return{id:m}}a.fromString=t;function _(x,b){let m=x.id;const s=m.lastIndexOf("~");return s!==-1&&(m=m.substring(0,s)),b&&(m=`${m}~${b}`),{id:m}}a.modify=_;function f(x,b){var m,s;return x.id===b.id&&((m=x.color)===null||m===void 0?void 0:m.id)===((s=b.color)===null||s===void 0?void 0:s.id)}a.isEqual=f;function v(x,b){return{id:x.id,color:b?e(b):void 0}}a.asThemeIcon=v,a.asClassNameArray=te.a.asClassNameArray,a.asClassName=te.a.asClassName,a.asCSSSelector=te.a.asCSSSelector})(R||(R={}));function p(a){switch(a){case I.a.DARK:return"vs-dark";case I.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class l{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new j.b}onColorThemeChange(a){return this.themingParticipants.push(a),this.onThemingParticipantAddedEmitter.fire(a),Object(A.i)(()=>{const r=this.themingParticipants.indexOf(a);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let n=new l;C.a.add(d.ThemingContribution,n);function o(a){return n.onColorThemeChange(a)}class u extends A.a{constructor(a){super();this.themeService=a,this.theme=a.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(r=>this.onThemeChange(r)))}onThemeChange(a){this.theme=a,this.updateStyles()}updateStyles(){}}},ulZh:function(Ze,le,K){typeof window!="undefined"&&function(j,A){Ze.exports=A()}(this,function(){return function(te){var j={};function A(B){if(j[B])return j[B].exports;var C=j[B]={i:B,l:!1,exports:{}};return te[B].call(C.exports,C,C.exports,A),C.l=!0,C.exports}return A.m=te,A.c=j,A.d=function(B,C,I){A.o(B,C)||Object.defineProperty(B,C,{enumerable:!0,get:I})},A.r=function(B){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})},A.t=function(B,C){if(C&1&&(B=A(B)),C&8)return B;if(C&4&&typeof B=="object"&&B&&B.__esModule)return B;var I=Object.create(null);if(A.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:B}),C&2&&typeof B!="string")for(var H in B)A.d(I,H,function(U){return B[U]}.bind(null,H));return I},A.n=function(B){var C=B&&B.__esModule?function(){return B.default}:function(){return B};return A.d(C,"a",C),C},A.o=function(B,C){return Object.prototype.hasOwnProperty.call(B,C)},A.p="/dist/",A(A.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,j,A){"use strict";var B=Object.prototype.hasOwnProperty,C="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(C=!1));function H(p,d,l){this.fn=p,this.context=d,this.once=l||!1}function U(p,d,l,n,o){if(typeof l!="function")throw new TypeError("The listener must be a function");var u=new H(l,n||p,o),a=C?C+d:d;return p._events[a]?p._events[a].fn?p._events[a]=[p._events[a],u]:p._events[a].push(u):(p._events[a]=u,p._eventsCount++),p}function e(p,d){--p._eventsCount===0?p._events=new I:delete p._events[d]}function R(){this._events=new I,this._eventsCount=0}R.prototype.eventNames=function(){var d=[],l,n;if(this._eventsCount===0)return d;for(n in l=this._events)B.call(l,n)&&d.push(C?n.slice(1):n);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(l)):d},R.prototype.listeners=function(d){var l=C?C+d:d,n=this._events[l];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,u=n.length,a=new Array(u);o<u;o++)a[o]=n[o].fn;return a},R.prototype.listenerCount=function(d){var l=C?C+d:d,n=this._events[l];return n?n.fn?1:n.length:0},R.prototype.emit=function(d,l,n,o,u,a){var r=C?C+d:d;if(!this._events[r])return!1;var i=this._events[r],t=arguments.length,_,f;if(i.fn){i.once&&this.removeListener(d,i.fn,void 0,!0);switch(t){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,l),!0;case 3:return i.fn.call(i.context,l,n),!0;case 4:return i.fn.call(i.context,l,n,o),!0;case 5:return i.fn.call(i.context,l,n,o,u),!0;case 6:return i.fn.call(i.context,l,n,o,u,a),!0}for(f=1,_=new Array(t-1);f<t;f++)_[f-1]=arguments[f];i.fn.apply(i.context,_)}else{var v=i.length,x;for(f=0;f<v;f++){i[f].once&&this.removeListener(d,i[f].fn,void 0,!0);switch(t){case 1:i[f].fn.call(i[f].context);break;case 2:i[f].fn.call(i[f].context,l);break;case 3:i[f].fn.call(i[f].context,l,n);break;case 4:i[f].fn.call(i[f].context,l,n,o);break;default:if(!_)for(x=1,_=new Array(t-1);x<t;x++)_[x-1]=arguments[x];i[f].fn.apply(i[f].context,_)}}}return!0},R.prototype.on=function(d,l,n){return U(this,d,l,n,!1)},R.prototype.once=function(d,l,n){return U(this,d,l,n,!0)},R.prototype.removeListener=function(d,l,n,o){var u=C?C+d:d;if(!this._events[u])return this;if(!l)return e(this,u),this;var a=this._events[u];if(a.fn)a.fn===l&&(!o||a.once)&&(!n||a.context===n)&&e(this,u);else{for(var r=0,i=[],t=a.length;r<t;r++)(a[r].fn!==l||o&&!a[r].once||n&&a[r].context!==n)&&i.push(a[r]);i.length?this._events[u]=i.length===1?i[0]:i:e(this,u)}return this},R.prototype.removeAllListeners=function(d){var l;return d?(l=C?C+d:d,this._events[l]&&e(this,l)):(this._events=new I,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=C,R.EventEmitter=R,te.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,j,A){(function(B){var C=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,I=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(R,p,d){if(d=d||{},R=R.trim(),p=p.trim(),!p){if(!d.alwaysNormalize)return R;var l=e.parseURL(R);if(!l)throw new Error("Error trying to parse base URL.");return l.path=e.normalizePath(l.path),e.buildURLFromParts(l)}var n=e.parseURL(p);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return d.alwaysNormalize?(n.path=e.normalizePath(n.path),e.buildURLFromParts(n)):p;var o=e.parseURL(R);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var u=I.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var a={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(a.netLoc=o.netLoc,n.path[0]!=="/"))if(!n.path)a.path=o.path,n.params||(a.params=o.params,n.query||(a.query=o.query));else{var r=o.path,i=r.substring(0,r.lastIndexOf("/")+1)+n.path;a.path=e.normalizePath(i)}return a.path===null&&(a.path=d.alwaysNormalize?e.normalizePath(n.path):n.path),e.buildURLFromParts(a)},parseURL:function(R){var p=C.exec(R);return p?{scheme:p[1]||"",netLoc:p[2]||"",path:p[3]||"",params:p[4]||"",query:p[5]||"",fragment:p[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(H,"");R.length!==(R=R.replace(U,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};te.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(te,j,A){function B(d){var l={};function n(u){if(l[u])return l[u].exports;var a=l[u]={i:u,l:!1,exports:{}};return d[u].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=d,n.c=l,n.i=function(u){return u},n.d=function(u,a,r){n.o(u,a)||Object.defineProperty(u,a,{configurable:!1,enumerable:!0,get:r})},n.r=function(u){Object.defineProperty(u,"__esModule",{value:!0})},n.n=function(u){var a=u&&u.__esModule?function(){return u.default}:function(){return u};return n.d(a,"a",a),a},n.o=function(u,a){return Object.prototype.hasOwnProperty.call(u,a)},n.p="/",n.oe=function(u){throw console.error(u),u};var o=n(n.s=ENTRY_MODULE);return o.default||o}var C="[\\.|\\-|\\+|\\w|/|@]+",I="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+C+").*?\\)";function H(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(d){return!isNaN(1*d)}function e(d,l,n){var o={};o[n]=[];var u=l.toString(),a=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return o;for(var r=a[1],i=new RegExp("(\\\\n|\\W)"+H(r)+I,"g"),t;t=i.exec(u);){if(t[3]==="dll-reference")continue;o[n].push(t[3])}for(i=new RegExp("\\("+H(r)+'\\("(dll-reference\\s('+C+'))"\\)\\)'+I,"g");t=i.exec(u);)d[t[2]]||(o[n].push(t[1]),d[t[2]]=A(t[1]).m),o[t[2]]=o[t[2]]||[],o[t[2]].push(t[4]);for(var _=Object.keys(o),f=0;f<_.length;f++)for(var v=0;v<o[_[f]].length;v++)U(o[_[f]][v])&&(o[_[f]][v]=1*o[_[f]][v]);return o}function R(d){var l=Object.keys(d);return l.reduce(function(n,o){return n||d[o].length>0},!1)}function p(d,l){for(var n={main:[l]},o={main:[]},u={main:{}};R(n);)for(var a=Object.keys(n),r=0;r<a.length;r++){var i=a[r],t=n[i],_=t.pop();if(u[i]=u[i]||{},u[i][_]||!d[i][_])continue;u[i][_]=!0,o[i]=o[i]||[],o[i].push(_);for(var f=e(d,d[i][_],i),v=Object.keys(f),x=0;x<v.length;x++)n[v[x]]=n[v[x]]||[],n[v[x]]=n[v[x]].concat(f[v[x]])}return o}te.exports=function(d,l){l=l||{};var n={main:A.m},o=l.all?{main:Object.keys(n.main)}:p(n,d),u="";Object.keys(o).filter(function(_){return _!=="main"}).forEach(function(_){for(var f=0;o[_][f];)f++;o[_].push(f),n[_][f]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+"var "+_+" = ("+B.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o[_].map(function(v){return""+JSON.stringify(v)+": "+n[_][v].toString()}).join(",")+`});
`}),u=u+"new (("+B.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+o.main.map(function(_){return""+JSON.stringify(_)+": "+n.main[_].toString()}).join(",")+"}))(self);";var a=new window.Blob([u],{type:"text/javascript"});if(l.bare)return a;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,i=r.createObjectURL(a),t=new window.Worker(i);return t.objectURL=i,t}},"./src/config.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"hlsDefaultConfig",function(){return x}),A.d(j,"mergeConfig",function(){return m}),A.d(j,"enableStreamingMode",function(){return s});var B=A("./src/controller/abr-controller.ts"),C=A("./src/controller/audio-stream-controller.ts"),I=A("./src/controller/audio-track-controller.ts"),H=A("./src/controller/subtitle-stream-controller.ts"),U=A("./src/controller/subtitle-track-controller.ts"),e=A("./src/controller/buffer-controller.ts"),R=A("./src/controller/timeline-controller.ts"),p=A("./src/controller/cap-level-controller.ts"),d=A("./src/controller/fps-controller.ts"),l=A("./src/controller/eme-controller.ts"),n=A("./src/controller/cmcd-controller.ts"),o=A("./src/utils/xhr-loader.ts"),u=A("./src/utils/fetch-loader.ts"),a=A("./src/utils/cues.ts"),r=A("./src/utils/mediakeys-helper.ts"),i=A("./src/utils/logger.ts");function t(){return t=Object.assign||function(g){for(var h=1;h<arguments.length;h++){var T=arguments[h];for(var y in T)Object.prototype.hasOwnProperty.call(T,y)&&(g[y]=T[y])}return g},t.apply(this,arguments)}function _(g,h){var T=Object.keys(g);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);h&&(y=y.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),T.push.apply(T,y)}return T}function f(g){for(var h=1;h<arguments.length;h++){var T=arguments[h]!=null?arguments[h]:{};h%2?_(Object(T),!0).forEach(function(y){v(g,y,T[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(T)):_(Object(T)).forEach(function(y){Object.defineProperty(g,y,Object.getOwnPropertyDescriptor(T,y))})}return g}function v(g,h,T){return h in g?Object.defineProperty(g,h,{value:T,enumerable:!0,configurable:!0,writable:!0}):g[h]=T,g}var x=f(f({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:B.default,bufferController:e.default,capLevelController:p.default,fpsController:d.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},b()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:U.default,timelineController:R.TimelineController,audioStreamController:C.default,audioTrackController:I.default,emeController:l.default,cmcdController:n.default});function b(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function m(g,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},g,h)}function s(g){var h=g.loader;if(h!==u.default&&h!==o.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var T=Object(u.fetchSupported)();T&&(g.loader=u.default,g.progressive=!0,g.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/polyfills/number.ts"),C=A("./src/utils/ewma-bandwidth-estimator.ts"),I=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/errors.ts"),e=A("./src/types/loader.ts"),R=A("./src/utils/logger.ts");function p(n,o){for(var u=0;u<o.length;u++){var a=o[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function d(n,o,u){return o&&p(n.prototype,o),u&&p(n,u),n}var l=function(){function n(u){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=u;var a=u.config;this.bwEstimator=new C.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var o=n.prototype;return o.registerListeners=function(){var a=this.hls;a.on(I.Events.FRAG_LOADING,this.onFragLoading,this),a.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(I.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var a=this.hls;a.off(I.Events.FRAG_LOADING,this.onFragLoading,this),a.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(I.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(a,r){var i=r.frag;if(i.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=i,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(a,r){var i=this.hls.config;r.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var a=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.autoLevelEnabled,_=i.config,f=i.media;if(!a||!f)return;var v=r?r.stats:a.stats,x=r?r.duration:a.duration;if(v.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||f.paused||!f.playbackRate||!f.readyState)return;var b=performance.now()-v.loading.start,m=Math.abs(f.playbackRate);if(b<=500*x/m)return;var s=i.levels,g=i.minAutoLevel,h=s[a.level],T=v.total||Math.max(v.loaded,Math.round(x*h.maxBitrate/8)),y=Math.max(1,v.bwEstimate?v.bwEstimate/8:v.loaded*1e3/b),w=(T-v.loaded)/y,P=f.currentTime,L=(H.BufferHelper.bufferInfo(f,P,_.maxBufferHole).end-P)/m;if(L>=2*x/m||w<=L)return;var S=Number.POSITIVE_INFINITY,D;for(D=a.level-1;D>g;D--){var F=s[D].maxBitrate;if(S=x*F/(8*.8*y),S<L)break}if(S>=w)return;var O=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+a.sn+(r?" part "+r.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+D+`
Current BW estimate: `+(Object(B.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+w.toFixed(3)+` s
Estimated load time for the next fragment: `+S.toFixed(3)+` s
Time to underbuffer: `+L.toFixed(3)+" s"),i.nextLoadLevel=D,this.bwEstimator.sample(b,v.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),i.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:r,stats:v})},o.onFragLoaded=function(a,r){var i=r.frag,t=r.part;if(i.type===e.PlaylistLevelType.MAIN&&Object(B.isFiniteNumber)(i.sn)){var _=t?t.stats:i.stats,f=t?t.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var v=this.hls.levels[i.level],x=(v.loaded?v.loaded.bytes:0)+_.loaded,b=(v.loaded?v.loaded.duration:0)+f;v.loaded={bytes:x,duration:b},v.realBitrate=Math.round(8*x/b)}if(i.bitrateTest){var m={stats:_,frag:i,part:t,id:i.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,m),i.bitrateTest=!1}}},o.onFragBuffered=function(a,r){var i=r.frag,t=r.part,_=t?t.stats:i.stats;if(_.aborted)return;if(i.type!==e.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var f=_.parsing.end-_.loading.start;this.bwEstimator.sample(f,_.loaded),_.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=f/1e3:this.bitrateTestDelay=0},o.onError=function(a,r){switch(r.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var a=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.maxAutoLevel,_=i.config,f=i.minAutoLevel,v=i.media,x=r?r.duration:a?a.duration:0,b=v?v.currentTime:0,m=v&&v.playbackRate!==0?Math.abs(v.playbackRate):1,s=this.bwEstimator?this.bwEstimator.getEstimate():_.abrEwmaDefaultEstimate,g=(H.BufferHelper.bufferInfo(v,b,_.maxBufferHole).end-b)/m,h=this.findBestLevel(s,f,t,g,_.abrBandWidthFactor,_.abrBandWidthUpFactor);if(h>=0)return h;R.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=x?Math.min(x,_.maxStarvationDelay):_.maxStarvationDelay,y=_.abrBandWidthFactor,w=_.abrBandWidthUpFactor;if(!g){var P=this.bitrateTestDelay;if(P){var L=x?Math.min(x,_.maxLoadingDelay):_.maxLoadingDelay;T=L-P,R.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),y=w=1}}return h=this.findBestLevel(s,f,t,g+T,y,w),Math.max(h,0)},o.findBestLevel=function(a,r,i,t,_,f){for(var v,x=this.fragCurrent,b=this.partCurrent,m=this.lastLoadedFragLevel,s=this.hls.levels,g=s[m],h=!!(g!=null&&(v=g.details)!==null&&v!==void 0&&v.live),T=g==null?void 0:g.codecSet,y=b?b.duration:x?x.duration:0,w=i;w>=r;w--){var P=s[w];if(!P||T&&P.codecSet!==T)continue;var L=P.details,S=(b?L==null?void 0:L.partTarget:L==null?void 0:L.averagetargetduration)||y,D=void 0;w<=m?D=_*a:D=f*a;var F=s[w].maxBitrate,O=F*S/D;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(D)+"/"+F+"/"+S+"/"+t+"/"+O),D>F&&(!O||h&&!this.bitrateTestDelay||O<t))return w}return-1},d(n,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,r=this.bwEstimator;if(a!==-1&&(!r||!r.canEstimate()))return a;var i=this.getNextABRAutoLevel();return a!==-1&&(i=Math.min(a,i)),i},set:function(a){this._nextAutoLevel=a}}]),n}();j.default=l},"./src/controller/audio-stream-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/polyfills/number.ts"),C=A("./src/controller/base-stream-controller.ts"),I=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/controller/fragment-tracker.ts"),e=A("./src/types/level.ts"),R=A("./src/types/loader.ts"),p=A("./src/loader/fragment.ts"),d=A("./src/demux/chunk-cache.ts"),l=A("./src/demux/transmuxer-interface.ts"),n=A("./src/types/transmuxer.ts"),o=A("./src/controller/fragment-finders.ts"),u=A("./src/utils/discontinuities.ts"),a=A("./src/errors.ts"),r=A("./src/utils/logger.ts");function i(){return i=Object.assign||function(x){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var s in m)Object.prototype.hasOwnProperty.call(m,s)&&(x[s]=m[s])}return x},i.apply(this,arguments)}function t(x,b){x.prototype=Object.create(b.prototype),x.prototype.constructor=x,_(x,b)}function _(x,b){return _=Object.setPrototypeOf||function(s,g){return s.__proto__=g,s},_(x,b)}var f=100,v=function(x){t(b,x);function b(s,g){var h;return h=x.call(this,s,g,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var m=b.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var g=this.hls;g.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(I.Events.ERROR,this.onError,this),g.on(I.Events.BUFFER_RESET,this.onBufferReset,this),g.on(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var g=this.hls;g.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(I.Events.ERROR,this.onError,this),g.off(I.Events.BUFFER_RESET,this.onBufferReset,this),g.off(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(g,h){var T=h.frag,y=h.id,w=h.initPTS;if(y==="main"){var P=T.cc;this.initPTS[T.cc]=w,this.log("InitPTS for cc: "+P+" found from main: "+w),this.videoTrackCC=P,this.state===C.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=C.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(f),this.fragLoadError=0,h>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=C.State.IDLE):(this.loadedmetadata=!1,this.state=C.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},m.doTick=function(){switch(this.state){case C.State.IDLE:this.doTickIdle();break;case C.State.WAITING_TRACK:{var g,h=this.levels,T=this.trackId,y=h==null||((g=h[T])===null||g===void 0)?void 0:g.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=C.State.WAITING_INIT_PTS}break}case C.State.FRAG_LOADING_WAITING_RETRY:{var w,P=performance.now(),L=this.retryDate;(!L||P>=L||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=C.State.IDLE);break}case C.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var D=S.frag,F=S.part,O=S.cache,W=S.complete;if(this.initPTS[D.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=C.State.FRAG_LOADING;var z=O.flush(),Q={frag:D,part:F,payload:z,networkDetails:null};this._handleFragmentLoadProgress(Q),W&&x.prototype._handleFragmentLoadComplete.call(this,Q)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+D.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var q=this.getLoadPosition(),me=H.BufferHelper.bufferInfo(this.mediaBuffer,q,this.config.maxBufferHole),he=Object(o.fragmentWithinToleranceTest)(me.end,this.config.maxFragLookUpTolerance,D);he<0&&(r.logger.log("Waiting fragment cc ("+D.cc+") @ "+D.start+" cancelled because another fragment at "+me.end+" is needed"),this.clearWaitingFragment())}}else this.state=C.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=C.State.IDLE)},m.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:g,T=h.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},m.doTickIdle=function(){var g,h,T=this.hls,y=this.levels,w=this.media,P=this.trackId,L=T.config;if(!y||!y[P])return;if(!w&&(this.startFragRequested||!L.startFragPrefetch))return;var S=y[P],D=S.details;if(!D||D.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(D)){this.state=C.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(F===null)return;var O=F.len,W=this.getMaxBufferLength(),z=this.audioSwitch;if(O>=W&&!z)return;if(!z&&this._streamEnded(F,D)){T.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=C.State.ENDED;return}var Q=D.fragments,q=Q[0].start,me=F.end;if(z){var he=this.getLoadPosition();me=he,D.PTSKnown&&he<q&&((F.end>q||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=q+.05))}var ce=this.getNextFragment(me,D);if(!ce){this.bufferFlushed=!0;return}((g=ce.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((h=ce.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(ce,D):this.loadFragment(ce,D,me)},m.getMaxBufferLength=function(){var g=x.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return h===null?g:Math.max(g,h.len)},m.onMediaDetaching=function(){this.videoBuffer=null,x.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(g,h){var T=h.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(y){return new e.Level(y)})},m.onAudioTrackSwitching=function(g,h){var T=!!h.url;this.trackId=h.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(f):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=C.State.IDLE):this.state=C.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(g,h){this.mainDetails=h.details},m.onAudioTrackLoaded=function(g,h){var T,y=this.levels,w=h.details,P=h.id;if(!y){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var L=y[P],S=0;if(w.live||(T=L.details)!==null&&T!==void 0&&T.live){var D=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!D)return;!L.details&&w.hasProgramDateTime&&D.hasProgramDateTime?(Object(u.alignMediaPlaylistByPDT)(w,D),S=w.fragments[0].start):S=this.alignPlaylists(w,L.details)}L.details=w,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(L.details,S),this.state===C.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=C.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(g){var h,T=g.frag,y=g.part,w=g.payload,P=this.config,L=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var D=S[L];console.assert(D,"Audio track is defined on fragment load progress");var F=D.details;console.assert(F,"Audio track details are defined on fragment load progress");var O=P.defaultAudioCodec||D.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new l.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[T.cc],Q=(h=T.initSegment)===null||h===void 0?void 0:h.data;if(z!==void 0){var q=!1,me=y?y.index:-1,he=me!==-1,ce=new n.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,w.byteLength,me,he);W.push(w,Q,O,"",T,y,F.totalduration,q,ce,z)}else{r.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+L);var pe=this.waitingData=this.waitingData||{frag:T,part:y,cache:new d.default,complete:!1},ge=pe.cache;ge.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=C.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}x.prototype._handleFragmentLoadComplete.call(this,g)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(g,h){var T=h.tracks.audio;T&&(this.mediaBuffer=T.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},m.onFragBuffered=function(g,h){var T=h.frag,y=h.part;if(T.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(y?" p: "+y.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,y)},m.onError=function(g,h){switch(h.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,h);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==C.State.ERROR&&this.state!==C.State.STOPPED&&(this.state=h.fatal?C.State.ERROR:C.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===C.State.PARSING||this.state===C.State.PARSED)){var T=!0,y=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);y&&y.len>.5&&(T=!this.reduceMaxBufferLength(y.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(g,h){var T=h.type;T===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(g){var h,T="audio",y=this.hls,w=g.remuxResult,P=g.chunkMeta,L=this.getCurrentContext(P);if(!L){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var S=L.frag,D=L.part,F=w.audio,O=w.text,W=w.id3,z=w.initSegment;if(this.fragContextChanged(S))return;if(this.state=C.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,S,P),y.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:T,tracks:z.tracks})),F){var Q=F.startPTS,q=F.endPTS,me=F.startDTS,he=F.endDTS;D&&(D.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:Q,endPTS:q,startDTS:me,endDTS:he}),S.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,Q,q,me,he),this.bufferFragmentData(F,S,D,P)}if(W!=null&&(h=W.samples)!==null&&h!==void 0&&h.length){var ce=i({frag:S,id:T},W);y.trigger(I.Events.FRAG_PARSING_METADATA,ce)}if(O){var pe=i({frag:S,id:T},O);y.trigger(I.Events.FRAG_PARSING_USERDATA,pe)}},m._bufferInitSegment=function(g,h,T){if(this.state!==C.State.PARSING)return;g.video&&delete g.video;var y=g.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(I.Events.BUFFER_CODECS,g);var w=y.initSegment;if(w!=null&&w.byteLength){var P={type:"audio",frag:h,part:null,chunkMeta:T,parent:h.type,data:w};this.hls.trigger(I.Events.BUFFER_APPENDING,P)}this.tick()},m.loadFragment=function(g,h,T){var y=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||y===U.FragmentState.NOT_LOADED||y===U.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):h.live&&!Object(B.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=C.State.WAITING_INIT_PTS):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,g,h,T)))},m.completeAudioSwitch=function(){var g=this.hls,h=this.media,T=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:T})},b}(C.default);j.default=v},"./src/controller/audio-track-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts"),C=A("./src/errors.ts"),I=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function U(l,n){for(var o=0;o<n.length;o++){var u=n[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}function e(l,n,o){return n&&U(l.prototype,n),o&&U(l,o),l}function R(l,n){l.prototype=Object.create(n.prototype),l.prototype.constructor=l,p(l,n)}function p(l,n){return p=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},p(l,n)}var d=function(l){R(n,l);function n(u){var a;return a=l.call(this,u,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var o=n.prototype;return o.registerListeners=function(){var a=this.hls;a.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(B.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var a=this.hls;a.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(B.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,l.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(a,r){this.tracks=r.audioTracks||[]},o.onAudioTrackLoaded=function(a,r){var i=r.id,t=r.details,_=this.tracksInGroup[i];if(!_){this.warn("Invalid audio track id "+i);return}var f=_.details;_.details=r.details,this.log("audioTrack "+i+" loaded ["+t.startSN+"-"+t.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,r,f))},o.onLevelLoading=function(a,r){this.switchLevel(r.level)},o.onLevelSwitching=function(a,r){this.switchLevel(r.level)},o.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.audioGroupIds))return;var i=r.audioGroupIds[r.urlId];if(this.groupId!==i){this.groupId=i;var t=this.tracks.filter(function(f){return!i||f.groupId===i});this.selectDefaultTrack&&!t.some(function(f){return f.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var _={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(B.Events.AUDIO_TRACKS_UPDATED,_),this.selectInitialTrack()}},o.onError=function(a,r){if(l.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===H.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},o.setAudioTrack=function(a){var r=this.tracksInGroup;if(a<0||a>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=r[this.trackId];this.log("Now switching to audio-track index "+a);var t=r[a],_=t.id,f=t.groupId,v=f===void 0?"":f,x=t.name,b=t.type,m=t.url;if(this.trackId=a,this.trackName=x,this.selectDefaultTrack=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHING,{id:_,groupId:v,name:x,type:b,url:m}),t.details&&!t.details.live)return;var s=this.switchParams(t.url,i==null?void 0:i.details);this.loadPlaylist(s)},o.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,i=this.findTrackId(r)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(a){for(var r=this.tracksInGroup,i=0;i<r.length;i++){var t=r[i];if((!this.selectDefaultTrack||t.default)&&(!a||a===t.name))return t.id}return-1},o.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var i=r.id,t=r.groupId,_=r.url;if(a)try{_=a.addDirectives(_)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(B.Events.AUDIO_TRACK_LOADING,{url:_,id:i,groupId:t,deliveryDirectives:a||null})}},e(n,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),n}(I.default);j.default=d},"./src/controller/base-playlist-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var B=A("./src/polyfills/number.ts"),C=A("./src/types/level.ts"),I=A("./src/controller/level-helper.ts"),H=A("./src/utils/logger.ts"),U=A("./src/errors.ts"),e=function(){function R(d,l){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,l+":"),this.warn=H.logger.warn.bind(H.logger,l+":"),this.hls=d}var p=R.prototype;return p.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},p.onError=function(l,n){n.fatal&&n.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},p.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},p.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},p.stopLoad=function(){this.canLoad=!1,this.clearTimer()},p.switchParams=function(l,n){var o=n==null?void 0:n.renditionReports;if(o)for(var u=0;u<o.length;u++){var a=o[u],r=""+a.URI;if(r===l.substr(-r.length)){var i=parseInt(a["LAST-MSN"]),t=parseInt(a["LAST-PART"]);if(n&&this.hls.config.lowLatencyMode){var _=Math.min(n.age-n.partTarget,n.targetduration);t!==void 0&&_>n.partTarget&&(t+=1)}if(Object(B.isFiniteNumber)(i))return new C.HlsUrlParameters(i,Object(B.isFiniteNumber)(t)?t:void 0,C.HlsSkip.No)}}},p.loadPlaylist=function(l){},p.shouldLoadTrack=function(l){return this.canLoad&&l&&!!l.url&&(!l.details||l.details.live)},p.playlistLoaded=function(l,n,o){var u=this,a=n.details,r=n.stats,i=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(a.advancedDateTime=Date.now()-i,a.live||o!=null&&o.live){if(a.reloaded(o),o&&this.log("live playlist "+l+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),o&&a.fragments.length>0&&Object(I.mergeDetails)(o,a),!this.canLoad||!a.live)return;var t,_=void 0,f=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var v=this.hls.config.lowLatencyMode,x=a.lastPartSn,b=a.endSN,m=a.lastPartIndex,s=m!==-1,g=x===b,h=v?0:m;s?(_=g?b+1:x,f=g?h:m+1):_=b+1;var T=a.age,y=T+a.ageHeader,w=Math.min(y-a.partTarget,a.targetduration*1.5);if(w>0){if(o&&w>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+w+" with playlist age: "+a.age),w=0;else{var P=Math.floor(w/a.targetduration);if(_+=P,f!==void 0){var L=Math.round(w%a.targetduration/a.partTarget);f+=L}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+w+" skip sn "+P+" to part "+f)}a.tuneInGoal=w}if(t=this.getDeliveryDirectives(a,n.deliveryDirectives,_,f),v||!g){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(a,n.deliveryDirectives,_,f);var S=Object(I.computeReloadInterval)(a,r);_!==void 0&&a.canBlockReload&&(S-=a.partTarget||1),this.log("reload live playlist "+l+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return u.loadPlaylist(t)},S)}else this.clearTimer()},p.getDeliveryDirectives=function(l,n,o,u){var a=Object(C.getSkipValue)(l,o);return n!=null&&n.skip&&l.deltaUpdateFailed&&(o=n.msn,u=n.part,a=C.HlsSkip.No),new C.HlsUrlParameters(o,u,a)},p.retryLoadingOrFail=function(l){var n=this,o=this.hls.config,u=this.retryCount<o.levelLoadingMaxRetry;if(u){var a;if(this.retryCount++,l.details.indexOf("LoadTimeOut")>-1&&(a=l.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+l.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+l.details+'"')}}else this.warn('cannot recover from error "'+l.details+'"'),this.clearTimer(),l.fatal=!0;return u},R}()},"./src/controller/base-stream-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"State",function(){return b}),A.d(j,"default",function(){return m});var B=A("./src/polyfills/number.ts"),C=A("./src/task-loop.ts"),I=A("./src/controller/fragment-tracker.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/utils/logger.ts"),e=A("./src/events.ts"),R=A("./src/errors.ts"),p=A("./src/types/transmuxer.ts"),d=A("./src/utils/mp4-tools.ts"),l=A("./src/utils/discontinuities.ts"),n=A("./src/controller/fragment-finders.ts"),o=A("./src/controller/level-helper.ts"),u=A("./src/loader/fragment-loader.ts"),a=A("./src/crypt/decrypter.ts"),r=A("./src/utils/time-ranges.ts"),i=A("./src/types/loader.ts");function t(s,g){for(var h=0;h<g.length;h++){var T=g[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function _(s,g,h){return g&&t(s.prototype,g),h&&t(s,h),s}function f(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function v(s,g){s.prototype=Object.create(g.prototype),s.prototype.constructor=s,x(s,g)}function x(s,g){return x=Object.setPrototypeOf||function(T,y){return T.__proto__=y,T},x(s,g)}var b={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},m=function(s){v(g,s);function g(T,y,w){var P;return P=s.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=b.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=w,P.log=U.logger.log.bind(U.logger,w+":"),P.warn=U.logger.warn.bind(U.logger,w+":"),P.hls=T,P.fragmentLoader=new u.default(T.config),P.fragmentTracker=y,P.config=T.config,P.decrypter=new a.default(T,T.config),T.on(e.Events.KEY_LOADED,P.onKeyLoaded,f(P)),P}var h=g.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(y){},h.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=b.STOPPED},h._streamEnded=function(y,w){var P=this.fragCurrent,L=this.fragmentTracker;if(!w.live&&P&&P.sn===w.endSN&&!y.nextStart){var S=L.getState(P);return S===I.FragmentState.PARTIAL||S===I.FragmentState.OK}return!1},h.onMediaAttached=function(y,w){var P=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var L=this.config;this.levels&&L.autoStartLoad&&this.state===b.STOPPED&&this.startLoad(L.startPosition)},h.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var y=this.config,w=this.fragCurrent,P=this.media,L=this.mediaBuffer,S=this.state,D=P?P.currentTime:0,F=H.BufferHelper.bufferInfo(L||P,D,y.maxBufferHole);if(this.log("media seeking to "+(Object(B.isFiniteNumber)(D)?D.toFixed(3):D)+", state: "+S),S===b.ENDED)this.resetLoadingState();else if(w&&!F.len){var O=y.maxFragLookUpTolerance,W=w.start-O,z=w.start+w.duration+O,Q=D>z;(D<W||Q)&&(Q&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=D),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=D),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(y,w){if(this.state!==b.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=b.IDLE;var P=this.levels[w.frag.level].details;P&&this.loadFragment(w.frag,P,w.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),s.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=b.STOPPED,this.hls.off(e.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,s.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(y,w){this.log("Loading key for "+y.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=b.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(e.Events.KEY_LOADING,{frag:y})},h.loadFragment=function(y,w,P){this._loadFragForPlayback(y,w,P)},h._loadFragForPlayback=function(y,w,P){var L=this,S=function(F){if(L.fragContextChanged(y)){L.warn("Fragment "+y.sn+(F.part?" p: "+F.part.index:"")+" of level "+y.level+" was dropped during download."),L.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,L._handleFragmentLoadProgress(F)};this._doFragLoad(y,w,P,S).then(function(D){if(!D)return;L.fragLoadError=0;var F=L.state;if(L.fragContextChanged(y)){(F===b.FRAG_LOADING||F===b.BACKTRACKING||!L.fragCurrent&&F===b.PARSING)&&(L.fragmentTracker.removeFragment(y),L.state=b.IDLE);return}if("payload"in D&&(L.log("Loaded fragment "+y.sn+" of level "+y.level),L.hls.trigger(e.Events.FRAG_LOADED,D),L.state===b.BACKTRACKING)){L.fragmentTracker.backtrack(y,D),L.resetFragmentLoading(y);return}L._handleFragmentLoadComplete(D)}).catch(function(D){L.warn(D),L.resetFragmentLoading(y)})},h.flushMainBuffer=function(y,w,P){if(P===void 0&&(P=null),!(y-w))return;var L={startOffset:y,endOffset:w,type:P};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,L)},h._loadInitSegment=function(y){var w=this;this._doFragLoad(y).then(function(P){if(!P||w.fragContextChanged(y)||!w.levels)throw new Error("init load aborted");return P}).then(function(P){var L=w.hls,S=P.payload,D=y.decryptdata;if(S&&S.byteLength>0&&D&&D.key&&D.iv&&D.method==="AES-128"){var F=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(S),D.key.buffer,D.iv.buffer).then(function(O){var W=self.performance.now();return L.trigger(e.Events.FRAG_DECRYPTED,{frag:y,payload:O,stats:{tstart:F,tdecrypt:W}}),P.payload=O,P})}return P}).then(function(P){var L=w.fragCurrent,S=w.hls,D=w.levels;if(!D)throw new Error("init load aborted, missing levels");var F=D[y.level].details;console.assert(F,"Level details are defined when init segment is loaded");var O=y.stats;w.state=b.IDLE,w.fragLoadError=0,y.data=new Uint8Array(P.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),P.frag===L&&S.trigger(e.Events.FRAG_BUFFERED,{stats:O,frag:L,part:null,id:y.type}),w.tick()}).catch(function(P){w.warn(P),w.resetFragmentLoading(y)})},h.fragContextChanged=function(y){var w=this.fragCurrent;return!y||!w||y.level!==w.level||y.sn!==w.sn||y.urlId!==w.urlId},h.fragBufferedComplete=function(y,w){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+r.default.toString(H.BufferHelper.getBuffered(P))),this.state=b.IDLE,this.tick()},h._handleFragmentLoadComplete=function(y){var w=this.transmuxer;if(!w)return;var P=y.frag,L=y.part,S=y.partsLoaded,D=!S||S.length===0||S.some(function(O){return!O}),F=new p.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,L?L.index:-1,!D);w.flush(F)},h._handleFragmentLoadProgress=function(y){},h._doFragLoad=function(y,w,P,L){var S=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(y.start,P||0),this.config.lowLatencyMode&&w){var D=w.partList;if(D&&L){P>y.end&&w.fragmentHint&&(y=w.fragmentHint);var F=this.getNextPart(D,y,P);if(F>-1){var O=D[F];return this.log("Loading part sn: "+y.sn+" p: "+O.index+" cc: "+y.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+F+"-"+(D.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=b.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,part:D[F],targetBufferTime:P}),this.doFragPartsLoad(y,D,F,L).catch(function(W){return S.handleFragLoadError(W)})}else if(!y.url||this.loadedEndOfParts(D,P))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(P.toFixed(3))),Object(B.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=b.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,targetBufferTime:P}),this.fragmentLoader.load(y,L).catch(function(W){return S.handleFragLoadError(W)})},h.doFragPartsLoad=function(y,w,P,L){var S=this;return new Promise(function(D,F){var O=[],W=function z(Q){var q=w[Q];S.fragmentLoader.loadPart(y,q,L).then(function(me){O[q.index]=me;var he=me.part;S.hls.trigger(e.Events.FRAG_LOADED,me);var ce=w[Q+1];if(ce&&ce.fragment===y)z(Q+1);else return D({frag:y,part:he,partsLoaded:O})}).catch(F)};W(P)})},h.handleFragLoadError=function(y){var w=y.data;return w&&w.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(e.Events.ERROR,w),null},h._handleTransmuxerFlush=function(y){var w=this.getCurrentContext(y);if(!w||this.state!==b.PARSING){this.fragCurrent||(this.state=b.IDLE);return}var P=w.frag,L=w.part,S=w.level,D=self.performance.now();P.stats.parsing.end=D,L&&(L.stats.parsing.end=D),this.updateLevelTiming(P,L,S,y.partial)},h.getCurrentContext=function(y){var w=this.levels,P=y.level,L=y.sn,S=y.part;if(!w||!w[P])return this.warn("Levels object was unset while buffering fragment "+L+" of level "+P+". The current chunk will not be buffered."),null;var D=w[P],F=S>-1?Object(o.getPartWith)(D,L,S):null,O=F?F.fragment:Object(o.getFragmentWithSN)(D,L,this.fragCurrent);return O?{frag:O,part:F,level:D}:null},h.bufferFragmentData=function(y,w,P,L){if(!y||this.state!==b.PARSING)return;var S=y.data1,D=y.data2,F=S;if(S&&D&&(F=Object(d.appendUint8Array)(S,D)),!F||!F.length)return;var O={type:y.type,frag:w,part:P,chunkMeta:L,parent:w.type,data:F};this.hls.trigger(e.Events.BUFFER_APPENDING,O),y.dropped&&y.independent&&!P&&this.flushBufferGap(w)},h.flushBufferGap=function(y){var w=this.media;if(!w)return;if(!H.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,y.start);return}var P=w.currentTime,L=H.BufferHelper.bufferInfo(w,P,0),S=y.duration,D=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),F=Math.max(Math.min(y.start-D,L.end-D),P+D);y.start-F>D&&this.flushMainBuffer(F,y.start)},h.getFwdBufferInfo=function(y,w){var P=this.config,L=this.getLoadPosition();if(!Object(B.isFiniteNumber)(L))return null;var S=H.BufferHelper.bufferInfo(y,L,P.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var D=this.fragmentTracker.getBufferedFrag(L,w);if(D&&S.nextStart<D.end)return H.BufferHelper.bufferInfo(y,L,Math.max(S.nextStart,P.maxBufferHole))}return S},h.getMaxBufferLength=function(y){var w=this.config,P;return y?P=Math.max(8*w.maxBufferSize/y,w.maxBufferLength):P=w.maxBufferLength,Math.min(P,w.maxMaxBufferLength)},h.reduceMaxBufferLength=function(y){var w=this.config,P=y||w.maxBufferLength;return w.maxMaxBufferLength>=P?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(y,w){var P,L,S=w.fragments,D=S.length;if(!D)return null;var F=this.config,O=S[0].start,W;if(w.live){var z=F.initialLiveManifestSize;if(D<z)return this.warn("Not enough fragments to start playback (have: "+D+", need: "+z+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(w,S),this.startPosition=W?this.hls.liveSyncPosition||W.start:y)}else y<=O&&(W=S[0]);if(!W){var Q=F.lowLatencyMode?w.partEnd:w.fragmentEnd;W=this.getFragmentAtPosition(y,Q,w)}return(P=W)!==null&&P!==void 0&&P.initSegment&&!((L=W)!==null&&L!==void 0&&L.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},h.getNextPart=function(y,w,P){for(var L=-1,S=!1,D=!0,F=0,O=y.length;F<O;F++){var W=y[F];if(D=D&&!W.independent,L>-1&&P<W.start)break;var z=W.loaded;!z&&(S||W.independent||D)&&W.fragment===w&&(L=F),S=z}return L},h.loadedEndOfParts=function(y,w){var P=y[y.length-1];return P&&w>P.start&&P.loaded},h.getInitialLiveFragment=function(y,w){var P=this.fragPrevious,L=null;if(P){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),L=Object(n.findFragmentByPDT)(w,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!L){var S=P.sn+1;if(S>=y.startSN&&S<=y.endSN){var D=w[S-y.startSN];P.cc===D.cc&&(L=D,this.log("Live playlist, switching playlist, load frag with next SN: "+L.sn))}L||(L=Object(n.findFragWithCC)(w,P.cc),L&&this.log("Live playlist, switching playlist, load frag with same CC: "+L.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(L=this.getFragmentAtPosition(F,this.bitrateTest?y.fragmentEnd:y.edge,y))}return L},h.getFragmentAtPosition=function(y,w,P){var L=this.config,S=this.fragPrevious,D=P.fragments,F=P.endSN,O=P.fragmentHint,W=L.maxFragLookUpTolerance,z=!!(L.lowLatencyMode&&P.partList&&O);z&&O&&!this.bitrateTest&&(D=D.concat(O),F=O.sn);var Q;if(y<w){var q=y>w-W?0:W;Q=Object(n.findFragmentByPTS)(S,D,y,q)}else Q=D[D.length-1];if(Q){var me=Q.sn-P.startSN,he=S&&Q.level===S.level,ce=D[me+1],pe=this.fragmentTracker.getState(Q);if(pe===I.FragmentState.BACKTRACKED){Q=null;for(var ge=me;D[ge]&&this.fragmentTracker.getState(D[ge])===I.FragmentState.BACKTRACKED;)S?Q=D[ge--]:Q=D[--ge];Q||(Q=ce)}else S&&Q.sn===S.sn&&!z&&(he&&(Q.sn<F&&this.fragmentTracker.getState(ce)!==I.FragmentState.OK?(this.log("SN "+Q.sn+" just loaded, load next one: "+ce.sn),Q=ce):Q=null))}return Q},h.synchronizeToLiveEdge=function(y){var w=this.config,P=this.media;if(!P)return;var L=this.hls.liveSyncPosition,S=P.currentTime,D=y.fragments[0].start,F=y.edge,O=S>=D-w.maxFragLookUpTolerance&&S<=F;if(L!==null&&P.duration>L&&(S<L||!O)){var W=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*y.targetduration;(!O&&P.readyState<4||S<F-W)&&(this.loadedmetadata||(this.nextLoadPosition=L),P.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+L.toFixed(3)),P.currentTime=L))}},h.alignPlaylists=function(y,w){var P=this.levels,L=this.levelLastLoaded,S=this.fragPrevious,D=L!==null?P[L]:null,F=y.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var O=y.fragments[0].start,W=!w,z=y.alignedSliding&&Object(B.isFiniteNumber)(O);if(W||!z&&!O){Object(l.alignStream)(S,D,y);var Q=y.fragments[0].start;return this.log("Live playlist sliding: "+Q.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+y.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+F),Q}return O},h.waitForCdnTuneIn=function(y){var w=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*w)},h.setStartPosition=function(y,w){var P=this.startPosition;if(P<w&&(P=-1),P===-1||this.lastCurrentTime===-1){var L=y.startTimeOffset;Object(B.isFiniteNumber)(L)?(P=w+L,L<0&&(P+=y.totalduration),P=Math.min(Math.max(w,P),w+y.totalduration),this.log("Start time offset "+L+" found in playlist, adjust startPosition to "+P),this.startPosition=P):y.live?P=this.hls.liveSyncPosition||w:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},h.getLoadPosition=function(){var y=this.media,w=0;return this.loadedmetadata&&y?w=y.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},h.handleFragLoadAborted=function(y,w){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(w?" part"+w.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},h.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=b.IDLE)},h.onFragmentOrKeyLoadError=function(y,w){if(w.fatal)return;var P=w.frag;if(!P||P.type!==y)return;var L=this.fragCurrent;console.assert(L&&P.sn===L.sn&&P.level===L.level&&P.urlId===L.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var D=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+y+" "+P.level+" failed to load, retrying in "+D+"ms"),this.retryDate=self.performance.now()+D,this.fragLoadError++,this.state=b.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(y===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=b.IDLE):(U.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=b.ERROR)},h.afterBufferFlushed=function(y,w,P){if(!y)return;var L=H.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(w,L,P),this.state===b.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE},h.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[y].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(y,w,P,L){var S=this,D=P.details;console.assert(!!D,"level.details must be defined");var F=Object.keys(y.elementaryStreams).reduce(function(O,W){var z=y.elementaryStreams[W];if(z){var Q=z.endPTS-z.startPTS;if(Q<=0)return S.warn("Could not parse fragment "+y.sn+" "+W+" duration reliably ("+Q+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),O||!1;var q=L?0:Object(o.updateFragPTSDTS)(D,y,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return S.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:D,level:P,drift:q,type:W,frag:y,start:z.startPTS,end:z.endPTS}),!0}return O},!1);F?(this.state=b.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:y,part:w})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},_(g,[{key:"state",get:function(){return this._state},set:function(y){var w=this._state;w!==y&&(this._state=y,this.log(w+"->"+y))}}]),g}(C.default)},"./src/controller/buffer-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return n});var B=A("./src/polyfills/number.ts"),C=A("./src/events.ts"),I=A("./src/utils/logger.ts"),H=A("./src/errors.ts"),U=A("./src/utils/buffer-helper.ts"),e=A("./src/utils/mediasource-helper.ts"),R=A("./src/loader/fragment.ts"),p=A("./src/controller/buffer-operation-queue.ts"),d=Object(e.getMediaSource)(),l=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function o(a){var r=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 i=r.hls,t=r.media,_=r.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),i.trigger(C.Events.MEDIA_ATTACHED,{media:t})),_&&_.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var u=o.prototype;return u.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},u.destroy=function(){this.unregisterListeners(),this.details=null},u.registerListeners=function(){var r=this.hls;r.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(C.Events.BUFFER_RESET,this.onBufferReset,this),r.on(C.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(C.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(C.Events.BUFFER_EOS,this.onBufferEos,this),r.on(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(C.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(C.Events.FRAG_PARSED,this.onFragParsed,this),r.on(C.Events.FRAG_CHANGED,this.onFragChanged,this)},u.unregisterListeners=function(){var r=this.hls;r.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(C.Events.BUFFER_RESET,this.onBufferReset,this),r.off(C.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(C.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(C.Events.BUFFER_EOS,this.onBufferEos,this),r.off(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(C.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(C.Events.FRAG_PARSED,this.onFragParsed,this),r.off(C.Events.FRAG_CHANGED,this.onFragChanged,this)},u._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},u.onManifestParsed=function(r,i){var t=2;(i.audio&&!i.video||!i.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(r,i){var t=this.media=i.media;if(t&&d){var _=this.mediaSource=new d;_.addEventListener("sourceopen",this._onMediaSourceOpen),_.addEventListener("sourceended",this._onMediaSourceEnded),_.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(_),this._objectUrl=t.src}},u.onMediaDetaching=function(){var r=this.media,i=this.mediaSource,t=this._objectUrl;if(i){if(I.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(_){I.logger.warn("[buffer-controller]: onMediaDetaching: "+_.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(r.removeAttribute("src"),r.load()):I.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(C.Events.MEDIA_DETACHED,void 0)},u.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(i){var t=r.sourceBuffer[i];try{t&&(r.removeBufferListeners(i),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[i]=void 0)}catch(_){I.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",_)}}),this._initSourceBuffer()},u.onBufferCodecs=function(r,i){var t=this,_=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(f){if(_){var v=t.tracks[f];if(v&&typeof v.buffer.changeType=="function"){var x=i[f],b=x.codec,m=x.levelCodec,s=x.container,g=(v.levelCodec||v.codec).replace(l,"$1"),h=(m||b).replace(l,"$1");if(g!==h){var T=s+";codecs="+(m||b);t.appendChangeType(f,T)}}}else t.pendingTracks[f]=i[f]}),_)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},u.appendChangeType=function(r,i){var t=this,_=this.operationQueue,f={execute:function(){var x=t.sourceBuffer[r];x&&(I.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+i),x.changeType(i)),_.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(x){I.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",x)}};_.append(f,r)},u.onBufferAppending=function(r,i){var t=this,_=this.hls,f=this.operationQueue,v=this.tracks,x=i.data,b=i.type,m=i.frag,s=i.part,g=i.chunkMeta,h=g.buffering[b],T=self.performance.now();h.start=T;var y=m.stats.buffering,w=s?s.stats.buffering:null;y.start===0&&(y.start=T),w&&w.start===0&&(w.start=T);var P=v.audio,L=b==="audio"&&g.id===1&&(P==null?void 0:P.container)==="audio/mpeg",S={execute:function(){if(h.executeStart=self.performance.now(),L){var F=t.sourceBuffer[b];if(F){var O=m.start-F.timestampOffset;Math.abs(O)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+O+") sn: "+m.sn+")"),F.timestampOffset=m.start)}}t.appendExecutor(x,b)},onStart:function(){},onComplete:function(){var F=self.performance.now();h.executeEnd=h.end=F,y.first===0&&(y.first=F),w&&w.first===0&&(w.first=F);var O=t.sourceBuffer,W={};for(var z in O)W[z]=U.BufferHelper.getBuffered(O[z]);t.appendError=0,t.hls.trigger(C.Events.BUFFER_APPENDED,{type:b,frag:m,part:s,chunkMeta:g,parent:m.type,timeRanges:W})},onError:function(F){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+b+" SourceBuffer",F);var O={type:H.ErrorTypes.MEDIA_ERROR,parent:m.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=H.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,O.details=H.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>_.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+_.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),_.trigger(C.Events.ERROR,O)}};f.append(S,b)},u.onBufferFlushing=function(r,i){var t=this,_=this.operationQueue,f=function(x){return{execute:t.removeExecutor.bind(t,x,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(C.Events.BUFFER_FLUSHED,{type:x})},onError:function(m){I.logger.warn("[buffer-controller]: Failed to remove from "+x+" SourceBuffer",m)}}};i.type?_.append(f(i.type),i.type):this.getSourceBufferTypes().forEach(function(v){_.append(f(v),v)})},u.onFragParsed=function(r,i){var t=this,_=i.frag,f=i.part,v=[],x=f?f.elementaryStreams:_.elementaryStreams;x[R.ElementaryStreamTypes.AUDIOVIDEO]?v.push("audiovideo"):(x[R.ElementaryStreamTypes.AUDIO]&&v.push("audio"),x[R.ElementaryStreamTypes.VIDEO]&&v.push("video"));var b=function(){var s=self.performance.now();_.stats.buffering.end=s,f&&(f.stats.buffering.end=s);var g=f?f.stats:_.stats;t.hls.trigger(C.Events.FRAG_BUFFERED,{frag:_,part:f,stats:g,id:_.type})};v.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+_.type+" level: "+_.level+" sn: "+_.sn),this.blockBuffers(b,v)},u.onFragChanged=function(r,i){this.flushBackBuffer()},u.onBufferEos=function(r,i){var t=this,_=this.getSourceBufferTypes().reduce(function(f,v){var x=t.sourceBuffer[v];return(!i.type||i.type===v)&&(x&&!x.ended&&(x.ended=!0,I.logger.log("[buffer-controller]: "+v+" sourceBuffer now EOS"))),f&&!!(!x||x.ended)},!0);_&&this.blockBuffers(function(){var f=t.mediaSource;if(!f||f.readyState!=="open")return;f.endOfStream()})},u.onLevelUpdated=function(r,i){var t=i.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},u.flushBackBuffer=function(){var r=this.hls,i=this.details,t=this.media,_=this.sourceBuffer;if(!t||i===null)return;var f=this.getSourceBufferTypes();if(!f.length)return;var v=i.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(B.isFiniteNumber)(v)||v<0)return;var x=t.currentTime,b=i.levelTargetDuration,m=Math.max(v,b),s=Math.floor(x/b)*b-m;f.forEach(function(g){var h=_[g];if(h){var T=U.BufferHelper.getBuffered(h);T.length>0&&s>T.start(0)&&(r.trigger(C.Events.BACK_BUFFER_REACHED,{bufferEnd:s}),i.live&&r.trigger(C.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s}),r.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:g}))}})},u.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,i=this.hls,t=this.media,_=this.mediaSource,f=r.fragments[0].start+r.totalduration,v=t.duration,x=Object(B.isFiniteNumber)(_.duration)?_.duration:0;r.live&&i.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),_.duration=Infinity,this.updateSeekableRange(r)):(f>x&&f>v||!Object(B.isFiniteNumber)(v))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+f.toFixed(3)),_.duration=f)},u.updateSeekableRange=function(r){var i=this.mediaSource,t=r.fragments,_=t.length;if(_&&r.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var f=Math.max(0,t[0].start),v=Math.max(f,f+r.totalduration);i.setLiveSeekableRange(f,v)}},u.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,i=this.operationQueue,t=this.pendingTracks,_=Object.keys(t).length;if(_&&!r||_===2){this.createSourceBuffers(t),this.pendingTracks={};var f=this.getSourceBufferTypes();if(f.length===0){this.hls.trigger(C.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}f.forEach(function(v){i.executeNext(v)})}},u.createSourceBuffers=function(r){var i=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var _=0;for(var f in r)if(!i[f]){var v=r[f];if(!v)throw Error("source buffer exists for track "+f+", however track does not");var x=v.levelCodec||v.codec,b=v.container+";codecs="+x;I.logger.log("[buffer-controller]: creating sourceBuffer("+b+")");try{var m=i[f]=t.addSourceBuffer(b),s=f;this.addBufferListener(s,"updatestart",this._onSBUpdateStart),this.addBufferListener(s,"updateend",this._onSBUpdateEnd),this.addBufferListener(s,"error",this._onSBUpdateError),this.tracks[f]={buffer:m,codec:x,container:v.container,levelCodec:v.levelCodec,id:v.id},_++}catch(g){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(C.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:b})}}_&&this.hls.trigger(C.Events.BUFFER_CREATED,{tracks:this.tracks})},u._onSBUpdateStart=function(r){var i=this.operationQueue,t=i.current(r);t.onStart()},u._onSBUpdateEnd=function(r){var i=this.operationQueue,t=i.current(r);t.onComplete(),i.shiftAndExecuteNext(r)},u._onSBUpdateError=function(r,i){I.logger.error("[buffer-controller]: "+r+" SourceBuffer error",i),this.hls.trigger(C.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(i)},u.removeExecutor=function(r,i,t){var _=this.media,f=this.mediaSource,v=this.operationQueue,x=this.sourceBuffer,b=x[r];if(!_||!f||!b){I.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),v.shiftAndExecuteNext(r);return}var m=Object(B.isFiniteNumber)(_.duration)?_.duration:Infinity,s=Object(B.isFiniteNumber)(f.duration)?f.duration:Infinity,g=Math.max(0,i),h=Math.min(t,m,s);h>g?(I.logger.log("[buffer-controller]: Removing ["+g+","+h+"] from the "+r+" SourceBuffer"),console.assert(!b.updating,r+" sourceBuffer must not be updating"),b.remove(g,h)):v.shiftAndExecuteNext(r)},u.appendExecutor=function(r,i){var t=this.operationQueue,_=this.sourceBuffer,f=_[i];if(!f){I.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(i);return}f.ended=!1,console.assert(!f.updating,i+" sourceBuffer must not be updating"),f.appendBuffer(r)},u.blockBuffers=function(r,i){var t=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var _=this.operationQueue,f=i.map(function(v){return _.appendBlocker(v)});Promise.all(f).then(function(){r(),i.forEach(function(v){var x=t.sourceBuffer[v];(!x||!x.updating)&&_.shiftAndExecuteNext(v)})})},u.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},u.addBufferListener=function(r,i,t){var _=this.sourceBuffer[r];if(!_)return;var f=t.bind(this,r);this.listeners[r].push({event:i,listener:f}),_.addEventListener(i,f)},u.removeBufferListeners=function(r){var i=this.sourceBuffer[r];if(!i)return;this.listeners[r].forEach(function(t){i.removeEventListener(t.event,t.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return C});var B=A("./src/utils/logger.ts"),C=function(){function I(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var H=I.prototype;return H.append=function(e,R){var p=this.queues[R];p.push(e),p.length===1&&this.buffers[R]&&this.executeNext(R)},H.insertAbort=function(e,R){var p=this.queues[R];p.unshift(e),this.executeNext(R)},H.appendBlocker=function(e){var R,p=new Promise(function(l){R=l}),d={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,e),p},H.executeNext=function(e){var R=this.buffers,p=this.queues,d=R[e],l=p[e];if(l.length){var n=l[0];try{n.execute()}catch(o){B.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(o),(!d||!d.updating)&&(l.shift(),this.executeNext(e))}}},H.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},H.current=function(e){return this.queues[e][0]},I}()},"./src/controller/cap-level-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts");function C(U,e){for(var R=0;R<e.length;R++){var p=e[R];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(U,p.key,p)}}function I(U,e,R){return e&&C(U.prototype,e),R&&C(U,R),U}var H=function(){function U(R){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=U.prototype;return e.setStreamController=function(p){this.streamController=p},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var p=this.hls;p.on(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var p=this.hls;p.off(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(p,d){U.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},e.onMediaAttaching=function(p,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},e.onManifestParsed=function(p,d){var l=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,l.config.capLevelToPlayerSize&&d.video&&this.startCapping()},e.onBufferCodecs=function(p,d){var l=this.hls;l.config.capLevelToPlayerSize&&d.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(p.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},e.getMaxLevel=function(p){var d=this,l=this.hls.levels;if(!l.length)return-1;var n=l.filter(function(o,u){return U.isLevelAllowed(u,d.restrictedLevels)&&u<=p});return this.clientRect=null,U.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},e.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()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,d={width:0,height:0};if(p){var l=p.getBoundingClientRect();d.width=l.width,d.height=l.height,!d.width&&!d.height&&(d.width=l.right-l.left||p.width||0,d.height=l.bottom-l.top||p.height||0)}return this.clientRect=d,d},U.isLevelAllowed=function(p,d){return d===void 0&&(d=[]),d.indexOf(p)===-1},U.getMaxLevelByMediaSize=function(p,d,l){if(!p||!p.length)return-1;for(var n=function(i,t){return t?i.width!==t.width||i.height!==t.height:!0},o=p.length-1,u=0;u<p.length;u+=1){var a=p[u];if((a.width>=d||a.height>=l)&&n(a,p[u+1])){o=u;break}}return o},I(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(d){}return p}}]),U}();j.default=H},"./src/controller/cmcd-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return n});var B=A("./src/events.ts"),C=A("./src/types/cmcd.ts"),I=A("./src/utils/buffer-helper.ts"),H=A("./src/utils/logger.ts");function U(o,u){for(var a=0;a<u.length;a++){var r=u[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function e(o,u,a){return u&&U(o.prototype,u),a&&U(o,a),o}function R(o,u){var a=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(a)return(a=a.call(o)).next.bind(a);if(Array.isArray(o)||(a=p(o))||u&&o&&typeof o.length=="number"){a&&(o=a);var r=0;return function(){return r>=o.length?{done:!0}:{done:!1,value:o[r++]}}}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 p(o,u){if(!o)return;if(typeof o=="string")return d(o,u);var a=Object.prototype.toString.call(o).slice(8,-1);if(a==="Object"&&o.constructor&&(a=o.constructor.name),a==="Map"||a==="Set")return Array.from(o);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(o,u)}function d(o,u){(u==null||u>o.length)&&(u=o.length);for(var a=0,r=new Array(u);a<u;a++)r[a]=o[a];return r}function l(){return l=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var a=arguments[u];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(o[r]=a[r])}return o},l.apply(this,arguments)}var n=function(){function o(a){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(_){try{r.apply(_,{ot:C.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(f){H.logger.warn("Could not generate manifest CMCD data.",f)}},this.applyFragmentData=function(_){try{var f=_.frag,v=r.hls.levels[f.level],x=r.getObjectType(f),b={d:f.duration*1e3,ot:x};(x===C.CMCDObjectType.VIDEO||x===C.CMCDObjectType.AUDIO||x==C.CMCDObjectType.MUXED)&&(b.br=v.bitrate/1e3,b.tb=r.getTopBandwidth(x),b.bl=r.getBufferLength(x)),r.apply(_,b)}catch(m){H.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=a;var i=this.config=a.config,t=i.cmcd;t!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||o.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var u=o.prototype;return u.registerListeners=function(){var r=this.hls;r.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this)},u.unregisterListeners=function(){var r=this.hls;r.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},u.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},u.onMediaAttached=function(r,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},u.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},u.onBufferCreated=function(r,i){var t,_;this.audioBuffer=(t=i.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(_=i.tracks.video)===null||_===void 0?void 0:_.buffer},u.createData=function(){var r;return{v:C.CMCDVersion,sf:C.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},u.apply=function(r,i){i===void 0&&(i={}),l(i,this.createData());var t=i.ot===C.CMCDObjectType.INIT||i.ot===C.CMCDObjectType.VIDEO||i.ot===C.CMCDObjectType.MUXED;if(this.starved&&t&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var _=o.toHeaders(i);if(!Object.keys(_).length)return;r.headers||(r.headers={}),l(r.headers,_)}else{var f=o.toQuery(i);if(!f)return;r.url=o.appendQueryToUri(r.url,f)}},u.getObjectType=function(r){var i=r.type;return i==="subtitle"?C.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?C.CMCDObjectType.INIT:i==="audio"?C.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?C.CMCDObjectType.VIDEO:C.CMCDObjectType.MUXED:void 0},u.getTopBandwidth=function(r){for(var i=0,t=r===C.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,_=R(t),f;!(f=_()).done;){var v=f.value;v.bitrate>i&&(i=v.bitrate)}return i>0?i:NaN},u.getBufferLength=function(r){var i=this.hls.media,t=r===C.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!i)return NaN;var _=I.BufferHelper.bufferInfo(t,i.currentTime,this.config.maxBufferHole);return _.len*1e3},u.createPlaylistLoader=function(){var r=this.config.pLoader,i=this.applyPlaylistData,t=r||this.config.loader;return function(){function _(v){this.loader=void 0,this.loader=new t(v)}var f=_.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(x,b,m){i(x),this.loader.load(x,b,m)},e(_,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),_}()},u.createFragmentLoader=function(){var r=this.config.fLoader,i=this.applyFragmentData,t=r||this.config.loader;return function(){function _(v){this.loader=void 0,this.loader=new t(v)}var f=_.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(x,b,m){i(x),this.loader.load(x,b,m)},e(_,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),_}()},o.uuid=function(){var r=URL.createObjectURL(new Blob),i=r.toString();return URL.revokeObjectURL(r),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(r){for(var i=[],t=function(L){return!Number.isNaN(L)&&L!=null&&L!==""&&L!==!1},_=function(L){return Math.round(L)},f=function(L){return _(L/100)*100},v=function(L){return encodeURIComponent(L)},x={br:_,d:_,bl:f,dl:f,mtp:f,nor:v,rtp:f,tb:_},b=Object.keys(r||{}).sort(),m=R(b),s;!(s=m()).done;){var g=s.value,h=r[g];if(!t(h))continue;if(g==="v"&&h===1)continue;if(g=="pr"&&h===1)continue;var T=x[g];T&&(h=T(h));var y=typeof h,w=void 0;g==="ot"||g==="sf"||g==="st"?w=g+"="+h:y==="boolean"?w=g:y==="number"?w=g+"="+h:w=g+"="+JSON.stringify(h),i.push(w)}return i.join(",")},o.toHeaders=function(r){for(var i=Object.keys(r),t={},_=["Object","Request","Session","Status"],f=[{},{},{},{}],v={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},x=0,b=i;x<b.length;x++){var m=b[x],s=v[m]!=null?v[m]:1;f[s][m]=r[m]}for(var g=0;g<f.length;g++){var h=o.serialize(f[g]);h&&(t["CMCD-"+_[g]]=h)}return t},o.toQuery=function(r){return"CMCD="+encodeURIComponent(o.serialize(r))},o.appendQueryToUri=function(r,i){if(!i)return r;var t=r.includes("?")?"&":"?";return""+r+t+i},o}()},"./src/controller/eme-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts"),C=A("./src/errors.ts"),I=A("./src/utils/logger.ts"),H=A("./src/utils/mediakeys-helper.ts");function U(n,o){for(var u=0;u<o.length;u++){var a=o[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function e(n,o,u){return o&&U(n.prototype,o),u&&U(n,u),n}var R=3,p=function(o,u,a){var r={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(i){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:a.audioRobustness||""})}),u.forEach(function(i){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:a.videoRobustness||""})}),[r]},d=function(o,u,a,r){switch(o){case H.KeySystems.WIDEVINE:return p(u,a,r);default:throw new Error("Unknown key-system: "+o)}},l=function(){function n(u){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=u,this._config=u.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=n.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(a){switch(a){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},o._attemptKeySystemAccess=function(a,r,i){var t=this,_=d(a,r,i,this._drmSystemOptions);I.logger.log("Requesting encrypted media key-system access");var f=this.requestMediaKeySystemAccess(a,_);this.mediaKeysPromise=f.then(function(v){return t._onMediaKeySystemAccessObtained(a,v)}),f.catch(function(v){I.logger.error('Failed to obtain key-system "'+a+'" access:',v)})},o._onMediaKeySystemAccessObtained=function(a,r){var i=this;I.logger.log('Access for key-system "'+a+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:a};this._mediaKeysList.push(t);var _=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(f){return t.mediaKeys=f,I.logger.log('Media-keys created for key-system "'+a+'"'),i._onMediaKeysCreated(),f});return _.catch(function(f){I.logger.error("Failed to create media-keys:",f)}),_},o._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),a._onNewMediaKeySession(r.mediaKeysSession))})},o._onNewMediaKeySession=function(a){var r=this;I.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(i){r._onKeySessionMessage(a,i.message)},!1)},o._onKeySessionMessage=function(a,r){I.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(i){I.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),a.update(i)})},o.onMediaEncrypted=function(a){var r=this;if(I.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(_){if(!r._media)return;r._attemptSetMediaKeys(_),r._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(i).catch(i)},o._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}I.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(a,r){var i=this,t=this._mediaKeysList[0];if(!t){I.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){I.logger.warn("Key-Session already initialized but requested again");return}var _=t.mediaKeysSession;if(!_){I.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){I.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}I.logger.log('Generating key-session request for "'+a+'" init data type'),t.mediaKeysSessionInitialized=!0,_.generateRequest(a,r).then(function(){I.logger.debug("Key-session generation succeeded")}).catch(function(f){I.logger.error("Error generating key-session request:",f),i.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(a,r,i){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,a,r,i);var _=this._licenseXhrSetup;if(_)try{_.call(this.hls,t,a),_=void 0}catch(f){I.logger.error(f)}try{t.readyState||t.open("POST",a,!0),_&&_.call(this.hls,t,a)}catch(f){throw new Error("issue setting up KeySystem license XHR "+f)}return t},o._onLicenseRequestReadyStageChange=function(a,r,i,t){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,I.logger.log("License request succeeded");var _=a.response,f=this._licenseResponseCallback;if(f)try{_=f.call(this.hls,a,r)}catch(x){I.logger.error(x)}t(_)}else{if(I.logger.error("License Request XHR failed ("+r+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var v=R-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+v+" attempts left"),this._requestLicense(i,t)}break}},o._generateLicenseRequestChallenge=function(a,r){switch(a.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},o._requestLicense=function(a,r){I.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(i.mediaKeySystemDomain),_=this._createLicenseXhr(t,a,r);I.logger.log("Sending license request to URL: "+t);var f=this._generateLicenseRequestChallenge(i,a);_.send(f)}catch(v){I.logger.error("Failure requesting DRM license: "+v),this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.KEY_SYSTEM_ERROR,details:C.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(a,r){if(!this._emeEnabled)return;var i=r.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var a=this._media,r=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(a,r){if(!this._emeEnabled)return;var i=r.levels.map(function(_){return _.audioCodec}).filter(function(_){return!!_}),t=r.levels.map(function(_){return _.videoCodec}).filter(function(_){return!!_});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,i,t)},e(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();j.default=l},"./src/controller/fps-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts"),C=A("./src/utils/logger.ts"),I=function(){function H(e){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=e,this.registerListeners()}var U=H.prototype;return U.setStreamController=function(R){this.streamController=R},U.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(R,p){var d=this.hls.config;if(d.capLevelOnFPSDrop){var l=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=l,l&&typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(R,p,d){var l=performance.now();if(p){if(this.lastTime){var n=l-this.lastTime,o=d-this.lastDroppedFrames,u=p-this.lastDecodedFrames,a=1e3*o/n,r=this.hls;if(r.trigger(B.Events.FPS_DROP,{currentDropped:o,currentDecoded:u,totalDroppedFrames:d}),a>0&&o>r.config.fpsDroppedMonitoringThreshold*u){var i=r.currentLevel;C.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=i)&&(i=i-1,r.trigger(B.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:r.currentLevel}),r.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=l,this.lastDroppedFrames=d,this.lastDecodedFrames=p}},U.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var p=R.getVideoPlaybackQuality();this.checkFPS(R,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},H}();j.default=I},"./src/controller/fragment-finders.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"findFragmentByPDT",function(){return I}),A.d(j,"findFragmentByPTS",function(){return H}),A.d(j,"fragmentWithinToleranceTest",function(){return U}),A.d(j,"pdtWithinToleranceTest",function(){return e}),A.d(j,"findFragWithCC",function(){return R});var B=A("./src/polyfills/number.ts"),C=A("./src/utils/binary-search.ts");function I(p,d,l){if(d===null||!Array.isArray(p)||!p.length||!Object(B.isFiniteNumber)(d))return null;var n=p[0].programDateTime;if(d<(n||0))return null;var o=p[p.length-1].endProgramDateTime;if(d>=(o||0))return null;l=l||0;for(var u=0;u<p.length;++u){var a=p[u];if(e(d,l,a))return a}return null}function H(p,d,l,n){l===void 0&&(l=0),n===void 0&&(n=0);var o=null;if(p?o=d[p.sn-d[0].sn+1]||null:l===0&&d[0].start===0&&(o=d[0]),o&&U(l,n,o)===0)return o;var u=C.default.search(d,U.bind(null,l,n));return u||o}function U(p,d,l){p===void 0&&(p=0),d===void 0&&(d=0);var n=Math.min(d,l.duration+(l.deltaPTS?l.deltaPTS:0));return l.start+l.duration-n<=p?1:l.start-n>p&&l.start?-1:0}function e(p,d,l){var n=Math.min(d,l.duration+(l.deltaPTS?l.deltaPTS:0))*1e3,o=l.endProgramDateTime||0;return o-n>p}function R(p,d){return C.default.search(p,function(l){return l.cc<d?1:l.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"FragmentState",function(){return I}),A.d(j,"FragmentTracker",function(){return H});var B=A("./src/events.ts"),C=A("./src/types/loader.ts"),I;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(I||(I={}));var H=function(){function R(d){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=d,this._registerListeners()}var p=R.prototype;return p._registerListeners=function(){var l=this.hls;l.on(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(B.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var l=this.hls;l.off(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(B.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(l,n){if(n===C.PlaylistLevelType.MAIN){var o=this.activeFragment,u=this.activeParts;if(!o)return null;if(u)for(var a=u.length;a--;){var r=u[a],i=r?r.end:o.appendedPTS;if(r.start<=l&&i!==void 0&&l<=i)return a>9&&(this.activeParts=u.slice(a-9)),r}else if(o.start<=l&&o.appendedPTS!==void 0&&l<=o.appendedPTS)return o}return this.getBufferedFrag(l,n)},p.getBufferedFrag=function(l,n){for(var o=this.fragments,u=Object.keys(o),a=u.length;a--;){var r=o[u[a]];if((r==null?void 0:r.body.type)===n&&r.buffered){var i=r.body;if(i.start<=l&&l<=i.end)return i}}return null},p.detectEvictedFragments=function(l,n,o){var u=this;Object.keys(this.fragments).forEach(function(a){var r=u.fragments[a];if(!r)return;if(!r.buffered){r.body.type===o&&u.removeFragment(r.body);return}var i=r.range[l];if(!i)return;i.time.some(function(t){var _=!u.isTimeBuffered(t.startPTS,t.endPTS,n);return _&&u.removeFragment(r.body),_})})},p.detectPartialFragments=function(l){var n=this,o=this.timeRanges,u=l.frag,a=l.part;if(!o||u.sn==="initSegment")return;var r=e(u),i=this.fragments[r];if(!i)return;Object.keys(o).forEach(function(t){var _=u.elementaryStreams[t];if(!_)return;var f=o[t],v=a!==null||_.partial===!0;i.range[t]=n.getBufferedTimes(u,a,v,f)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},p.fragBuffered=function(l){var n=e(l),o=this.fragments[n];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},p.getBufferedTimes=function(l,n,o,u){for(var a={time:[],partial:o},r=n?n.start:l.start,i=n?n.end:l.end,t=l.minEndPTS||i,_=l.maxStartPTS||r,f=0;f<u.length;f++){var v=u.start(f)-this.bufferPadding,x=u.end(f)+this.bufferPadding;if(_>=v&&t<=x){a.time.push({startPTS:Math.max(r,u.start(f)),endPTS:Math.min(i,u.end(f))});break}else if(r<x&&i>v)a.partial=!0,a.time.push({startPTS:Math.max(r,u.start(f)),endPTS:Math.min(i,u.end(f))});else if(i<=v)break}return a},p.getPartialFragment=function(l){var n=null,o,u,a,r=0,i=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(_){var f=t[_];if(!f)return;U(f)&&(u=f.body.start-i,a=f.body.end+i,l>=u&&l<=a&&(o=Math.min(l-u,a-l),r<=o&&(n=f.body,r=o)))}),n},p.getState=function(l){var n=e(l),o=this.fragments[n];return o?o.buffered?U(o)?I.PARTIAL:I.OK:o.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},p.backtrack=function(l,n){var o=e(l),u=this.fragments[o];if(!u||u.backtrack)return null;var a=u.backtrack=n||u.loaded;return u.loaded=null,a},p.getBacktrackData=function(l){var n=e(l),o=this.fragments[n];if(o){var u,a=o.backtrack;if(a!=null&&(u=a.payload)!==null&&u!==void 0&&u.byteLength)return a;this.removeFragment(l)}return null},p.isTimeBuffered=function(l,n,o){for(var u,a,r=0;r<o.length;r++){if(u=o.start(r)-this.bufferPadding,a=o.end(r)+this.bufferPadding,l>=u&&n<=a)return!0;if(n<=u)return!1}return!1},p.onFragLoaded=function(l,n){var o=n.frag,u=n.part;if(o.sn==="initSegment"||o.bitrateTest||u)return;var a=e(o);this.fragments[a]={body:o,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(l,n){var o=this,u=n.frag,a=n.part,r=n.timeRanges;if(u.type===C.PlaylistLevelType.MAIN)if(this.activeFragment=u,a){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(a)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var _=r[t];if(o.detectEvictedFragments(t,_),!a)for(var f=0;f<_.length;f++)u.appendedPTS=Math.max(_.end(f),u.appendedPTS||0)})},p.onFragBuffered=function(l,n){this.detectPartialFragments(n)},p.hasFragment=function(l){var n=e(l);return!!this.fragments[n]},p.removeFragmentsInRange=function(l,n,o){var u=this;Object.keys(this.fragments).forEach(function(a){var r=u.fragments[a];if(!r)return;if(r.buffered){var i=r.body;i.type===o&&i.start<n&&i.end>l&&u.removeFragment(i)}})},p.removeFragment=function(l){var n=e(l);l.stats.loaded=0,l.clearElementaryStreamInfo(),delete this.fragments[n]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function U(R){var p,d;return R.buffered&&(((p=R.range.video)===null||p===void 0?void 0:p.partial)||((d=R.range.audio)===null||d===void 0?void 0:d.partial))}function e(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"STALL_MINIMUM_DURATION_MS",function(){return U}),A.d(j,"MAX_START_GAP_JUMP",function(){return e}),A.d(j,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),A.d(j,"SKIP_BUFFER_RANGE_START",function(){return p}),A.d(j,"default",function(){return d});var B=A("./src/utils/buffer-helper.ts"),C=A("./src/errors.ts"),I=A("./src/events.ts"),H=A("./src/utils/logger.ts"),U=250,e=2,R=.1,p=.05,d=function(){function l(o,u,a,r){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=o,this.media=u,this.fragmentTracker=a,this.hls=r}var n=l.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(u){var a=this.config,r=this.media,i=this.stalled,t=r.currentTime,_=r.seeking,f=this.seeking&&!_,v=!this.seeking&&_;if(this.seeking=_,t!==u){if(this.moved=!0,i!==null){if(this.stallReported){var x=self.performance.now()-i;H.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(x)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((v||f)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!B.BufferHelper.getBuffered(r).length)return;var b=B.BufferHelper.bufferInfo(r,t,0),m=b.len>0,s=b.nextStart||0;if(!m&&!s)return;if(_){var g=b.len>e,h=!s||s-t>e&&!this.fragmentTracker.getPartialFragment(t);if(g||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,y=Math.max(s,b.start||0)-t,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=w==null||((T=w.details)===null||T===void 0)?void 0:T.live,L=P?w.details.targetduration*2:e;if(y>0&&y<=L){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(i===null){this.stalled=S;return}var D=S-i;!_&&D>=U&&this._reportStall(b.len);var F=B.BufferHelper.bufferInfo(r,t,a.maxBufferHole);this._tryFixBufferStall(F,D)},n._tryFixBufferStall=function(u,a){var r=this.config,i=this.fragmentTracker,t=this.media,_=t.currentTime,f=i.getPartialFragment(_);if(f){var v=this._trySkipBufferHole(f);if(v)return}u.len>r.maxBufferHole&&a>r.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(u){var a=this.hls,r=this.media,i=this.stallReported;i||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+u+")"),a.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:u}))},n._trySkipBufferHole=function(u){for(var a=this.config,r=this.hls,i=this.media,t=i.currentTime,_=0,f=B.BufferHelper.getBuffered(i),v=0;v<f.length;v++){var x=f.start(v);if(t+a.maxBufferHole>=_&&t<x){var b=Math.max(x+p,i.currentTime+R);return H.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+b),this.moved=!0,this.stalled=null,i.currentTime=b,u&&r.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+b,frag:u}),b}_=f.end(v)}return 0},n._tryNudgeBuffer=function(){var u=this.config,a=this.hls,r=this.media,i=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<u.nudgeMaxRetry){var _=i+t*u.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+i+" to "+_),r.currentTime=_,a.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+u.nudgeMaxRetry+" nudges"),a.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},l}()},"./src/controller/id3-track-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts"),C=A("./src/utils/texttrack-utils.ts"),I=A("./src/demux/id3.ts"),H=.25,U=function(){function e(p){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=p,this._registerListeners()}var R=e.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var d=this.hls;d.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(B.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var d=this.hls;d.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(B.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(d,l){this.media=l.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(C.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(d){if(!this.media)return;for(var l=0;l<d.length;l++){var n=d[l];if(n.kind==="metadata"&&n.label==="id3")return Object(C.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(d,l){if(!this.media)return;var n=l.frag,o=l.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var u=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<o.length;a++){var r=I.getID3Frames(o[a].data);if(r){var i=o[a].pts,t=a<o.length-1?o[a+1].pts:n.end,_=t-i;_<=0&&(t=i+H);for(var f=0;f<r.length;f++){var v=r[f];if(!I.isTimeStampFrame(v)){var x=new u(i,t,"");x.value=v,this.id3Track.addCue(x)}}}}},R.onBufferFlushing=function(d,l){var n=l.startOffset,o=l.endOffset,u=l.type;if(!u||u==="audio"){var a=this.id3Track;a&&Object(C.removeCuesInRange)(a,n,o)}},e}();j.default=U},"./src/controller/latency-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var B=A("./src/errors.ts"),C=A("./src/events.ts"),I=A("./src/utils/logger.ts");function H(R,p){for(var d=0;d<p.length;d++){var l=p[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(R,l.key,l)}}function U(R,p,d){return p&&H(R.prototype,p),d&&H(R,d),R}var e=function(){function R(d){var l=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return l.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var p=R.prototype;return p.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},p.registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(C.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(C.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(C.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(C.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(C.Events.ERROR,this.onError)},p.onMediaAttached=function(l,n){this.media=n.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},p.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},p.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},p.onLevelUpdated=function(l,n){var o=n.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},p.onError=function(l,n){if(n.details!==B.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,I.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},p.timeupdate=function(){var l=this.media,n=this.levelDetails;if(!l||!n)return;this.currentTime=l.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var u=this.config,a=u.lowLatencyMode,r=u.maxLiveSyncPlaybackRate;if(!a||r===1)return;var i=this.targetLatency;if(i===null)return;var t=o-i,_=Math.min(this.maxLatency,i+n.targetduration),f=t<_;if(n.live&&f&&t>.05&&this.forwardBufferLength>1){var v=Math.min(2,Math.max(1,r)),x=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;l.playbackRate=Math.min(v,Math.max(1,x))}else l.playbackRate!==1&&l.playbackRate!==0&&(l.playbackRate=1)},p.estimateLiveEdge=function(){var l=this.levelDetails;return l===null?null:l.edge+l.age},p.computeLatency=function(){var l=this.estimateLiveEdge();return l===null?null:l-this.currentTime},U(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var l=this.config,n=this.levelDetails;return l.liveMaxLatencyDuration!==void 0?l.liveMaxLatencyDuration:n?l.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var l=this.levelDetails;if(l===null)return null;var n=l.holdBack,o=l.partHoldBack,u=l.targetduration,a=this.config,r=a.liveSyncDuration,i=a.liveSyncDurationCount,t=a.lowLatencyMode,_=this.hls.userConfig,f=t&&o||n;(_.liveSyncDuration||_.liveSyncDurationCount||f===0)&&(f=r!==void 0?r:i*u);var v=u,x=1;return f+Math.min(this.stallCount*x,v)}},{key:"liveSyncPosition",get:function(){var l=this.estimateLiveEdge(),n=this.targetLatency,o=this.levelDetails;if(l===null||n===null||o===null)return null;var u=o.edge,a=l-n-this.edgeStalled,r=u-o.totalduration,i=u-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(r,a),i)}},{key:"drift",get:function(){var l=this.levelDetails;return l===null?1:l.drift}},{key:"edgeStalled",get:function(){var l=this.levelDetails;if(l===null)return 0;var n=(this.config.lowLatencyMode&&l.partTarget||l.targetduration)*3;return Math.max(l.age-n,0)}},{key:"forwardBufferLength",get:function(){var l=this.media,n=this.levelDetails;if(!l||!n)return 0;var o=l.buffered.length;return o?l.buffered.end(o-1):n.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return a});var B=A("./src/types/level.ts"),C=A("./src/events.ts"),I=A("./src/errors.ts"),H=A("./src/utils/codecs.ts"),U=A("./src/controller/level-helper.ts"),e=A("./src/controller/base-playlist-controller.ts"),R=A("./src/types/loader.ts");function p(){return p=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var _ in t)Object.prototype.hasOwnProperty.call(t,_)&&(r[_]=t[_])}return r},p.apply(this,arguments)}function d(r,i){for(var t=0;t<i.length;t++){var _=i[t];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(r,_.key,_)}}function l(r,i,t){return i&&d(r.prototype,i),t&&d(r,t),r}function n(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,o(r,i)}function o(r,i){return o=Object.setPrototypeOf||function(_,f){return _.__proto__=f,_},o(r,i)}var u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(r){n(i,r);function i(_){var f;return f=r.call(this,_,"[level-controller]")||this,f._levels=[],f._firstLevel=-1,f._startLevel=void 0,f.currentLevelIndex=-1,f.manualLevelIndex=-1,f.onParsedComplete=void 0,f._registerListeners(),f}var t=i.prototype;return t._registerListeners=function(){var f=this.hls;f.on(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(C.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(C.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var f=this.hls;f.off(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(C.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(C.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},t.startLoad=function(){var f=this._levels;f.forEach(function(v){v.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(f,v){var x=[],b=[],m=[],s,g={},h,T=!1,y=!1,w=!1;if(v.levels.forEach(function(D){var F=D.attrs;T=T||!!(D.width&&D.height),y=y||!!D.videoCodec,w=w||!!D.audioCodec,u&&D.audioCodec&&D.audioCodec.indexOf("mp4a.40.34")!==-1&&(D.audioCodec=void 0);var O=D.bitrate+"-"+D.attrs.RESOLUTION+"-"+D.attrs.CODECS;h=g[O],h?h.url.push(D.url):(h=new B.Level(D),g[O]=h,x.push(h)),F&&(F.AUDIO&&Object(U.addGroupId)(h,"audio",F.AUDIO),F.SUBTITLES&&Object(U.addGroupId)(h,"text",F.SUBTITLES))}),(T||y)&&w&&(x=x.filter(function(D){var F=D.videoCodec,O=D.width,W=D.height;return!!F||!!(O&&W)})),x=x.filter(function(D){var F=D.audioCodec,O=D.videoCodec;return(!F||Object(H.isCodecSupportedInMp4)(F,"audio"))&&(!O||Object(H.isCodecSupportedInMp4)(O,"video"))}),v.audioTracks&&(b=v.audioTracks.filter(function(D){return!D.audioCodec||Object(H.isCodecSupportedInMp4)(D.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(b)),v.subtitles&&(m=v.subtitles,Object(U.assignTrackIdsByGroup)(m)),x.length>0){s=x[0].bitrate,x.sort(function(D,F){return D.bitrate-F.bitrate}),this._levels=x;for(var P=0;P<x.length;P++)if(x[P].bitrate===s){this._firstLevel=P,this.log("manifest loaded, "+x.length+" level(s) found, first bitrate: "+s);break}var L=w&&!y,S={levels:x,audioTracks:b,subtitleTracks:m,firstLevel:this._firstLevel,stats:v.stats,audio:w,video:y,altAudio:!L&&b.some(function(D){return!!D.url})};this.hls.trigger(C.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:v.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(f,v){if(r.prototype.onError.call(this,f,v),v.fatal)return;var x=v.context,b=this._levels[this.currentLevelIndex];if(x&&(x.type===R.PlaylistContextType.AUDIO_TRACK&&b.audioGroupIds&&x.groupId===b.audioGroupIds[b.urlId]||x.type===R.PlaylistContextType.SUBTITLE_TRACK&&b.textGroupIds&&x.groupId===b.textGroupIds[b.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,s=!0,g;switch(v.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:case I.ErrorDetails.KEY_LOAD_ERROR:case I.ErrorDetails.KEY_LOAD_TIMEOUT:if(v.frag){var h=this._levels[v.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=v.frag.level)):g=v.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:x&&(x.deliveryDirectives&&(s=!1),g=x.level),m=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:g=v.level,m=!0;break}g!==void 0&&this.recoverLevel(v,g,m,s)},t.recoverLevel=function(f,v,x,b){var m=f.details,s=this._levels[v];if(s.loadError++,x){var g=this.retryLoadingOrFail(f);if(g)f.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(b){var h=s.url.length;if(h>1&&s.loadError<h)f.levelRetry=!0,this.redundantFailover(v);else if(this.manualLevelIndex===-1){var T=v===0?this._levels.length-1:v-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(m+": switch to "+T),f.levelRetry=!0,this.hls.nextAutoLevel=T)}}},t.redundantFailover=function(f){var v=this._levels[f],x=v.url.length;if(x>1){var b=(v.urlId+1)%x;this.warn("Switching to redundant URL-id "+b),this._levels.forEach(function(m){m.urlId=b}),this.level=f}},t.onFragLoaded=function(f,v){var x=v.frag;if(x!==void 0&&x.type===R.PlaylistLevelType.MAIN){var b=this._levels[x.level];b!==void 0&&(b.fragmentError=0,b.loadError=0)}},t.onLevelLoaded=function(f,v){var x,b=v.level,m=v.details,s=this._levels[b];if(!s){var g;this.warn("Invalid level index "+b),(g=v.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(m.deltaUpdateFailed=!0);return}b===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(b,v,s.details)):(x=v.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(m.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(f,v){var x=this.hls.levels[this.currentLevelIndex];if(!x)return;if(x.audioGroupIds){for(var b=-1,m=this.hls.audioTracks[v.id].groupId,s=0;s<x.audioGroupIds.length;s++)if(x.audioGroupIds[s]===m){b=s;break}b!==x.urlId&&(x.urlId=b,this.startLoad())}},t.loadPlaylist=function(f){var v=this.currentLevelIndex,x=this._levels[v];if(this.canLoad&&x&&x.url.length>0){var b=x.urlId,m=x.url[b];if(f)try{m=f.addDirectives(m)}catch(s){this.warn("Could not construct new URL with HLS Delivery Directives: "+s)}this.log("Attempt loading level index "+v+(f?" at sn "+f.msn+" part "+f.part:"")+" with URL-id "+b+" "+m),this.clearTimer(),this.hls.trigger(C.Events.LEVEL_LOADING,{url:m,level:v,id:b,deliveryDirectives:f||null})}},t.removeLevel=function(f,v){var x=function(s,g){return g!==v},b=this._levels.filter(function(m,s){return s!==f?!0:m.url.length>1&&v!==void 0?(m.url=m.url.filter(x),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(x)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(x)),m.urlId=0,!0):!1}).map(function(m,s){var g=m.details;return g!=null&&g.fragments&&g.fragments.forEach(function(h){h.level=s}),m});this._levels=b,this.hls.trigger(C.Events.LEVELS_UPDATED,{levels:b})},l(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(f){var v,x=this._levels;if(x.length===0)return;if(this.currentLevelIndex===f&&(v=x[f])!==null&&v!==void 0&&v.details)return;if(f<0||f>=x.length){var b=f<0;if(this.hls.trigger(C.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:f,fatal:b,reason:"invalid level idx"}),b)return;f=Math.min(f,x.length-1)}this.clearTimer();var m=this.currentLevelIndex,s=x[m],g=x[f];this.log("switching to level "+f+" from "+m),this.currentLevelIndex=f;var h=p({},g,{level:f,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete h._urlId,this.hls.trigger(C.Events.LEVEL_SWITCHING,h);var T=g.details;if(!T||T.live){var y=this.switchParams(g.uri,s==null?void 0:s.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(f){this.manualLevelIndex=f,this._startLevel===void 0&&(this._startLevel=f),f!==-1&&(this.level=f)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(f){this._firstLevel=f}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var f=this.hls.config.startLevel;return f!==void 0?f:this._firstLevel}else return this._startLevel},set:function(f){this._startLevel=f}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(f){this.level=f,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=f)}}]),i}(e.default)},"./src/controller/level-helper.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"addGroupId",function(){return I}),A.d(j,"assignTrackIdsByGroup",function(){return H}),A.d(j,"updatePTS",function(){return U}),A.d(j,"updateFragPTSDTS",function(){return R}),A.d(j,"mergeDetails",function(){return p}),A.d(j,"mapPartIntersection",function(){return d}),A.d(j,"mapFragmentIntersection",function(){return l}),A.d(j,"adjustSliding",function(){return n}),A.d(j,"addSliding",function(){return o}),A.d(j,"computeReloadInterval",function(){return u}),A.d(j,"getFragmentWithSN",function(){return a}),A.d(j,"getPartWith",function(){return r});var B=A("./src/polyfills/number.ts"),C=A("./src/utils/logger.ts");function I(i,t,_){switch(t){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(_);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(_);break}}function H(i){var t={};i.forEach(function(_){var f=_.groupId||"";_.id=t[f]=t[f]||0,t[f]++})}function U(i,t,_){var f=i[t],v=i[_];e(f,v)}function e(i,t){var _=t.startPTS;if(Object(B.isFiniteNumber)(_)){var f=0,v;t.sn>i.sn?(f=_-i.start,v=i):(f=i.start-_,v=t),v.duration!==f&&(v.duration=f)}else if(t.sn>i.sn){var x=i.cc===t.cc;x&&i.minEndPTS?t.start=i.start+(i.minEndPTS-i.start):t.start=i.start+i.duration}else t.start=Math.max(i.start-t.duration,0)}function R(i,t,_,f,v,x){var b=f-_;b<=0&&(C.logger.warn("Fragment should have a positive duration",t),f=_+t.duration,x=v+t.duration);var m=_,s=f,g=t.startPTS,h=t.endPTS;if(Object(B.isFiniteNumber)(g)){var T=Math.abs(g-_);Object(B.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,m=Math.max(_,g),_=Math.min(_,g),v=Math.min(v,t.startDTS),s=Math.min(f,h),f=Math.max(f,h),x=Math.max(x,t.endDTS)}t.duration=f-_;var y=_-t.start;t.appendedPTS=f,t.start=t.startPTS=_,t.maxStartPTS=m,t.startDTS=v,t.endPTS=f,t.minEndPTS=s,t.endDTS=x;var w=t.sn;if(!i||w<i.startSN||w>i.endSN)return 0;var P,L=w-i.startSN,S=i.fragments;for(S[L]=t,P=L;P>0;P--)e(S[P],S[P-1]);for(P=L;P<S.length-1;P++)e(S[P],S[P+1]);return i.fragmentHint&&e(S[S.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,y}function p(i,t){for(var _=null,f=i.fragments,v=f.length-1;v>=0;v--){var x=f[v].initSegment;if(x){_=x;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var b=0,m;if(l(i,t,function(P,L){P.relurl&&(b=P.cc-L.cc),Object(B.isFiniteNumber)(P.startPTS)&&Object(B.isFiniteNumber)(P.endPTS)&&(L.start=L.startPTS=P.startPTS,L.startDTS=P.startDTS,L.appendedPTS=P.appendedPTS,L.maxStartPTS=P.maxStartPTS,L.endPTS=P.endPTS,L.endDTS=P.endDTS,L.minEndPTS=P.minEndPTS,L.duration=P.endPTS-P.startPTS,L.duration&&(m=L),t.PTSKnown=t.alignedSliding=!0),L.elementaryStreams=P.elementaryStreams,L.loader=P.loader,L.stats=P.stats,L.urlId=P.urlId,P.initSegment&&(L.initSegment=P.initSegment,_=P.initSegment)}),_){var s=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;s.forEach(function(P){var L;(!P.initSegment||P.initSegment.relurl===((L=_)===null||L===void 0?void 0:L.relurl))&&(P.initSegment=_)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(P){return!P}),t.deltaUpdateFailed)){C.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=t.skippedSegments;g--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var h=t.fragments;if(b){C.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<h.length;T++)h[T].cc+=b}t.skippedSegments&&(t.startCC=t.fragments[0].cc),d(i.partList,t.partList,function(P,L){L.elementaryStreams=P.elementaryStreams,L.stats=P.stats}),m?R(t,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):n(i,t),h.length&&(t.totalduration=t.edge-h[0].start),t.driftStartTime=i.driftStartTime,t.driftStart=i.driftStart;var y=t.advancedDateTime;if(t.advanced&&y){var w=t.edge;t.driftStart||(t.driftStartTime=y,t.driftStart=w),t.driftEndTime=y,t.driftEnd=w}else t.driftEndTime=i.driftEndTime,t.driftEnd=i.driftEnd,t.advancedDateTime=i.advancedDateTime}function d(i,t,_){if(i&&t)for(var f=0,v=0,x=i.length;v<=x;v++){var b=i[v],m=t[v+f];b&&m&&b.index===m.index&&b.fragment.sn===m.fragment.sn?_(b,m):f--}}function l(i,t,_){for(var f=t.skippedSegments,v=Math.max(i.startSN,t.startSN)-t.startSN,x=(i.fragmentHint?1:0)+(f?t.endSN:Math.min(i.endSN,t.endSN))-t.startSN,b=t.startSN-i.startSN,m=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,s=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,g=v;g<=x;g++){var h=s[b+g],T=m[g];f&&!T&&g<f&&(T=t.fragments[g]=h),h&&T&&_(h,T)}}function n(i,t){var _=t.startSN+t.skippedSegments-i.startSN,f=i.fragments;if(_<0||_>=f.length)return;o(t,f[_].start)}function o(i,t){if(t){for(var _=i.fragments,f=i.skippedSegments;f<_.length;f++)_[f].start+=t;i.fragmentHint&&(i.fragmentHint.start+=t)}}function u(i,t){var _=1e3*i.levelTargetDuration,f=_/2,v=i.age,x=v>0&&v<_*3,b=t.loading.end-t.loading.start,m,s=i.availabilityDelay;if(i.updated===!1)if(x){var g=333*i.misses;m=Math.max(Math.min(f,b*2),g),i.availabilityDelay=(i.availabilityDelay||0)+m}else m=f;else x?(s=Math.min(s||_/2,v),i.availabilityDelay=s,m=s+_-v):m=_-b;return Math.round(m)}function a(i,t,_){if(!i||!i.details)return null;var f=i.details,v=f.fragments[t-f.startSN];return v||(v=f.fragmentHint,v&&v.sn===t?v:t<f.startSN&&_&&_.sn===t?_:null)}function r(i,t,_){if(!i||!i.details)return null;var f=i.details.partList;if(f)for(var v=f.length;v--;){var x=f[v];if(x.index===_&&x.fragment.sn===t)return x}return null}},"./src/controller/stream-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return f});var B=A("./src/polyfills/number.ts"),C=A("./src/controller/base-stream-controller.ts"),I=A("./src/is-supported.ts"),H=A("./src/events.ts"),U=A("./src/utils/buffer-helper.ts"),e=A("./src/controller/fragment-tracker.ts"),R=A("./src/types/loader.ts"),p=A("./src/loader/fragment.ts"),d=A("./src/demux/transmuxer-interface.ts"),l=A("./src/types/transmuxer.ts"),n=A("./src/controller/gap-controller.ts"),o=A("./src/errors.ts"),u=A("./src/utils/logger.ts");function a(v,x){for(var b=0;b<x.length;b++){var m=x[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(v,m.key,m)}}function r(v,x,b){return x&&a(v.prototype,x),b&&a(v,b),v}function i(v,x){v.prototype=Object.create(x.prototype),v.prototype.constructor=v,t(v,x)}function t(v,x){return t=Object.setPrototypeOf||function(m,s){return m.__proto__=s,m},t(v,x)}var _=100,f=function(v){i(x,v);function x(m,s){var g;return g=v.call(this,m,s,"[stream-controller]")||this,g.audioCodecSwap=!1,g.gapController=null,g.level=-1,g._forceStartLoad=!1,g.altAudio=!1,g.audioOnly=!1,g.fragPlaying=null,g.onvplaying=null,g.onvseeked=null,g.fragLastKbps=0,g.stalled=!1,g.couldBacktrack=!1,g.audioCodecSwitch=!1,g.videoBuffer=null,g._registerListeners(),g}var b=x.prototype;return b._registerListeners=function(){var s=this.hls;s.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),s.on(H.Events.ERROR,this.onError,this),s.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),s.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),s.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var s=this.hls;s.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),s.off(H.Events.ERROR,this.onError,this),s.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),s.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),s.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},b.startLoad=function(s){if(this.levels){var g=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(_),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=h.startLevel;T===-1&&(h.config.testBandwidth?(T=0,this.bitrateTest=!0):T=h.nextAutoLevel),this.level=h.nextLoadLevel=T,this.loadedmetadata=!1}g>0&&s===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),s=g),this.state=C.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()}else this._forceStartLoad=!0,this.state=C.State.STOPPED},b.stopLoad=function(){this._forceStartLoad=!1,v.prototype.stopLoad.call(this)},b.doTick=function(){switch(this.state){case C.State.IDLE:this.doTickIdle();break;case C.State.WAITING_LEVEL:{var s,g=this.levels,h=this.level,T=g==null||((s=g[h])===null||s===void 0)?void 0:s.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=C.State.IDLE;break}break}case C.State.FRAG_LOADING_WAITING_RETRY:{var y,w=self.performance.now(),P=this.retryDate;(!P||w>=P||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=C.State.IDLE)}break;default:break}this.onTickEnd()},b.onTickEnd=function(){v.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},b.doTickIdle=function(){var s,g,h=this.hls,T=this.levelLastLoaded,y=this.levels,w=this.media,P=h.config,L=h.nextLoadLevel;if(T===null||!w&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[L])return;var S=y[L];this.level=h.nextLoadLevel=L;var D=S.details;if(!D||this.state===C.State.WAITING_LEVEL||D.live&&this.levelLastLoaded!==L){this.state=C.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,R.PlaylistLevelType.MAIN);if(F===null)return;var O=F.len,W=this.getMaxBufferLength(S.maxBitrate);if(O>=W)return;if(this._streamEnded(F,D)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,z),this.state=C.State.ENDED;return}var Q=F.end,q=this.getNextFragment(Q,D);if(this.couldBacktrack&&!this.fragPrevious&&q&&q.sn!=="initSegment"){var me=q.sn-D.startSN;me>1&&(q=D.fragments[me-1],this.fragmentTracker.removeFragment(q))}if(q&&this.fragmentTracker.getState(q)===e.FragmentState.OK&&this.nextLoadPosition>Q){var he=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,he,R.PlaylistLevelType.MAIN),q=this.getNextFragment(this.nextLoadPosition,D)}if(!q)return;q.initSegment&&!q.initSegment.data&&!this.bitrateTest&&(q=q.initSegment),((s=q.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((g=q.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(q,D):this.loadFragment(q,D,Q)},b.loadFragment=function(s,g,h){var T,y=this.fragmentTracker.getState(s);if(this.fragCurrent=s,y===e.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(s);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else y=e.FragmentState.NOT_LOADED}y===e.FragmentState.NOT_LOADED||y===e.FragmentState.PARTIAL?s.sn==="initSegment"?this._loadInitSegment(s):this.bitrateTest?(s.bitrateTest=!0,this.log("Fragment "+s.sn+" of level "+s.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(s)):(this.startFragRequested=!0,v.prototype.loadFragment.call(this,s,g,h)):y===e.FragmentState.APPENDING?this.reduceMaxBufferLength(s.duration)&&this.fragmentTracker.removeFragment(s):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},b.getAppendedFrag=function(s){var g=this.fragmentTracker.getAppendedFrag(s,R.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},b.getBufferedFrag=function(s){return this.fragmentTracker.getBufferedFrag(s,R.PlaylistLevelType.MAIN)},b.followingBufferedFrag=function(s){return s?this.getBufferedFrag(s.end+.5):null},b.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},b.nextLevelSwitch=function(){var s=this.levels,g=this.media;if(g!=null&&g.readyState){var h,T=this.getAppendedFrag(g.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!g.paused&&s){var y=this.hls.nextLoadLevel,w=s[y],P=this.fragLastKbps;P&&this.fragCurrent?h=this.fragCurrent.duration*w.maxBitrate/(1e3*P)+1:h=0}else h=0;var L=this.getBufferedFrag(g.currentTime+h);if(L){var S=this.followingBufferedFrag(L);if(S){this.abortCurrentFrag();var D=S.maxStartPTS?S.maxStartPTS:S.start,F=S.duration,O=Math.max(L.end,D+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},b.abortCurrentFrag=function(){var s=this.fragCurrent;this.fragCurrent=null,s!=null&&s.loader&&s.loader.abort(),this.state===C.State.KEY_LOADING&&(this.state=C.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},b.flushMainBuffer=function(s,g){v.prototype.flushMainBuffer.call(this,s,g,this.altAudio?"video":null)},b.onMediaAttached=function(s,g){v.prototype.onMediaAttached.call(this,s,g);var h=g.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new n.default(this.config,h,this.fragmentTracker,this.hls)},b.onMediaDetaching=function(){var s=this.media;s&&(s.removeEventListener("playing",this.onvplaying),s.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),v.prototype.onMediaDetaching.call(this)},b.onMediaPlaying=function(){this.tick()},b.onMediaSeeked=function(){var s=this.media,g=s?s.currentTime:null;Object(B.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},b.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},b.onManifestParsed=function(s,g){var h=!1,T=!1,y;g.levels.forEach(function(w){y=w.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(h=!0),y.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=h&&T&&!Object(I.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},b.onLevelLoading=function(s,g){var h=this.levels;if(!h||this.state!==C.State.IDLE)return;var T=h[g.level];(!T.details||T.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(T.details))&&(this.state=C.State.WAITING_LEVEL)},b.onLevelLoaded=function(s,g){var h,T=this.levels,y=g.level,w=g.details,P=w.totalduration;if(!T){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+P);var L=this.fragCurrent;L&&(this.state===C.State.FRAG_LOADING||this.state===C.State.FRAG_LOADING_WAITING_RETRY)&&(L.level!==g.level&&L.loader&&(this.state=C.State.IDLE,L.loader.abort()));var S=T[y],D=0;if(w.live||(h=S.details)!==null&&h!==void 0&&h.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;D=this.alignPlaylists(w,S.details)}if(S.details=w,this.levelLastLoaded=y,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:w,level:y}),this.state===C.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=C.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,D),this.tick()},b._handleFragmentLoadProgress=function(s){var g,h=s.frag,T=s.part,y=s.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var P=w[h.level],L=P.details;if(!L){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var S=P.videoCodec,D=L.PTSKnown||!L.live,F=(g=h.initSegment)===null||g===void 0?void 0:g.data,O=this._getAudioCodec(P),W=this.transmuxer=this.transmuxer||new d.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=T?T.index:-1,Q=z!==-1,q=new l.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,y.byteLength,z,Q),me=this.initPTS[h.cc];W.push(y,F,O,S,h,T,L.totalduration,D,q,me)},b.onAudioTrackSwitching=function(s,g){var h=this.altAudio,T=!!g.url,y=g.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;h&&P.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:y})}},b.onAudioTrackSwitched=function(s,g){var h=g.id,T=!!this.hls.audioTracks[h].url;if(T){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=T,this.tick()},b.onBufferCreated=function(s,g){var h=g.tracks,T,y,w=!1;for(var P in h){var L=h[P];if(L.id==="main"){if(y=P,T=L,P==="video"){var S=h[P];S&&(this.videoBuffer=S.buffer)}}else w=!0}w&&T?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},b.onFragBuffered=function(s,g){var h=g.frag,T=g.part;if(h&&h.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(T?" p: "+T.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===C.State.PARSED&&(this.state=C.State.IDLE);return}var y=T?T.stats:h.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,T)},b.onError=function(s,g){switch(g.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.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==C.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=C.State.ERROR):!g.levelRetry&&this.state===C.State.WAITING_LEVEL&&(this.state=C.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===C.State.PARSING||this.state===C.State.PARSED)){var h=!0,T=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);T&&T.len>.5&&(h=!this.reduceMaxBufferLength(T.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},b.checkBuffer=function(){var s=this.media,g=this.gapController;if(!s||!g||!s.readyState)return;var h=U.BufferHelper.getBuffered(s);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=s.currentTime},b.onFragLoadEmergencyAborted=function(){this.state=C.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},b.onBufferFlushed=function(s,g){var h=g.type;if(h!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(h===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,h,R.PlaylistLevelType.MAIN)}},b.onLevelsUpdated=function(s,g){this.levels=g.levels},b.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},b.seekToStartPos=function(){var s=this.media,g=s.currentTime,h=this.startPosition;if(h>=0&&g<h){if(s.seeking){u.logger.log("could not seek to "+h+", already seeking at "+g);return}var T=U.BufferHelper.getBuffered(s),y=T.length?T.start(0):0,w=y-h;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(u.logger.log("adjusting start position by "+w+" to match buffer start"),h+=w,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+g),s.currentTime=h}},b._getAudioCodec=function(s){var g=this.config.defaultAudioCodec||s.audioCodec;return this.audioCodecSwap&&g&&(this.log("Swapping audio codec"),g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5"),g},b._loadBitrateTestFrag=function(s){var g=this;this._doFragLoad(s).then(function(h){var T=g.hls;if(!h||T.nextLoadLevel||g.fragContextChanged(s))return;g.fragLoadError=0,g.state=C.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var y=s.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),T.trigger(H.Events.FRAG_LOADED,h)})},b._handleTransmuxComplete=function(s){var g,h="main",T=this.hls,y=s.remuxResult,w=s.chunkMeta,P=this.getCurrentContext(w);if(!P){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var L=P.frag,S=P.part,D=P.level,F=y.video,O=y.text,W=y.id3,z=y.initSegment,Q=this.altAudio?void 0:y.audio;if(this.fragContextChanged(L))return;if(this.state=C.State.PARSING,z){z.tracks&&(this._bufferInitSegment(D,z.tracks,L,w),T.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:h,tracks:z.tracks}));var q=z.initPTS,me=z.timescale;Object(B.isFiniteNumber)(q)&&(this.initPTS[L.cc]=q,T.trigger(H.Events.INIT_PTS_FOUND,{frag:L,id:h,initPTS:q,timescale:me}))}if(F&&y.independent!==!1){if(D.details){var he=F.startPTS,ce=F.endPTS,pe=F.startDTS,ge=F.endDTS;if(S)S.elementaryStreams[F.type]={startPTS:he,endPTS:ce,startDTS:pe,endDTS:ge};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var ee=this.getLoadPosition()+this.config.maxBufferHole;if(ee<he){this.backtrack(L);return}L.setElementaryStreamInfo(F.type,L.start,ce,L.start,ge,!0)}L.setElementaryStreamInfo(F.type,he,ce,pe,ge),this.bufferFragmentData(F,L,S,w)}}else if(y.independent===!1){this.backtrack(L);return}if(Q){var J=Q.startPTS,Re=Q.endPTS,Me=Q.startDTS,Ie=Q.endDTS;S&&(S.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:J,endPTS:Re,startDTS:Me,endDTS:Ie}),L.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,J,Re,Me,Ie),this.bufferFragmentData(Q,L,S,w)}if(W!=null&&(g=W.samples)!==null&&g!==void 0&&g.length){var Fe={frag:L,id:h,samples:W.samples};T.trigger(H.Events.FRAG_PARSING_METADATA,Fe)}if(O){var He={frag:L,id:h,samples:O.samples};T.trigger(H.Events.FRAG_PARSING_USERDATA,He)}},b._bufferInitSegment=function(s,g,h,T){var y=this;if(this.state!==C.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var w=g.audio,P=g.video,L=g.audiovideo;if(w){var S=s.audioCodec,D=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),w.metadata.channelCount!==1&&D.indexOf("firefox")===-1&&(S="mp4a.40.5")),D.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),s.audioCodec&&s.audioCodec!==S&&this.log('Swapping manifest audio codec "'+s.audioCodec+'" for "'+S+'"'),w.levelCodec=S,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(s.audioCodec||"")+"/"+w.codec+"]")}P&&(P.levelCodec=s.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(s.videoCodec||"")+"/"+P.codec+"]")),L&&this.log("Init audiovideo buffer, container:"+L.container+", codecs[level/parsed]=["+(s.attrs.CODECS||"")+"/"+L.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(F){var O=g[F],W=O.initSegment;W!=null&&W.byteLength&&y.hls.trigger(H.Events.BUFFER_APPENDING,{type:F,data:W,frag:h,part:null,chunkMeta:T,parent:h.type})}),this.tick()},b.backtrack=function(s){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(s);var g=this.fragmentTracker.backtrack(s);this.fragPrevious=null,this.nextLoadPosition=s.start,g?this.resetFragmentLoading(s):this.state=C.State.BACKTRACKING},b.checkFragmentChanged=function(){var s=this.media,g=null;if(s&&s.readyState>1&&s.seeking===!1){var h=s.currentTime;if(U.BufferHelper.isBuffered(s,h)?g=this.getAppendedFrag(h):U.BufferHelper.isBuffered(s,h+.1)&&(g=this.getAppendedFrag(h+.1)),g){var T=this.fragPlaying,y=g.level;(!T||g.sn!==T.sn||T.level!==y||g.urlId!==T.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:g}),(!T||T.level!==y)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=g)}}},r(x,[{key:"nextLevel",get:function(){var s=this.nextBufferedFrag;return s?s.level:-1}},{key:"currentLevel",get:function(){var s=this.media;if(s){var g=this.getAppendedFrag(s.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var s=this.media;if(s){var g=this.getAppendedFrag(s.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),x}(C.default)},"./src/controller/subtitle-stream-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"SubtitleStreamController",function(){return i});var B=A("./src/events.ts"),C=A("./src/utils/logger.ts"),I=A("./src/utils/buffer-helper.ts"),H=A("./src/controller/fragment-finders.ts"),U=A("./src/utils/discontinuities.ts"),e=A("./src/controller/level-helper.ts"),R=A("./src/controller/fragment-tracker.ts"),p=A("./src/controller/base-stream-controller.ts"),d=A("./src/types/loader.ts"),l=A("./src/types/level.ts");function n(t,_){for(var f=0;f<_.length;f++){var v=_[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(t,v.key,v)}}function o(t,_,f){return _&&n(t.prototype,_),f&&n(t,f),t}function u(t,_){t.prototype=Object.create(_.prototype),t.prototype.constructor=t,a(t,_)}function a(t,_){return a=Object.setPrototypeOf||function(v,x){return v.__proto__=x,v},a(t,_)}var r=500,i=function(t){u(_,t);function _(v,x){var b;return b=t.call(this,v,x,"[subtitle-stream-controller]")||this,b.levels=[],b.currentTrackId=-1,b.tracksBuffered=[],b.mainDetails=null,b._registerListeners(),b}var f=_.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var x=this.hls;x.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(B.Events.ERROR,this.onError,this),x.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.on(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.on(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f._unregisterListeners=function(){var x=this.hls;x.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(B.Events.ERROR,this.onError,this),x.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.off(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.off(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f.startLoad=function(){this.stopLoad(),this.state=p.State.IDLE,this.setInterval(r),this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},f.onLevelLoaded=function(x,b){this.mainDetails=b.details},f.onSubtitleFragProcessed=function(x,b){var m=b.frag,s=b.success;if(this.fragPrevious=m,this.state=p.State.IDLE,!s)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var h,T=m.start,y=0;y<g.length;y++)if(T>=g[y].start&&T<=g[y].end){h=g[y];break}var w=m.start+m.duration;h?h.end=w:(h={start:T,end:w},g.push(h)),this.fragmentTracker.fragBuffered(m)},f.onBufferFlushing=function(x,b){var m=b.startOffset,s=b.endOffset;if(m===0&&s!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,h=this.levels;if(!h.length||!h[g]||!h[g].details)return;var T=h[g].details,y=T.targetduration,w=s-y;if(w<=0)return;b.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(P){for(var L=0;L<P.length;){if(P[L].end<=w){P.shift();continue}else if(P[L].start<w)P[L].start=w;else break;L++}}),this.fragmentTracker.removeFragmentsInRange(m,w,d.PlaylistLevelType.SUBTITLE)}},f.onError=function(x,b){var m,s=b.frag;if(!s||s.type!==d.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=p.State.IDLE},f.onSubtitleTracksUpdated=function(x,b){var m=this,s=b.subtitleTracks;this.tracksBuffered=[],this.levels=s.map(function(g){return new l.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){m.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},f.onSubtitleTrackSwitch=function(x,b){if(this.currentTrackId=b.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(r)},f.onSubtitleTrackLoaded=function(x,b){var m,s=b.details,g=b.id,h=this.currentTrackId,T=this.levels;if(!T.length)return;var y=T[h];if(g>=T.length||g!==h||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,s.live||(m=y.details)!==null&&m!==void 0&&m.live){var w=this.mainDetails;if(s.deltaUpdateFailed||!w)return;var P=w.fragments[0];if(!y.details)s.hasProgramDateTime&&w.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(s,w):P&&Object(e.addSliding)(s,P.start);else{var L=this.alignPlaylists(s,y.details);L===0&&P&&Object(e.addSliding)(s,P.start)}}if(y.details=s,this.levelLastLoaded=g,this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var S=Object(H.findFragmentByPTS)(null,s.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},f._handleFragmentLoadComplete=function(x){var b=x.frag,m=x.payload,s=b.decryptdata,g=this.hls;if(this.fragContextChanged(b))return;if(m&&m.byteLength>0&&s&&s.key&&s.iv&&s.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),s.key.buffer,s.iv.buffer).then(function(T){var y=performance.now();g.trigger(B.Events.FRAG_DECRYPTED,{frag:b,payload:T,stats:{tstart:h,tdecrypt:y}})})}},f.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var x,b=this.currentTrackId,m=this.levels;if(!m.length||!m[b]||!m[b].details)return;var s=m[b].details,g=s.targetduration,h=this.config,T=this.media,y=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-g,h.maxBufferHole),w=y.end,P=y.len,L=this.getMaxBufferLength()+g;if(P>L)return;console.assert(s,"Subtitle track details are defined on idle subtitle stream controller tick");var S=s.fragments,D=S.length,F=s.edge,O,W=this.fragPrevious;if(w<F){var z=h.maxFragLookUpTolerance;W&&s.hasProgramDateTime&&(O=Object(H.findFragmentByPDT)(S,W.endProgramDateTime,z)),O||(O=Object(H.findFragmentByPTS)(W,S,w,z),!O&&W&&W.start<S[0].start&&(O=S[0]))}else O=S[D-1];(x=O)!==null&&x!==void 0&&x.encrypted?(C.logger.log("Loading key for "+O.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(B.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===R.FragmentState.NOT_LOADED&&this.loadFragment(O,s,w)}},f.loadFragment=function(x,b,m){this.fragCurrent=x,t.prototype.loadFragment.call(this,x,b,m)},o(_,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),_}(p.default)},"./src/controller/subtitle-track-controller.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/events.ts"),C=A("./src/utils/texttrack-utils.ts"),I=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function U(n,o){for(var u=0;u<o.length;u++){var a=o[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function e(n,o,u){return o&&U(n.prototype,o),u&&U(n,u),n}function R(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,p(n,o)}function p(n,o){return p=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},p(n,o)}var d=function(n){R(o,n);function o(a){var r;return r=n.call(this,a,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var u=o.prototype;return u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,n.prototype.destroy.call(this)},u.registerListeners=function(){var r=this.hls;r.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(B.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var r=this.hls;r.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(B.Events.ERROR,this.onError,this)},u.onMediaAttached=function(r,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},u.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},u.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 r=l(this.media.textTracks);r.forEach(function(i){Object(C.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(r,i){this.tracks=i.subtitleTracks},u.onSubtitleTrackLoaded=function(r,i){var t=i.id,_=i.details,f=this.trackId,v=this.tracksInGroup[f];if(!v){this.warn("Invalid subtitle track id "+t);return}var x=v.details;v.details=i.details,this.log("subtitle track "+t+" loaded ["+_.startSN+"-"+_.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,x))},u.onLevelLoading=function(r,i){this.switchLevel(i.level)},u.onLevelSwitching=function(r,i){this.switchLevel(i.level)},u.switchLevel=function(r){var i=this.hls.levels[r];if(!(i!=null&&i.textGroupIds))return;var t=i.textGroupIds[i.urlId];if(this.groupId!==t){var _=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,f=this.tracks.filter(function(b){return!t||b.groupId===t});this.tracksInGroup=f;var v=this.findTrackId(_==null?void 0:_.name)||this.findTrackId();this.groupId=t;var x={subtitleTracks:f};this.log("Updating subtitle tracks, "+f.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(B.Events.SUBTITLE_TRACKS_UPDATED,x),v!==-1&&this.setSubtitleTrack(v,_)}},u.findTrackId=function(r){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var _=i[t];if((!this.selectDefaultTrack||_.default)&&(!r||r===_.name))return _.id}return-1},u.onError=function(r,i){if(n.prototype.onError.call(this,r,i),i.fatal||!i.context)return;i.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},u.loadPlaylist=function(r){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,_=i.groupId,f=i.url;if(r)try{f=r.addDirectives(f)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADING,{url:f,id:t,groupId:_,deliveryDirectives:r||null})}},u.toggleTrackModes=function(r){var i=this,t=this.media,_=this.subtitleDisplay,f=this.trackId;if(!t)return;var v=l(t.textTracks),x=v.filter(function(s){return s.groupId===i.groupId});if(r===-1)[].slice.call(v).forEach(function(s){s.mode="disabled"});else{var b=x[f];b&&(b.mode="disabled")}var m=x[r];m&&(m.mode=_?"showing":"hidden")},u.setSubtitleTrack=function(r,i){var t,_=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=_[r])!==null&&t!==void 0&&t.details)||r<-1||r>=_.length)return;this.clearTimer();var f=_[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,f){var v=f.id,x=f.groupId,b=x===void 0?"":x,m=f.name,s=f.type,g=f.url;this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:v,groupId:b,name:m,type:s,url:g});var h=this.switchParams(f.url,i==null?void 0:i.details);this.loadPlaylist(h)}else this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:r})},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,i=l(this.media.textTracks),t=0;t<i.length;t++)if(i[t].mode==="hidden")r=t;else if(i[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,i)}}]),o}(I.default);function l(n){for(var o=[],u=0;u<n.length;u++){var a=n[u];a.kind==="subtitles"&&a.label&&o.push(n[u])}return o}j.default=d},"./src/controller/timeline-controller.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"TimelineController",function(){return l});var B=A("./src/polyfills/number.ts"),C=A("./src/events.ts"),I=A("./src/utils/cea-608-parser.ts"),H=A("./src/utils/output-filter.ts"),U=A("./src/utils/webvtt-parser.ts"),e=A("./src/utils/texttrack-utils.ts"),R=A("./src/utils/imsc1-ttml-parser.ts"),p=A("./src/types/loader.ts"),d=A("./src/utils/logger.ts"),l=function(){function a(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=u(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new H.default(this,"textTrack1"),_=new H.default(this,"textTrack2"),f=new H.default(this,"textTrack3"),v=new H.default(this,"textTrack4");this.cea608Parser1=new I.default(1,t,_),this.cea608Parser2=new I.default(3,f,v)}i.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(C.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(C.Events.FRAG_LOADING,this.onFragLoading,this),i.on(C.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(C.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(C.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(C.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=a.prototype;return r.destroy=function(){var t=this.hls;t.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(C.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(C.Events.FRAG_LOADING,this.onFragLoading,this),t.off(C.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(C.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(C.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(C.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,_,f,v,x){for(var b=!1,m=x.length;m--;){var s=x[m],g=o(s[0],s[1],_,f);if(g>=0&&(s[0]=Math.min(s[0],_),s[1]=Math.max(s[1],f),b=!0,g/(f-_)>.5))return}if(b||x.push([_,f]),this.config.renderTextTracksNatively){var h=this.captionsTracks[t];this.Cues.newCue(h,_,f,v)}else{var T=this.Cues.newCue(null,_,f,v);this.hls.trigger(C.Events.CUES_PARSED,{type:"captions",cues:T,track:t})}},r.onInitPtsFound=function(t,_){var f=this,v=_.frag,x=_.id,b=_.initPTS,m=_.timescale,s=this.unparsedVttFrags;x==="main"&&(this.initPTS[v.cc]=b,this.timescale[v.cc]=m),s.length&&(this.unparsedVttFrags=[],s.forEach(function(g){f.onFragLoaded(C.Events.FRAG_LOADED,g)}))},r.getExistingTrack=function(t){var _=this.media;if(_)for(var f=0;f<_.textTracks.length;f++){var v=_.textTracks[f];if(v[t])return v}return null},r.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},r.createNativeTrack=function(t){if(this.captionsTracks[t])return;var _=this.captionsProperties,f=this.captionsTracks,v=this.media,x=_[t],b=x.label,m=x.languageCode,s=this.getExistingTrack(t);if(s)f[t]=s,Object(e.clearCurrentCues)(f[t]),Object(e.sendAddTrackEvent)(f[t],v);else{var g=this.createTextTrack("captions",b,m);g&&(g[t]=!0,f[t]=g)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var _=this.captionsProperties[t];if(!_)return;var f=_.label,v={_id:t,label:f,kind:"captions",default:_.media?!!_.media.default:!1,closedCaptions:_.media};this.nonNativeCaptionsTracks[t]=v,this.hls.trigger(C.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[v]})},r.createTextTrack=function(t,_,f){var v=this.media;return v?v.addTextTrack(t,_,f):void 0},r.onMediaAttaching=function(t,_){this.media=_.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(_){Object(e.clearCurrentCues)(t[_]),delete t[_]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=u(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var t=this.media;if(!t)return;var _=t.textTracks;if(_)for(var f=0;f<_.length;f++)Object(e.clearCurrentCues)(_[f])},r.onSubtitleTracksUpdated=function(t,_){var f=this;this.textTracks=[];var v=_.subtitleTracks||[],x=v.some(function(g){return g.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||x&&this.config.enableIMSC1){var b=this.tracks&&v&&this.tracks.length===v.length;if(this.tracks=v||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(g,h){var T;if(h<m.length){for(var y=null,w=0;w<m.length;w++)if(n(m[w],g)){y=m[w];break}y&&(T=y)}T?Object(e.clearCurrentCues)(T):(T=f.createTextTrack("subtitles",g.name,g.lang),T&&(T.mode="disabled")),T&&(T.groupId=g.groupId,f.textTracks.push(T))})}else if(!b&&this.tracks&&this.tracks.length){var s=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(C.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}},r.onManifestLoaded=function(t,_){var f=this;this.config.enableCEA708Captions&&_.captions&&_.captions.forEach(function(v){var x=/(?:CC|SERVICE)([1-4])/.exec(v.instreamId);if(!x)return;var b="textTrack"+x[1],m=f.captionsProperties[b];if(!m)return;m.label=v.name,v.lang&&(m.languageCode=v.lang),m.media=v})},r.onFragLoading=function(t,_){var f=this.cea608Parser1,v=this.cea608Parser2,x=this.lastSn,b=this.lastPartIndex;if(!this.enabled||!(f&&v))return;if(_.frag.type===p.PlaylistLevelType.MAIN){var m,s,g=_.frag.sn,h=(m=_==null||((s=_.part)===null||s===void 0)?void 0:s.index)!=null?m:-1;g===x+1||g===x&&h===b+1||(f.reset(),v.reset()),this.lastSn=g,this.lastPartIndex=h}},r.onFragLoaded=function(t,_){var f=_.frag,v=_.payload,x=this.initPTS,b=this.unparsedVttFrags;if(f.type===p.PlaylistLevelType.SUBTITLE)if(v.byteLength){if(!Object(B.isFiniteNumber)(x[f.cc])){b.push(_),x.length&&this.hls.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var m=f.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var s=this.tracks[f.level],g=this.vttCCs;g[f.cc]||(g[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),s&&s.textCodec===R.IMSC1_CODEC?this._parseIMSC1(f,v):this._parseVTTs(f,v,g)}}else this.hls.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,_){var f=this,v=this.hls;Object(R.parseIMSC1)(_,this.initPTS[t.cc],this.timescale[t.cc],function(x){f._appendCues(x,t.level),v.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(x){d.logger.log("Failed to parse IMSC1: "+x),v.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:x})})},r._parseVTTs=function(t,_,f){var v=this,x=this.hls;Object(U.parseWebVTT)(_,this.initPTS[t.cc],this.timescale[t.cc],f,t.cc,t.start,function(b){v._appendCues(b,t.level),x.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(b){v._fallbackToIMSC1(t,_),d.logger.log("Failed to parse VTT cue: "+b),x.trigger(C.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},r._fallbackToIMSC1=function(t,_){var f=this,v=this.tracks[t.level];v.textCodec||Object(R.parseIMSC1)(_,this.initPTS[t.cc],this.timescale[t.cc],function(){v.textCodec=R.IMSC1_CODEC,f._parseIMSC1(t,_)},function(){v.textCodec="wvtt"})},r._appendCues=function(t,_){var f=this.hls;if(this.config.renderTextTracksNatively){var v=this.textTracks[_];if(v.mode==="disabled")return;t.forEach(function(m){return Object(e.addCueToTrack)(v,m)})}else{var x=this.tracks[_],b=x.default?"default":"subtitles"+_;f.trigger(C.Events.CUES_PARSED,{type:"subtitles",cues:t,track:b})}},r.onFragDecrypted=function(t,_){var f=_.frag;if(f.type===p.PlaylistLevelType.SUBTITLE){if(!Object(B.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(_);return}this.onFragLoaded(C.Events.FRAG_LOADED,_)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,_){var f=this.cea608Parser1,v=this.cea608Parser2;if(!this.enabled||!(f&&v))return;for(var x=0;x<_.samples.length;x++){var b=_.samples[x].bytes;if(b){var m=this.extractCea608Data(b);f.addData(_.samples[x].pts,m[0]),v.addData(_.samples[x].pts,m[1])}}},r.onBufferFlushing=function(t,_){var f=_.startOffset,v=_.endOffset,x=_.endOffsetSubtitles,b=_.type,m=this.media;if(!m||m.currentTime<v)return;if(!b||b==="video"){var s=this.captionsTracks;Object.keys(s).forEach(function(h){return Object(e.removeCuesInRange)(s[h],f,v)})}if(this.config.renderTextTracksNatively&&(f===0&&x!==void 0)){var g=this.textTracks;Object.keys(g).forEach(function(h){return Object(e.removeCuesInRange)(g[h],f,x)})}},r.extractCea608Data=function(t){for(var _=t[0]&31,f=2,v=[[],[]],x=0;x<_;x++){var b=t[f++],m=127&t[f++],s=127&t[f++],g=(4&b)!==0,h=3&b;if(m===0&&s===0)continue;g&&((h===0||h===1)&&(v[h].push(m),v[h].push(s)))}return v},a}();function n(a,r){return a&&a.label===r.name&&!(a.textTrack1||a.textTrack2)}function o(a,r,i,t){return Math.min(r,t)-Math.max(a,i)}function u(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return B});var B=function(){function C(H,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=U}var I=C.prototype;return I.decrypt=function(U,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,U)},C}()},"./src/crypt/aes-decryptor.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"removePadding",function(){return C}),A.d(j,"default",function(){return I});var B=A("./src/utils/typed-array.ts");function C(H){var U=H.byteLength,e=U&&new DataView(H.buffer).getUint8(U-1);return e?Object(B.sliceUint8)(H,0,U-e):H}var I=function(){function H(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=H.prototype;return U.uint8ArrayToUint32Array_=function(R){for(var p=new DataView(R),d=new Uint32Array(4),l=0;l<4;l++)d[l]=p.getUint32(l*4);return d},U.initTable=function(){var R=this.sBox,p=this.invSBox,d=this.subMix,l=d[0],n=d[1],o=d[2],u=d[3],a=this.invSubMix,r=a[0],i=a[1],t=a[2],_=a[3],f=new Uint32Array(256),v=0,x=0,b=0;for(b=0;b<256;b++)b<128?f[b]=b<<1:f[b]=b<<1^283;for(b=0;b<256;b++){var m=x^x<<1^x<<2^x<<3^x<<4;m=m>>>8^m&255^99,R[v]=m,p[m]=v;var s=f[v],g=f[s],h=f[g],T=f[m]*257^m*16843008;l[v]=T<<24|T>>>8,n[v]=T<<16|T>>>16,o[v]=T<<8|T>>>24,u[v]=T,T=h*16843009^g*65537^s*257^v*16843008,r[m]=T<<24|T>>>8,i[m]=T<<16|T>>>16,t[m]=T<<8|T>>>24,_[m]=T,v?(v=s^f[f[f[h^s]]],x^=f[f[x]]):v=x=1}},U.expandKey=function(R){for(var p=this.uint8ArrayToUint32Array_(R),d=!0,l=0;l<p.length&&d;)d=p[l]===this.key[l],l++;if(d)return;this.key=p;var n=this.keySize=p.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);var o=this.ksRows=(n+6+1)*4,u,a,r=this.keySchedule=new Uint32Array(o),i=this.invKeySchedule=new Uint32Array(o),t=this.sBox,_=this.rcon,f=this.invSubMix,v=f[0],x=f[1],b=f[2],m=f[3],s,g;for(u=0;u<o;u++){if(u<n){s=r[u]=p[u];continue}g=s,u%n===0?(g=g<<8|g>>>24,g=t[g>>>24]<<24|t[g>>>16&255]<<16|t[g>>>8&255]<<8|t[g&255],g^=_[u/n|0]<<24):n>6&&u%n===4&&(g=t[g>>>24]<<24|t[g>>>16&255]<<16|t[g>>>8&255]<<8|t[g&255]),r[u]=s=(r[u-n]^g)>>>0}for(a=0;a<o;a++)u=o-a,a&3?g=r[u]:g=r[u-4],a<4||u<=4?i[a]=g:i[a]=v[t[g>>>24]]^x[t[g>>>16&255]]^b[t[g>>>8&255]]^m[t[g&255]],i[a]=i[a]>>>0},U.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},U.decrypt=function(R,p,d){for(var l=this.keySize+6,n=this.invKeySchedule,o=this.invSBox,u=this.invSubMix,a=u[0],r=u[1],i=u[2],t=u[3],_=this.uint8ArrayToUint32Array_(d),f=_[0],v=_[1],x=_[2],b=_[3],m=new Int32Array(R),s=new Int32Array(m.length),g,h,T,y,w,P,L,S,D,F,O,W,z,Q,q=this.networkToHostOrderSwap;p<m.length;){for(D=q(m[p]),F=q(m[p+1]),O=q(m[p+2]),W=q(m[p+3]),w=D^n[0],P=W^n[1],L=O^n[2],S=F^n[3],z=4,Q=1;Q<l;Q++)g=a[w>>>24]^r[P>>16&255]^i[L>>8&255]^t[S&255]^n[z],h=a[P>>>24]^r[L>>16&255]^i[S>>8&255]^t[w&255]^n[z+1],T=a[L>>>24]^r[S>>16&255]^i[w>>8&255]^t[P&255]^n[z+2],y=a[S>>>24]^r[w>>16&255]^i[P>>8&255]^t[L&255]^n[z+3],w=g,P=h,L=T,S=y,z=z+4;g=o[w>>>24]<<24^o[P>>16&255]<<16^o[L>>8&255]<<8^o[S&255]^n[z],h=o[P>>>24]<<24^o[L>>16&255]<<16^o[S>>8&255]<<8^o[w&255]^n[z+1],T=o[L>>>24]<<24^o[S>>16&255]<<16^o[w>>8&255]<<8^o[P&255]^n[z+2],y=o[S>>>24]<<24^o[w>>16&255]<<16^o[P>>8&255]<<8^o[L&255]^n[z+3],s[p]=q(g^f),s[p+1]=q(y^v),s[p+2]=q(T^x),s[p+3]=q(h^b),f=D,v=F,x=O,b=W,p=p+4}return s.buffer},H}()},"./src/crypt/decrypter.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return p});var B=A("./src/crypt/aes-crypto.ts"),C=A("./src/crypt/fast-aes-key.ts"),I=A("./src/crypt/aes-decryptor.ts"),H=A("./src/utils/logger.ts"),U=A("./src/utils/mp4-tools.ts"),e=A("./src/utils/typed-array.ts"),R=16,p=function(){function d(n,o,u){var a=u===void 0?{}:u,r=a.removePKCS7Padding,i=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=n,this.config=o,this.removePKCS7Padding=i,i)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(_){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var l=d.prototype;return l.destroy=function(){this.observer=null},l.isSync=function(){return this.config.enableSoftwareAES},l.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var u=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(I.removePadding)(u):u},l.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},l.decrypt=function(o,u,a,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),u,a);var i=this.flush();i&&r(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),u,a).then(r)},l.softwareDecrypt=function(o,u,a){var r=this.currentIV,i=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(o=Object(U.appendUint8Array)(t,o),this.remainderData=null);var _=this.getValidChunk(o);if(!_.length)return null;r&&(a=r);var f=this.softwareDecrypter;f||(f=this.softwareDecrypter=new I.default),f.expandKey(u);var v=i;return this.currentResult=f.decrypt(_.buffer,0,a),this.currentIV=Object(e.sliceUint8)(_,-16).buffer,v||null},l.webCryptoDecrypt=function(o,u,a){var r=this,i=this.subtle;return(this.key!==u||!this.fastAesKey)&&(this.key=u,this.fastAesKey=new C.default(i,u)),this.fastAesKey.expandKey().then(function(t){if(!i)return Promise.reject(new Error("web crypto not initialized"));var _=new B.default(i,a);return _.decrypt(o.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,o,u,a)})},l.onWebCryptoError=function(o,u,a,r){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(u,a,r)},l.getValidChunk=function(o){var u=o,a=o.length-o.length%R;return a!==o.length&&(u=Object(e.sliceUint8)(o,0,a),this.remainderData=Object(e.sliceUint8)(o,a)),u},l.logOnce=function(o){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return B});var B=function(){function C(H,U){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=U}var I=C.prototype;return I.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},C}()},"./src/demux/aacdemuxer.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/demux/base-audio-demuxer.ts"),C=A("./src/demux/adts.ts"),I=A("./src/utils/logger.ts"),H=A("./src/demux/id3.ts");function U(p,d){p.prototype=Object.create(d.prototype),p.prototype.constructor=p,e(p,d)}function e(p,d){return e=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},e(p,d)}var R=function(p){U(d,p);function d(n,o){var u;return u=p.call(this)||this,u.observer=void 0,u.config=void 0,u.observer=n,u.config=o,u}var l=d.prototype;return l.resetInitSegment=function(o,u,a){p.prototype.resetInitSegment.call(this,o,u,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:a,inputTimeScale:9e4,dropped:0}},d.probe=function(o){if(!o)return!1;for(var u=H.getID3Data(o,0)||[],a=u.length,r=o.length;a<r;a++)if(C.probe(o,a))return I.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(o,u){return C.canParse(o,u)},l.appendFrame=function(o,u,a){C.initTrackConfig(o,this.observer,u,a,o.manifestCodec);var r=C.appendFrame(o,u,a,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},d}(B.default);R.minProbeByteLength=9,j.default=R},"./src/demux/adts.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"getAudioConfig",function(){return H}),A.d(j,"isHeaderPattern",function(){return U}),A.d(j,"getHeaderLength",function(){return e}),A.d(j,"getFullFrameLength",function(){return R}),A.d(j,"canGetFrameLength",function(){return p}),A.d(j,"isHeader",function(){return d}),A.d(j,"canParse",function(){return l}),A.d(j,"probe",function(){return n}),A.d(j,"initTrackConfig",function(){return o}),A.d(j,"getFrameDuration",function(){return u}),A.d(j,"parseFrameHeader",function(){return a}),A.d(j,"appendFrame",function(){return r});var B=A("./src/utils/logger.ts"),C=A("./src/errors.ts"),I=A("./src/events.ts");function H(i,t,_,f){var v,x,b,m,s=navigator.userAgent.toLowerCase(),g=f,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];v=((t[_+2]&192)>>>6)+1;var T=(t[_+2]&60)>>>2;if(T>h.length-1){i.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return b=(t[_+2]&1)<<2,b|=(t[_+3]&192)>>>6,B.logger.log("manifest codec:"+f+", ADTS type:"+v+", samplingIndex:"+T),/firefox/i.test(s)?T>=6?(v=5,m=new Array(4),x=T-3):(v=2,m=new Array(2),x=T):s.indexOf("android")!==-1?(v=2,m=new Array(2),x=T):(v=5,m=new Array(4),f&&(f.indexOf("mp4a.40.29")!==-1||f.indexOf("mp4a.40.5")!==-1)||!f&&T>=6?x=T-3:((f&&f.indexOf("mp4a.40.2")!==-1&&(T>=6&&b===1||/vivaldi/i.test(s))||!f&&b===1)&&(v=2,m=new Array(2)),x=T)),m[0]=v<<3,m[0]|=(T&14)>>1,m[1]|=(T&1)<<7,m[1]|=b<<3,v===5&&(m[1]|=(x&14)>>1,m[2]=(x&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:h[T],channelCount:b,codec:"mp4a.40."+v,manifestCodec:g}}function U(i,t){return i[t]===255&&(i[t+1]&246)===240}function e(i,t){return i[t+1]&1?7:9}function R(i,t){return(i[t+3]&3)<<11|i[t+4]<<3|(i[t+5]&224)>>>5}function p(i,t){return t+5<i.length}function d(i,t){return t+1<i.length&&U(i,t)}function l(i,t){return p(i,t)&&U(i,t)&&R(i,t)<=i.length-t}function n(i,t){if(d(i,t)){var _=e(i,t);if(t+_>=i.length)return!1;var f=R(i,t);if(f<=_)return!1;var v=t+f;return v===i.length||d(i,v)}return!1}function o(i,t,_,f,v){if(!i.samplerate){var x=H(t,_,f,v);if(!x)return;i.config=x.config,i.samplerate=x.samplerate,i.channelCount=x.channelCount,i.codec=x.codec,i.manifestCodec=x.manifestCodec,B.logger.log("parsed codec:"+i.codec+", rate:"+x.samplerate+", channels:"+x.channelCount)}}function u(i){return 1024*9e4/i}function a(i,t,_,f,v){var x=e(i,t),b=R(i,t);if(b-=x,b>0){var m=_+f*v;return{headerLength:x,frameLength:b,stamp:m}}}function r(i,t,_,f,v){var x=u(i.samplerate),b=a(t,_,f,v,x);if(b){var m=b.frameLength,s=b.headerLength,g=b.stamp,h=s+m,T=Math.max(0,_+h-t.length),y;T?(y=new Uint8Array(h-s),y.set(t.subarray(_+s,t.length),0)):y=t.subarray(_+s,_+h);var w={unit:y,pts:g};return T||i.samples.push(w),{sample:w,length:h,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"initPTSFn",function(){return R});var B=A("./src/polyfills/number.ts"),C=A("./src/demux/id3.ts"),I=A("./src/demux/dummy-demuxed-track.ts"),H=A("./src/utils/mp4-tools.ts"),U=A("./src/utils/typed-array.ts"),e=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=p.prototype;return d.resetInitSegment=function(n,o,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(n,o){return!1},d.appendFrame=function(n,o,u){},d.demux=function(n,o){this.cachedData&&(n=Object(H.appendUint8Array)(this.cachedData,n),this.cachedData=null);var u=C.getID3Data(n,0),a=u?u.length:0,r,i,t=this._audioTrack,_=this._id3Track,f=u?C.getTimeStamp(u):void 0,v=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(f,o)),u&&u.length>0&&_.samples.push({pts:this.initPTS,dts:this.initPTS,data:u}),i=this.initPTS;a<v;){if(this.canParse(n,a)){var x=this.appendFrame(t,n,a);x?(this.frameIndex++,i=x.sample.pts,a+=x.length,r=a):a=v}else C.canParse(n,a)?(u=C.getID3Data(n,a),_.samples.push({pts:i,dts:i,data:u}),a+=u.length,r=a):a++;if(a===v&&r!==v){var b=Object(U.sliceUint8)(n,r);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,b):this.cachedData=b}}return{audioTrack:t,avcTrack:Object(I.dummyTrack)(),id3Track:_,textTrack:Object(I.dummyTrack)()}},d.demuxSampleAes=function(n,o,u){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(n){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(I.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(I.dummyTrack)()}},d.destroy=function(){},p}(),R=function(d,l){return Object(B.isFiniteNumber)(d)?d*90:l*9e4};j.default=e},"./src/demux/chunk-cache.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return B});var B=function(){function I(){this.chunks=[],this.dataLength=0}var H=I.prototype;return H.push=function(e){this.chunks.push(e),this.dataLength+=e.length},H.flush=function(){var e=this.chunks,R=this.dataLength,p;if(e.length)e.length===1?p=e[0]:p=C(e,R);else return new Uint8Array(0);return this.reset(),p},H.reset=function(){this.chunks.length=0,this.dataLength=0},I}();function C(I,H){for(var U=new Uint8Array(H),e=0,R=0;R<I.length;R++){var p=I[R];U.set(p,e),e+=p.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"dummyTrack",function(){return B});function B(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/utils/logger.ts"),C=function(){function I(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var H=I.prototype;return H.loadWord=function(){var e=this.data,R=this.bytesAvailable,p=e.byteLength-R,d=new Uint8Array(4),l=Math.min(4,R);if(l===0)throw new Error("no bytes available");d.set(e.subarray(p,p+l)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l},H.skipBits=function(e){var R;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,R=e>>3,e-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},H.readBits=function(e){var R=Math.min(this.bitsAvailable,e),p=this.word>>>32-R;return e>32&&B.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=e-R,R>0&&this.bitsAvailable?p<<R|this.readBits(R):p},H.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},H.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(e){for(var R=8,p=8,d,l=0;l<e;l++)p!==0&&(d=this.readEG(),p=(R+d+256)%256),R=p===0?R:p},H.readSPS=function(){var e=0,R=0,p=0,d=0,l,n,o,u=this.readUByte.bind(this),a=this.readBits.bind(this),r=this.readUEG.bind(this),i=this.readBoolean.bind(this),t=this.skipBits.bind(this),_=this.skipEG.bind(this),f=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);u();var x=u();if(a(5),t(3),u(),f(),x===100||x===110||x===122||x===244||x===44||x===83||x===86||x===118||x===128){var b=r();if(b===3&&t(1),f(),f(),t(1),i())for(n=b!==3?8:12,o=0;o<n;o++)i()&&(o<6?v(16):v(64))}f();var m=r();if(m===0)r();else if(m===1)for(t(1),_(),_(),l=r(),o=0;o<l;o++)_();f(),t(1);var s=r(),g=r(),h=a(1);h===0&&t(1),t(1),i()&&(e=r(),R=r(),p=r(),d=r());var T=[1,1];if(i()&&i()){var y=u();switch(y){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[u()<<8|u(),u()<<8|u()];break}}}return{width:Math.ceil((s+1)*16-e*2-R*2),height:(2-h)*(g+1)*16-(h?2:4)*(p+d),pixelRatio:T}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},I}();j.default=C},"./src/demux/id3.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"isHeader",function(){return B}),A.d(j,"isFooter",function(){return C}),A.d(j,"getID3Data",function(){return I}),A.d(j,"canParse",function(){return U}),A.d(j,"getTimeStamp",function(){return e}),A.d(j,"isTimeStampFrame",function(){return R}),A.d(j,"getID3Frames",function(){return d}),A.d(j,"decodeFrame",function(){return l}),A.d(j,"utf8ArrayToStr",function(){return r}),A.d(j,"testables",function(){return i});var B=function(v,x){return x+10<=v.length&&(v[x]===73&&v[x+1]===68&&v[x+2]===51&&(v[x+3]<255&&v[x+4]<255&&(v[x+6]<128&&v[x+7]<128&&v[x+8]<128&&v[x+9]<128)))},C=function(v,x){return x+10<=v.length&&(v[x]===51&&v[x+1]===68&&v[x+2]===73&&(v[x+3]<255&&v[x+4]<255&&(v[x+6]<128&&v[x+7]<128&&v[x+8]<128&&v[x+9]<128)))},I=function(v,x){for(var b=x,m=0;B(v,x);){m+=10;var s=H(v,x+6);m+=s,C(v,x+10)&&(m+=10),x+=m}return m>0?v.subarray(b,b+m):void 0},H=function(v,x){var b=0;return b=(v[x]&127)<<21,b|=(v[x+1]&127)<<14,b|=(v[x+2]&127)<<7,b|=v[x+3]&127,b},U=function(v,x){return B(v,x)&&H(v,x+6)+10<=v.length-x},e=function(v){for(var x=d(v),b=0;b<x.length;b++){var m=x[b];if(R(m))return a(m)}return},R=function(v){return v&&v.key==="PRIV"&&v.info==="com.apple.streaming.transportStreamTimestamp"},p=function(v){var x=String.fromCharCode(v[0],v[1],v[2],v[3]),b=H(v,4),m=10;return{type:x,size:b,data:v.subarray(m,m+b)}},d=function(v){for(var x=0,b=[];B(v,x);){var m=H(v,x+6);x+=10;for(var s=x+m;x+8<s;){var g=p(v.subarray(x)),h=l(g);h&&b.push(h),x+=g.size+10}C(v,x)&&(x+=10)}return b},l=function(v){return v.type==="PRIV"?n(v):v.type[0]==="W"?u(v):o(v)},n=function(v){if(v.size<2)return;var x=r(v.data,!0),b=new Uint8Array(v.data.subarray(x.length+1));return{key:v.type,info:x,data:b.buffer}},o=function(v){if(v.size<2)return;if(v.type==="TXXX"){var x=1,b=r(v.data.subarray(x),!0);x+=b.length+1;var m=r(v.data.subarray(x));return{key:v.type,info:b,data:m}}var s=r(v.data.subarray(1));return{key:v.type,data:s}},u=function(v){if(v.type==="WXXX"){if(v.size<2)return;var x=1,b=r(v.data.subarray(x),!0);x+=b.length+1;var m=r(v.data.subarray(x));return{key:v.type,info:b,data:m}}var s=r(v.data);return{key:v.type,data:s}},a=function(v){if(v.data.byteLength===8){var x=new Uint8Array(v.data),b=x[3]&1,m=(x[4]<<23)+(x[5]<<15)+(x[6]<<7)+x[7];return m/=45,b&&(m+=4772185884e-2),Math.round(m)}return},r=function(v,x){x===void 0&&(x=!1);var b=_();if(b){var m=b.decode(v);if(x){var s=m.indexOf("\0");return s!==-1?m.substring(0,s):m}return m.replace(/\0/g,"")}for(var g=v.length,h,T,y,w="",P=0;P<g;){if(h=v[P++],h===0&&x)return w;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(h);break;case 12:case 13:T=v[P++],w+=String.fromCharCode((h&31)<<6|T&63);break;case 14:T=v[P++],y=v[P++],w+=String.fromCharCode((h&15)<<12|(T&63)<<6|(y&63)<<0);break;default:}}return w},i={decodeTextFrame:o},t;function _(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/demux/base-audio-demuxer.ts"),C=A("./src/demux/id3.ts"),I=A("./src/utils/logger.ts"),H=A("./src/demux/mpegaudio.ts");function U(p,d){p.prototype=Object.create(d.prototype),p.prototype.constructor=p,e(p,d)}function e(p,d){return e=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},e(p,d)}var R=function(p){U(d,p);function d(){return p.apply(this,arguments)||this}var l=d.prototype;return l.resetInitSegment=function(o,u,a){p.prototype.resetInitSegment.call(this,o,u,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:a,inputTimeScale:9e4,dropped:0}},d.probe=function(o){if(!o)return!1;for(var u=C.getID3Data(o,0)||[],a=u.length,r=o.length;a<r;a++)if(H.probe(o,a))return I.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(o,u){return H.canParse(o,u)},l.appendFrame=function(o,u,a){return this.initPTS===null?void 0:H.appendFrame(o,u,a,this.initPTS,this.frameIndex)},d}(B.default);R.minProbeByteLength=4,j.default=R},"./src/demux/mp4demuxer.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/utils/mp4-tools.ts"),C=A("./src/demux/dummy-demuxed-track.ts"),I=function(){function H(e,R){this.remainderData=null,this.config=void 0,this.config=R}var U=H.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},H.probe=function(R){return Object(B.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},U.demux=function(R){var p=R,d=Object(C.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(B.appendUint8Array)(this.remainderData,R));var l=Object(B.segmentValidRange)(p);this.remainderData=l.remainder,d.samples=l.valid||new Uint8Array}else d.samples=p;return{audioTrack:Object(C.dummyTrack)(),avcTrack:d,id3Track:Object(C.dummyTrack)(),textTrack:Object(C.dummyTrack)()}},U.flush=function(){var R=Object(C.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(C.dummyTrack)(),avcTrack:R,id3Track:Object(C.dummyTrack)(),textTrack:Object(C.dummyTrack)()}},U.demuxSampleAes=function(R,p,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},H}();I.minProbeByteLength=1024,j.default=I},"./src/demux/mpegaudio.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"appendFrame",function(){return e}),A.d(j,"parseHeader",function(){return R}),A.d(j,"isHeaderPattern",function(){return p}),A.d(j,"isHeader",function(){return d}),A.d(j,"canParse",function(){return l}),A.d(j,"probe",function(){return n});var B=null,C=[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],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function e(o,u,a,r,i){if(a+24>u.length)return;var t=R(u,a);if(t&&a+t.frameLength<=u.length){var _=t.samplesPerFrame*9e4/t.sampleRate,f=r+i*_,v={unit:u.subarray(a,a+t.frameLength),pts:f,dts:f};return o.config=[],o.channelCount=t.channelCount,o.samplerate=t.sampleRate,o.samples.push(v),{sample:v,length:t.frameLength,missing:0}}}function R(o,u){var a=o[u+1]>>3&3,r=o[u+1]>>1&3,i=o[u+2]>>4&15,t=o[u+2]>>2&3;if(a!==1&&i!==0&&i!==15&&t!==3){var _=o[u+2]>>1&1,f=o[u+3]>>6,v=a===3?3-r:r===3?3:4,x=C[v*14+i-1]*1e3,b=a===3?0:a===2?1:2,m=I[b*3+t],s=f===3?1:2,g=H[a][r],h=U[r],T=g*8*h,y=Math.floor(g*x/m+_)*h;if(B===null){var w=navigator.userAgent||"",P=w.match(/Chrome\/(\d+)/i);B=P?parseInt(P[1]):0}var L=!!B&&B<=87;return L&&r===2&&x>=224e3&&f===0&&(o[u+3]=o[u+3]|128),{sampleRate:m,channelCount:s,frameLength:y,samplesPerFrame:T}}}function p(o,u){return o[u]===255&&(o[u+1]&224)===224&&(o[u+1]&6)!==0}function d(o,u){return u+1<o.length&&p(o,u)}function l(o,u){var a=4;return p(o,u)&&a<=o.length-u}function n(o,u){if(u+1<o.length&&p(o,u)){var a=4,r=R(o,u),i=a;r!=null&&r.frameLength&&(i=r.frameLength);var t=u+i;return t===o.length||d(o,t)}return!1}},"./src/demux/sample-aes.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/crypt/decrypter.ts"),C=A("./src/demux/tsdemuxer.ts"),I=function(){function H(e,R,p){this.keyData=void 0,this.decrypter=void 0,this.keyData=p,this.decrypter=new B.default(e,R,{removePKCS7Padding:!1})}var U=H.prototype;return U.decryptBuffer=function(R,p){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,p)},U.decryptAacSample=function(R,p,d,l){var n=R[p].unit,o=n.subarray(16,n.length-n.length%16),u=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),a=this;this.decryptBuffer(u,function(r){var i=new Uint8Array(r);n.set(i,16),l||a.decryptAacSamples(R,p+1,d)})},U.decryptAacSamples=function(R,p,d){for(;;p++){if(p>=R.length){d();return}if(R[p].unit.length<32)continue;var l=this.decrypter.isSync();if(this.decryptAacSample(R,p,d,l),!l)return}},U.getAvcEncryptedData=function(R){for(var p=Math.floor((R.length-48)/160)*16+16,d=new Int8Array(p),l=0,n=32;n<=R.length-16;n+=160,l+=16)d.set(R.subarray(n,n+16),l);return d},U.getAvcDecryptedUnit=function(R,p){for(var d=new Uint8Array(p),l=0,n=32;n<=R.length-16;n+=160,l+=16)R.set(d.subarray(l,l+16),n);return R},U.decryptAvcSample=function(R,p,d,l,n,o){var u=Object(C.discardEPB)(n.data),a=this.getAvcEncryptedData(u),r=this;this.decryptBuffer(a.buffer,function(i){n.data=r.getAvcDecryptedUnit(u,i),o||r.decryptAvcSamples(R,p,d+1,l)})},U.decryptAvcSamples=function(R,p,d,l){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,d=0){if(p>=R.length){l();return}for(var n=R[p].units;!(d>=n.length);d++){var o=n[d];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var u=this.decrypter.isSync();if(this.decryptAvcSample(R,p,d,l,o,u),!u)return}}},H}();j.default=I},"./src/demux/transmuxer-interface.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return n});var B=A("./node_modules/webworkify-webpack/index.js"),C=A.n(B),I=A("./src/events.ts"),H=A("./src/demux/transmuxer.ts"),U=A("./src/utils/logger.ts"),e=A("./src/errors.ts"),R=A("./src/utils/mediasource-helper.ts"),p=A("./node_modules/eventemitter3/index.js"),d=A.n(p),l=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function o(a,r,i,t){var _=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=a,this.id=r,this.onTransmuxComplete=i,this.onFlush=t;var f=a.config,v=function(g,h){h=h||{},h.frag=_.frag,h.id=_.id,a.trigger(g,h)};this.observer=new p.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,v),this.observer.on(I.Events.ERROR,v);var x={mp4:l.isTypeSupported("video/mp4"),mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"')},b=navigator.vendor;if(f.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var m;try{m=this.worker=B("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(s){a.trigger(I.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(s.message+" ("+s.filename+":"+s.lineno+")")})},m.postMessage({cmd:"init",typeSupported:x,vendor:b,id:r,config:JSON.stringify(f)})}catch(s){U.logger.warn("Error in worker:",s),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new H.default(this.observer,x,f,b,r),this.worker=null}}else this.transmuxer=new H.default(this.observer,x,f,b,r)}var u=o.prototype;return u.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},u.push=function(r,i,t,_,f,v,x,b,m,s){var g=this;m.transmuxing.start=self.performance.now();var h=this.transmuxer,T=this.worker,y=v?v.start:f.start,w=f.decryptdata,P=this.frag,L=!(P&&f.cc===P.cc),S=!(P&&m.level===P.level),D=P?m.sn-P.sn:-1,F=this.part?m.part-this.part.index:1,O=!S&&(D===1||D===0&&F===1),W=self.performance.now();(S||D||f.stats.parsing.start===0)&&(f.stats.parsing.start=W),v&&(F||!O)&&(v.stats.parsing.start=W);var z=new H.TransmuxState(L,O,b,S,y);if(!O||L){U.logger.log("[transmuxer-interface, "+f.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
discontinuity: `+L+`
trackSwitch: `+S+`
contiguous: `+O+`
accurateTimeOffset: `+b+`
timeOffset: `+y);var Q=new H.TransmuxConfig(t,_,i,x,s);this.configureTransmuxer(Q)}if(this.frag=f,this.part=v,T)T.postMessage({cmd:"demux",data:r,decryptdata:w,chunkMeta:m,state:z},r instanceof ArrayBuffer?[r]:[]);else if(h){var q=h.push(r,w,m,z);Object(H.isPromise)(q)?q.then(function(me){g.handleTransmuxComplete(me)}):this.handleTransmuxComplete(q)}},u.flush=function(r){var i=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,_=this.worker;if(_)_.postMessage({cmd:"flush",chunkMeta:r});else if(t){var f=t.flush(r);Object(H.isPromise)(f)?f.then(function(v){i.handleFlushResult(v,r)}):this.handleFlushResult(f,r)}},u.handleFlushResult=function(r,i){var t=this;r.forEach(function(_){t.handleTransmuxComplete(_)}),this.onFlush(i)},u.onWorkerMessage=function(r){var i=r.data,t=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,t.trigger(i.event,i.data);break}}},u.configureTransmuxer=function(r){var i=this.worker,t=this.transmuxer;i?i.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},u.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},o}()},"./src/demux/transmuxer-worker.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return e});var B=A("./src/demux/transmuxer.ts"),C=A("./src/events.ts"),I=A("./src/utils/logger.ts"),H=A("./node_modules/eventemitter3/index.js"),U=A.n(H);function e(n){var o=new H.EventEmitter,u=function(r,i){n.postMessage({event:r,data:i})};o.on(C.Events.FRAG_DECRYPTED,u),o.on(C.Events.ERROR,u),n.addEventListener("message",function(a){var r=a.data;switch(r.cmd){case"init":{var i=JSON.parse(r.config);n.transmuxer=new B.default(o,r.typeSupported,i,r.vendor,r.id),Object(I.enableLogs)(i.debug),u("init",null);break}case"configure":{n.transmuxer.configure(r.config);break}case"demux":{var t=n.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(B.isPromise)(t)?t.then(function(v){R(n,v)}):R(n,t);break}case"flush":{var _=r.chunkMeta,f=n.transmuxer.flush(_);Object(B.isPromise)(f)?f.then(function(v){d(n,v,_)}):d(n,f,_);break}default:break}})}function R(n,o){if(l(o.remuxResult))return;var u=[],a=o.remuxResult,r=a.audio,i=a.video;r&&p(u,r),i&&p(u,i),n.postMessage({event:"transmuxComplete",data:o},u)}function p(n,o){o.data1&&n.push(o.data1.buffer),o.data2&&n.push(o.data2.buffer)}function d(n,o,u){o.forEach(function(a){R(n,a)}),n.postMessage({event:"flush",data:u})}function l(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i}),A.d(j,"isPromise",function(){return f}),A.d(j,"TransmuxConfig",function(){return v}),A.d(j,"TransmuxState",function(){return x});var B=A("./src/events.ts"),C=A("./src/errors.ts"),I=A("./src/crypt/decrypter.ts"),H=A("./src/demux/aacdemuxer.ts"),U=A("./src/demux/mp4demuxer.ts"),e=A("./src/demux/tsdemuxer.ts"),R=A("./src/demux/mp3demuxer.ts"),p=A("./src/remux/mp4-remuxer.ts"),d=A("./src/remux/passthrough-remuxer.ts"),l=A("./src/demux/chunk-cache.ts"),n=A("./src/utils/mp4-tools.ts"),o=A("./src/utils/logger.ts"),u;try{u=self.performance.now.bind(self.performance)}catch(b){o.logger.debug("Unable to use Performance API on this environment"),u=self.Date.now}var a=[{demux:e.default,remux:p.default},{demux:U.default,remux:d.default},{demux:H.default,remux:p.default},{demux:R.default,remux:p.default}],r=1024;a.forEach(function(b){var m=b.demux;r=Math.max(r,m.minProbeByteLength)});var i=function(){function b(s,g,h,T,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 l.default,this.observer=s,this.typeSupported=g,this.config=h,this.vendor=T,this.id=y}var m=b.prototype;return m.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},m.push=function(g,h,T,y){var w=this,P=T.transmuxing;P.executeStart=u();var L=new Uint8Array(g),S=this.cache,D=this.config,F=this.currentTransmuxState,O=this.transmuxConfig;y&&(this.currentTransmuxState=y);var W=t(L,h);if(W&&W.method==="AES-128"){var z=this.getDecrypter();if(D.enableSoftwareAES){var Q=z.softwareDecrypt(L,W.key.buffer,W.iv.buffer);if(!Q)return P.executeEnd=u(),_(T);L=new Uint8Array(Q)}else return this.decryptionPromise=z.webCryptoDecrypt(L,W.key.buffer,W.iv.buffer).then(function(Ae){var Se=w.push(Ae,null,T);return w.decryptionPromise=null,Se}),this.decryptionPromise}var q=y||F,me=q.contiguous,he=q.discontinuity,ce=q.trackSwitch,pe=q.accurateTimeOffset,ge=q.timeOffset,ee=O.audioCodec,J=O.videoCodec,Re=O.defaultInitPts,Me=O.duration,Ie=O.initSegmentData;if((he||ce)&&this.resetInitSegment(Ie,ee,J,Me),he&&this.resetInitialTimestamp(Re),me||this.resetContiguity(),this.needsProbing(L,he,ce)){if(S.dataLength){var Fe=S.flush();L=Object(n.appendUint8Array)(Fe,L)}this.configureTransmuxer(L,O)}var He=this.transmux(L,W,ge,pe,T),_e=this.currentTransmuxState;return _e.contiguous=!0,_e.discontinuity=!1,_e.trackSwitch=!1,P.executeEnd=u(),He},m.flush=function(g){var h=this,T=g.transmuxing;T.executeStart=u();var y=this.decrypter,w=this.cache,P=this.currentTransmuxState,L=this.decryptionPromise;if(L)return L.then(function(){return h.flush(g)});var S=[],D=P.timeOffset;if(y){var F=y.flush();F&&S.push(this.push(F,null,g))}var O=w.dataLength;w.reset();var W=this.demuxer,z=this.remuxer;if(!W||!z)return O>=r&&this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=u(),[_(g)];var Q=W.flush(D);return f(Q)?Q.then(function(q){return h.flushRemux(S,q,g),S}):(this.flushRemux(S,Q,g),S)},m.flushRemux=function(g,h,T){var y=h.audioTrack,w=h.avcTrack,P=h.id3Track,L=h.textTrack,S=this.currentTransmuxState,D=S.accurateTimeOffset,F=S.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var O=this.remuxer.remux(y,w,P,L,F,D,!0,this.id);g.push({remuxResult:O,chunkMeta:T}),T.transmuxing.executeEnd=u()},m.resetInitialTimestamp=function(g){var h=this.demuxer,T=this.remuxer;if(!h||!T)return;h.resetTimeStamp(g),T.resetTimeStamp(g)},m.resetContiguity=function(){var g=this.demuxer,h=this.remuxer;if(!g||!h)return;g.resetContiguity(),h.resetNextTimestamp()},m.resetInitSegment=function(g,h,T,y){var w=this.demuxer,P=this.remuxer;if(!w||!P)return;w.resetInitSegment(h,T,y),P.resetInitSegment(g,h,T)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(g,h,T,y,w){var P;return h&&h.method==="SAMPLE-AES"?P=this.transmuxSampleAes(g,h,T,y,w):P=this.transmuxUnencrypted(g,T,y,w),P},m.transmuxUnencrypted=function(g,h,T,y){var w=this.demuxer.demux(g,h,!1,!this.config.progressive),P=w.audioTrack,L=w.avcTrack,S=w.id3Track,D=w.textTrack,F=this.remuxer.remux(P,L,S,D,h,T,!1,this.id);return{remuxResult:F,chunkMeta:y}},m.transmuxSampleAes=function(g,h,T,y,w){var P=this;return this.demuxer.demuxSampleAes(g,h,T).then(function(L){var S=P.remuxer.remux(L.audioTrack,L.avcTrack,L.id3Track,L.textTrack,T,y,!1,P.id);return{remuxResult:S,chunkMeta:w}})},m.configureTransmuxer=function(g,h){for(var T=this.config,y=this.observer,w=this.typeSupported,P=this.vendor,L=h.audioCodec,S=h.defaultInitPts,D=h.duration,F=h.initSegmentData,O=h.videoCodec,W,z=0,Q=a.length;z<Q;z++)if(a[z].demux.probe(g)){W=a[z];break}W||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:U.default,remux:d.default});var q=this.demuxer,me=this.remuxer,he=W.remux,ce=W.demux;(!me||!(me instanceof he))&&(this.remuxer=new he(y,T,w,P)),(!q||!(q instanceof ce))&&(this.demuxer=new ce(y,T,w),this.probe=ce.probe),this.resetInitSegment(F,L,O,D),this.resetInitialTimestamp(S)},m.needsProbing=function(g,h,T){return!this.demuxer||!this.remuxer||h||T},m.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new I.default(this.observer,this.config)),g},b}();function t(b,m){var s=null;return b.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(s=m),s}var _=function(m){return{remuxResult:{},chunkMeta:m}};function f(b){return"then"in b&&b.then instanceof Function}var v=function(m,s,g,h,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=s,this.initSegmentData=g,this.duration=h,this.defaultInitPts=T},x=function(m,s,g,h,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=s,this.accurateTimeOffset=g,this.trackSwitch=h,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"discardEPB",function(){return _});var B=A("./src/demux/adts.ts"),C=A("./src/demux/mpegaudio.ts"),I=A("./src/demux/exp-golomb.ts"),H=A("./src/demux/id3.ts"),U=A("./src/demux/sample-aes.ts"),e=A("./src/events.ts"),R=A("./src/utils/mp4-tools.ts"),p=A("./src/utils/logger.ts"),d=A("./src/errors.ts"),l={video:1,audio:2,id3:3,text:4},n=function(){function f(x,b,m){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=x,this.config=b,this.typeSupported=m}f.probe=function(b){var m=f.syncOffset(b);return m<0?!1:(m&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},f.syncOffset=function(b){for(var m=Math.min(1e3,b.length-3*188),s=0;s<m;){if(b[s]===71&&b[s+188]===71&&b[s+2*188]===71)return s;s++}return-1},f.createTrack=function(b,m){return{container:b==="video"||b==="audio"?"video/mp2t":void 0,type:b,id:l[b],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:b==="audio"?m:void 0}};var v=f.prototype;return v.resetInitSegment=function(b,m,s){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video",s),this._audioTrack=f.createTrack("audio",s),this._id3Track=f.createTrack("id3",s),this._txtTrack=f.createTrack("text",s),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=b,this.videoCodec=m,this._duration=s},v.resetTimeStamp=function(){},v.resetContiguity=function(){var b=this._audioTrack,m=this._avcTrack,s=this._id3Track;b&&(b.pesData=null),m&&(m.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},v.demux=function(b,m,s,g){s===void 0&&(s=!1),g===void 0&&(g=!1),s||(this.sampleAes=null);var h,T=this._avcTrack,y=this._audioTrack,w=this._id3Track,P=T.pid,L=T.pesData,S=y.pid,D=w.pid,F=y.pesData,O=w.pesData,W=!1,z=this.pmtParsed,Q=this._pmtId,q=b.length;if(this.remainderData&&(b=Object(R.appendUint8Array)(this.remainderData,b),q=b.length,this.remainderData=null),q<188&&!g)return this.remainderData=b,{audioTrack:y,avcTrack:T,id3Track:w,textTrack:this._txtTrack};var me=Math.max(0,f.syncOffset(b));q-=(q+me)%188,q<b.byteLength&&!g&&(this.remainderData=new Uint8Array(b.buffer,q,b.buffer.byteLength-q));for(var he=me;he<q;he+=188)if(b[he]===71){var ce=!!(b[he+1]&64),pe=((b[he+1]&31)<<8)+b[he+2],ge=(b[he+3]&48)>>4,ee=void 0;if(ge>1){if(ee=he+5+b[he+4],ee===he+188)continue}else ee=he+4;switch(pe){case P:ce&&(L&&(h=r(L))&&this.parseAVCPES(h,!1),L={data:[],size:0}),L&&(L.data.push(b.subarray(ee,he+188)),L.size+=he+188-ee);break;case S:ce&&(F&&(h=r(F))&&(y.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),F={data:[],size:0}),F&&(F.data.push(b.subarray(ee,he+188)),F.size+=he+188-ee);break;case D:ce&&(O&&(h=r(O))&&this.parseID3PES(h),O={data:[],size:0}),O&&(O.data.push(b.subarray(ee,he+188)),O.size+=he+188-ee);break;case 0:ce&&(ee+=b[ee]+1),Q=this._pmtId=u(b,ee);break;case Q:{ce&&(ee+=b[ee]+1);var J=a(b,ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,s);P=J.avc,P>0&&(T.pid=P),S=J.audio,S>0&&(y.pid=S,y.isAAC=J.isAAC),D=J.id3,D>0&&(w.pid=D),W&&!z&&(p.logger.log("reparse from beginning"),W=!1,he=me-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=L,y.pesData=F,w.pesData=O;var Re={audioTrack:y,avcTrack:T,id3Track:w,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(Re),Re},v.flush=function(){var b=this.remainderData;this.remainderData=null;var m;return b?m=this.demux(b,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},v.extractRemainingSamples=function(b){var m=b.audioTrack,s=b.avcTrack,g=b.id3Track,h=s.pesData,T=m.pesData,y=g.pesData,w;h&&(w=r(h))?(this.parseAVCPES(w,!0),s.pesData=null):s.pesData=h,T&&(w=r(T))?(m.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),m.pesData=null):(T!=null&&T.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=T),y&&(w=r(y))?(this.parseID3PES(w),g.pesData=null):g.pesData=y},v.demuxSampleAes=function(b,m,s){var g=this.demux(b,s,!0,!this.config.progressive),h=this.sampleAes=new U.default(this.observer,this.config,m);return this.decrypt(g,h)},v.decrypt=function(b,m){return new Promise(function(s){var g=b.audioTrack,h=b.avcTrack;g.samples&&g.isAAC?m.decryptAacSamples(g.samples,0,function(){h.samples?m.decryptAvcSamples(h.samples,0,0,function(){s(b)}):s(b)}):h.samples&&m.decryptAvcSamples(h.samples,0,0,function(){s(b)})})},v.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},v.parseAVCPES=function(b,m){var s=this,g=this._avcTrack,h=this.parseAVCNALu(b.data),T=!1,y=this.avcSample,w,P=!1;b.data=null,y&&h.length&&!g.audFound&&(i(y,g),y=this.avcSample=o(!1,b.pts,b.dts,"")),h.forEach(function(L){switch(L.type){case 1:{w=!0,y||(y=s.avcSample=o(!0,b.pts,b.dts,"")),T&&(y.debug+="NDR "),y.frame=!0;var S=L.data;if(P&&S.length>4){var D=new I.default(S).readSliceType();(D===2||D===4||D===7||D===9)&&(y.key=!0)}break}case 5:w=!0,y||(y=s.avcSample=o(!0,b.pts,b.dts,"")),T&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{w=!0,T&&y&&(y.debug+="SEI ");var F=new I.default(_(L.data));F.readUByte();for(var O=0,W=0,z=!1,Q=0;!z&&F.bytesAvailable>1;){O=0;do Q=F.readUByte(),O+=Q;while(Q===255);W=0;do Q=F.readUByte(),W+=Q;while(Q===255);if(O===4&&F.bytesAvailable!==0){z=!0;var q=F.readUByte();if(q===181){var me=F.readUShort();if(me===49){var he=F.readUInt();if(he===1195456820){var ce=F.readUByte();if(ce===3){for(var pe=F.readUByte(),ge=F.readUByte(),ee=31&pe,J=[pe,ge],Re=0;Re<ee;Re++)J.push(F.readUByte()),J.push(F.readUByte()),J.push(F.readUByte());t(s._txtTrack.samples,{type:3,pts:b.pts,bytes:J})}}}}}else if(O===5&&F.bytesAvailable!==0){if(z=!0,W>16){for(var Me=[],Ie=0;Ie<16;Ie++)Me.push(F.readUByte().toString(16)),(Ie===3||Ie===5||Ie===7||Ie===9)&&Me.push("-");for(var Fe=W-16,He=new Uint8Array(Fe),_e=0;_e<Fe;_e++)He[_e]=F.readUByte();t(s._txtTrack.samples,{pts:b.pts,payloadType:O,uuid:Me.join(""),userData:Object(H.utf8ArrayToStr)(He),userDataBytes:He})}}else if(W<F.bytesAvailable)for(var Ae=0;Ae<W;Ae++)F.readUByte()}break}case 7:if(w=!0,P=!0,T&&y&&(y.debug+="SPS "),!g.sps){var Se=new I.default(L.data),X=Se.readSPS();g.width=X.width,g.height=X.height,g.pixelRatio=X.pixelRatio,g.sps=[L.data],g.duration=s._duration;for(var ne=L.data.subarray(1,4),ue="avc1.",de=0;de<3;de++){var xe=ne[de].toString(16);xe.length<2&&(xe="0"+xe),ue+=xe}g.codec=ue}break;case 8:w=!0,T&&y&&(y.debug+="PPS "),g.pps||(g.pps=[L.data]);break;case 9:w=!1,g.audFound=!0,y&&i(y,g),y=s.avcSample=o(!1,b.pts,b.dts,T?"AUD ":"");break;case 12:w=!1;break;default:w=!1,y&&(y.debug+="unknown NAL "+L.type+" ");break}if(y&&w){var Te=y.units;Te.push(L)}}),m&&y&&(i(y,g),this.avcSample=null)},v.getLastNalUnit=function(){var b,m=this.avcSample,s;if(!m||m.units.length===0){var g=this._avcTrack.samples;m=g[g.length-1]}if((b=m)!==null&&b!==void 0&&b.units){var h=m.units;s=h[h.length-1]}return s},v.parseAVCNALu=function(b){var m=b.byteLength,s=this._avcTrack,g=s.naluState||0,h=g,T=[],y=0,w,P,L,S=-1,D=0;for(g===-1&&(S=0,D=b[0]&31,g=0,y=1);y<m;){if(w=b[y++],!g){g=w?0:1;continue}if(g===1){g=w?0:2;continue}if(!w)g=3;else if(w===1){if(S>=0){var F={data:b.subarray(S,y-g-1),type:D};T.push(F)}else{var O=this.getLastNalUnit();if(O&&(h&&y<=4-h&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-h))),P=y-g-1,P>0)){var W=new Uint8Array(O.data.byteLength+P);W.set(O.data,0),W.set(b.subarray(0,P),O.data.byteLength),O.data=W,O.state=0}}y<m?(L=b[y]&31,S=y,D=L,g=0):g=-1}else g=0}if(S>=0&&g>=0){var z={data:b.subarray(S,m),type:D,state:g};T.push(z)}if(T.length===0){var Q=this.getLastNalUnit();if(Q){var q=new Uint8Array(Q.data.byteLength+b.byteLength);q.set(Q.data,0),q.set(b,Q.data.byteLength),Q.data=q}}return s.naluState=g,T},v.parseAACPES=function(b){var m=0,s=this._audioTrack,g=this.aacOverFlow,h=b.data;if(g){this.aacOverFlow=null;var T=g.sample.unit.byteLength,y=Math.min(g.missing,T),w=T-y;g.sample.unit.set(h.subarray(0,y),w),s.samples.push(g.sample),m=g.missing}var P,L;for(P=m,L=h.length;P<L-1&&!B.isHeader(h,P);P++);if(P!==m){var S,D;if(P<L-1?(S="AAC PES did not start with ADTS header,offset:"+P,D=!1):(S="no ADTS header found in AAC PES",D=!0),p.logger.warn("parsing error:"+S),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:D,reason:S}),D)return}B.initTrackConfig(s,this.observer,h,P,this.audioCodec);var F;if(b.pts!==void 0)F=b.pts;else if(g){var O=B.getFrameDuration(s.samplerate);F=g.sample.pts+O}else{p.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;P<L;)if(B.isHeader(h,P)){if(P+5<L){var z=B.appendFrame(s,h,P,F,W);if(z)if(z.missing)this.aacOverFlow=z;else{P+=z.length,W++;continue}}break}else P++},v.parseMPEGPES=function(b){var m=b.data,s=m.length,g=0,h=0,T=b.pts;if(T===void 0){p.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<s;)if(C.isHeader(m,h)){var y=C.appendFrame(this._audioTrack,m,h,T,g);if(y)h+=y.length,g++;else break}else h++},v.parseID3PES=function(b){if(b.pts===void 0){p.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(b)},f}();n.minProbeByteLength=188;function o(f,v,x,b){return{key:f,frame:!1,pts:v,dts:x,units:[],debug:b,length:0}}function u(f,v){return(f[v+10]&31)<<8|f[v+11]}function a(f,v,x,b){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},s=(f[v+1]&15)<<8|f[v+2],g=v+3+s-4,h=(f[v+10]&15)<<8|f[v+11];for(v+=12+h;v<g;){var T=(f[v+1]&31)<<8|f[v+2];switch(f[v]){case 207:if(!b){p.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=T);break;case 21:m.id3===-1&&(m.id3=T);break;case 219:if(!b){p.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=T);break;case 3:case 4:x?m.audio===-1&&(m.audio=T,m.isAAC=!1):p.logger.log("MPEG audio found, not supported in this browser");break;case 36:p.logger.warn("Unsupported HEVC stream type found");break;default:break}v+=((f[v+3]&15)<<8|f[v+4])+5}return m}function r(f){var v=0,x,b,m,s,g,h=f.data;if(!f||f.size===0)return null;for(;h[0].length<19&&h.length>1;){var T=new Uint8Array(h[0].length+h[1].length);T.set(h[0]),T.set(h[1],h[0].length),h[0]=T,h.splice(1,1)}x=h[0];var y=(x[0]<<16)+(x[1]<<8)+x[2];if(y===1){if(b=(x[4]<<8)+x[5],b&&b>f.size-6)return null;var w=x[7];w&192&&(s=(x[9]&14)*536870912+(x[10]&255)*4194304+(x[11]&254)*16384+(x[12]&255)*128+(x[13]&254)/2,w&64?(g=(x[14]&14)*536870912+(x[15]&255)*4194304+(x[16]&254)*16384+(x[17]&255)*128+(x[18]&254)/2,s-g>60*9e4&&(p.logger.warn(Math.round((s-g)/9e4)+"s delta between PTS and DTS, align them"),s=g)):g=s),m=x[8];var P=m+9;if(f.size<=P)return null;f.size-=P;for(var L=new Uint8Array(f.size),S=0,D=h.length;S<D;S++){x=h[S];var F=x.byteLength;if(P)if(P>F){P-=F;continue}else x=x.subarray(P),F-=P,P=0;L.set(x,v),v+=F}return b&&(b-=m+3),{data:L,pts:s,dts:g,len:b}}return null}function i(f,v){if(f.units.length&&f.frame){if(f.pts===void 0){var x=v.samples,b=x.length;if(b){var m=x[b-1];f.pts=m.pts,f.dts=m.dts}else{v.dropped++;return}}v.samples.push(f)}f.debug.length&&p.logger.log(f.pts+"/"+f.dts+":"+f.debug)}function t(f,v){var x=f.length;if(x>0){if(v.pts>=f[x-1].pts)f.push(v);else for(var b=x-1;b>=0;b--)if(v.pts<f[b].pts){f.splice(b,0,v);break}}else f.push(v)}function _(f){for(var v=f.byteLength,x=[],b=1;b<v-2;)f[b]===0&&f[b+1]===0&&f[b+2]===3?(x.push(b+2),b+=2):b++;if(x.length===0)return f;var m=v-x.length,s=new Uint8Array(m),g=0;for(b=0;b<m;g++,b++)g===x[0]&&(g++,x.shift()),s[b]=f[g];return s}j.default=n},"./src/errors.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"ErrorTypes",function(){return B}),A.d(j,"ErrorDetails",function(){return C});var B;(function(I){I.NETWORK_ERROR="networkError",I.MEDIA_ERROR="mediaError",I.KEY_SYSTEM_ERROR="keySystemError",I.MUX_ERROR="muxError",I.OTHER_ERROR="otherError"})(B||(B={}));var C;(function(I){I.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",I.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",I.KEY_SYSTEM_NO_SESSION="keySystemNoSession",I.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",I.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",I.MANIFEST_LOAD_ERROR="manifestLoadError",I.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",I.MANIFEST_PARSING_ERROR="manifestParsingError",I.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",I.LEVEL_EMPTY_ERROR="levelEmptyError",I.LEVEL_LOAD_ERROR="levelLoadError",I.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",I.LEVEL_SWITCH_ERROR="levelSwitchError",I.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",I.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",I.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",I.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",I.FRAG_LOAD_ERROR="fragLoadError",I.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",I.FRAG_DECRYPT_ERROR="fragDecryptError",I.FRAG_PARSING_ERROR="fragParsingError",I.REMUX_ALLOC_ERROR="remuxAllocError",I.KEY_LOAD_ERROR="keyLoadError",I.KEY_LOAD_TIMEOUT="keyLoadTimeOut",I.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",I.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",I.BUFFER_APPEND_ERROR="bufferAppendError",I.BUFFER_APPENDING_ERROR="bufferAppendingError",I.BUFFER_STALLED_ERROR="bufferStalledError",I.BUFFER_FULL_ERROR="bufferFullError",I.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",I.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",I.INTERNAL_EXCEPTION="internalException",I.INTERNAL_ABORTED="aborted",I.UNKNOWN="unknown"})(C||(C={}))},"./src/events.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"Events",function(){return B});var B;(function(C){C.MEDIA_ATTACHING="hlsMediaAttaching",C.MEDIA_ATTACHED="hlsMediaAttached",C.MEDIA_DETACHING="hlsMediaDetaching",C.MEDIA_DETACHED="hlsMediaDetached",C.BUFFER_RESET="hlsBufferReset",C.BUFFER_CODECS="hlsBufferCodecs",C.BUFFER_CREATED="hlsBufferCreated",C.BUFFER_APPENDING="hlsBufferAppending",C.BUFFER_APPENDED="hlsBufferAppended",C.BUFFER_EOS="hlsBufferEos",C.BUFFER_FLUSHING="hlsBufferFlushing",C.BUFFER_FLUSHED="hlsBufferFlushed",C.MANIFEST_LOADING="hlsManifestLoading",C.MANIFEST_LOADED="hlsManifestLoaded",C.MANIFEST_PARSED="hlsManifestParsed",C.LEVEL_SWITCHING="hlsLevelSwitching",C.LEVEL_SWITCHED="hlsLevelSwitched",C.LEVEL_LOADING="hlsLevelLoading",C.LEVEL_LOADED="hlsLevelLoaded",C.LEVEL_UPDATED="hlsLevelUpdated",C.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",C.LEVELS_UPDATED="hlsLevelsUpdated",C.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",C.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",C.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",C.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",C.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",C.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",C.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",C.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",C.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",C.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",C.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",C.CUES_PARSED="hlsCuesParsed",C.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",C.INIT_PTS_FOUND="hlsInitPtsFound",C.FRAG_LOADING="hlsFragLoading",C.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",C.FRAG_LOADED="hlsFragLoaded",C.FRAG_DECRYPTED="hlsFragDecrypted",C.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",C.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",C.FRAG_PARSING_METADATA="hlsFragParsingMetadata",C.FRAG_PARSED="hlsFragParsed",C.FRAG_BUFFERED="hlsFragBuffered",C.FRAG_CHANGED="hlsFragChanged",C.FPS_DROP="hlsFpsDrop",C.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",C.ERROR="hlsError",C.DESTROYING="hlsDestroying",C.KEY_LOADING="hlsKeyLoading",C.KEY_LOADED="hlsKeyLoaded",C.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",C.BACK_BUFFER_REACHED="hlsBackBufferReached"})(B||(B={}))},"./src/hls.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return f});var B=A("./node_modules/url-toolkit/src/url-toolkit.js"),C=A.n(B),I=A("./src/loader/playlist-loader.ts"),H=A("./src/loader/key-loader.ts"),U=A("./src/controller/id3-track-controller.ts"),e=A("./src/controller/latency-controller.ts"),R=A("./src/controller/level-controller.ts"),p=A("./src/controller/fragment-tracker.ts"),d=A("./src/controller/stream-controller.ts"),l=A("./src/is-supported.ts"),n=A("./src/utils/logger.ts"),o=A("./src/config.ts"),u=A("./node_modules/eventemitter3/index.js"),a=A.n(u),r=A("./src/events.ts"),i=A("./src/errors.ts");function t(v,x){for(var b=0;b<x.length;b++){var m=x[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(v,m.key,m)}}function _(v,x,b){return x&&t(v.prototype,x),b&&t(v,b),v}var f=function(){v.isSupported=function(){return Object(l.isSupported)()};function v(b){b===void 0&&(b={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new u.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var m=this.config=Object(o.mergeConfig)(v.DefaultConfig,b);this.userConfig=b,Object(n.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(o.enableStreamingMode)(m);var s=m.abrController,g=m.bufferController,h=m.capLevelController,T=m.fpsController,y=this.abrController=new s(this),w=this.bufferController=new g(this),P=this.capLevelController=new h(this),L=new T(this),S=new I.default(this),D=new H.default(this),F=new U.default(this),O=this.levelController=new R.default(this),W=new p.FragmentTracker(this),z=this.streamController=new d.default(this,W);P.setStreamController(z),L.setStreamController(z);var Q=[O,z];this.networkControllers=Q;var q=[S,D,y,w,P,L,F,W];this.audioTrackController=this.createController(m.audioTrackController,null,Q),this.createController(m.audioStreamController,W,Q),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,Q),this.createController(m.subtitleStreamController,W,Q),this.createController(m.timelineController,null,q),this.emeController=this.createController(m.emeController,null,q),this.cmcdController=this.createController(m.cmcdController,null,q),this.latencyController=this.createController(e.default,null,q),this.coreComponents=q}var x=v.prototype;return x.createController=function(m,s,g){if(m){var h=s?new m(this,s):new m(this);return g&&g.push(h),h}return null},x.on=function(m,s,g){g===void 0&&(g=this),this._emitter.on(m,s,g)},x.once=function(m,s,g){g===void 0&&(g=this),this._emitter.once(m,s,g)},x.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},x.off=function(m,s,g,h){g===void 0&&(g=this),this._emitter.off(m,s,g,h)},x.listeners=function(m){return this._emitter.listeners(m)},x.emit=function(m,s,g){return this._emitter.emit(m,s,g)},x.trigger=function(m,s){if(this.config.debug)return this.emit(m,m,s);try{return this.emit(m,m,s)}catch(g){n.logger.error("An internal error happened while handling event "+m+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(r.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:g})}return!1},x.listenerCount=function(m){return this._emitter.listenerCount(m)},x.destroy=function(){n.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},x.attachMedia=function(m){n.logger.log("attachMedia"),this._media=m,this.trigger(r.Events.MEDIA_ATTACHING,{media:m})},x.detachMedia=function(){n.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},x.loadSource=function(m){this.stopLoad();var s=this.media,g=this.url,h=this.url=B.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});n.logger.log("loadSource:"+h),s&&g&&g!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(s)),this.trigger(r.Events.MANIFEST_LOADING,{url:m})},x.startLoad=function(m){m===void 0&&(m=-1),n.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(s){s.startLoad(m)})},x.stopLoad=function(){n.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},x.swapAudioCodec=function(){n.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},x.recoverMediaError=function(){n.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},x.removeLevel=function(m,s){s===void 0&&(s=0),this.levelController.removeLevel(m,s)},_(v,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){n.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){n.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){n.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){n.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){n.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var s=!!m;s!==this.config.capLevelToPlayerSize&&(s?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=s)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(n.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,s=this.config.minAutoBitrate;if(!m)return 0;for(var g=m.length,h=0;h<g;h++)if(m[h].maxBitrate>s)return h;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,s=this.autoLevelCapping,g;return s===-1&&m&&m.length?g=m.length-1:g=s,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var s=this.audioTrackController;s&&(s.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var s=this.subtitleTrackController;s&&(s.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var s=this.subtitleTrackController;s&&(s.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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 r.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return v.defaultConfig?v.defaultConfig:o.hlsDefaultConfig},set:function(m){v.defaultConfig=m}}]),v}();f.defaultConfig=void 0},"./src/is-supported.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"isSupported",function(){return I}),A.d(j,"changeTypeSupported",function(){return H});var B=A("./src/utils/mediasource-helper.ts");function C(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var U=Object(B.getMediaSource)();if(!U)return!1;var e=C(),R=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!R&&!!p}function H(){var U,e=C();return typeof(e==null||((U=e.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return n}),A.d(j,"LoadError",function(){return u});var B=A("./src/polyfills/number.ts"),C=A("./src/errors.ts");function I(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,p(a,r)}function H(a){var r=typeof Map=="function"?new Map:void 0;return H=function(t){if(t===null||!R(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,_)}function _(){return U(t,arguments,d(this).constructor)}return _.prototype=Object.create(t.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p(_,t)},H(a)}function U(a,r,i){return e()?U=Reflect.construct:U=function(_,f,v){var x=[null];x.push.apply(x,f);var b=Function.bind.apply(_,x),m=new b;return v&&p(m,v.prototype),m},U.apply(null,arguments)}function e(){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 R(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function p(a,r){return p=Object.setPrototypeOf||function(t,_){return t.__proto__=_,t},p(a,r)}function d(a){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},d(a)}var l=Math.pow(2,17),n=function(){function a(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var r=a.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(t,_){var f=this,v=t.url;if(!v)return Promise.reject(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(v?"part list":"url")));this.abort();var x=this.config,b=x.fLoader,m=x.loader;return new Promise(function(s,g){f.loader&&f.loader.destroy();var h=f.loader=t.loader=b?new b(x):new m(x),T=o(t),y={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:l};t.stats=h.stats,h.load(T,y,{onSuccess:function(P,L,S,D){f.resetLoader(t,h),s({frag:t,part:null,payload:P.data,networkDetails:D})},onError:function(P,L,S){f.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:P,networkDetails:S}))},onAbort:function(P,L,S){f.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:S}))},onTimeout:function(P,L,S){f.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:S}))},onProgress:function(P,L,S,D){_&&_({frag:t,part:null,payload:S,networkDetails:D})}})})},r.loadPart=function(t,_,f){var v=this;this.abort();var x=this.config,b=x.fLoader,m=x.loader;return new Promise(function(s,g){v.loader&&v.loader.destroy();var h=v.loader=t.loader=b?new b(x):new m(x),T=o(t,_),y={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:l};_.stats=h.stats,h.load(T,y,{onSuccess:function(P,L,S,D){v.resetLoader(t,h),v.updateStatsFromPart(t,_);var F={frag:t,part:_,payload:P.data,networkDetails:D};f(F),s(F)},onError:function(P,L,S){v.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:_,response:P,networkDetails:S}))},onAbort:function(P,L,S){t.stats.aborted=_.stats.aborted,v.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:_,networkDetails:S}))},onTimeout:function(P,L,S){v.resetLoader(t,h),g(new u({type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:_,networkDetails:S}))}})})},r.updateStatsFromPart=function(t,_){var f=t.stats,v=_.stats,x=v.total;if(f.loaded+=v.loaded,x){var b=Math.round(t.duration/_.duration),m=Math.min(Math.round(f.loaded/x),b),s=b-m,g=s*Math.round(f.loaded/m);f.total=f.loaded+g}else f.total=Math.max(f.loaded,f.total);var h=f.loading,T=v.loading;h.start?h.first+=T.first-T.start:(h.start=T.start,h.first=T.first),h.end=T.end},r.resetLoader=function(t,_){t.loader=null,this.loader===_&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),_.destroy()},a}();function o(a,r){r===void 0&&(r=null);var i=r||a,t={frag:a,part:r,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},_=i.byteRangeStartOffset,f=i.byteRangeEndOffset;return Object(B.isFiniteNumber)(_)&&Object(B.isFiniteNumber)(f)&&(t.rangeStart=_,t.rangeEnd=f),t}var u=function(a){I(r,a);function r(i){for(var t,_=arguments.length,f=new Array(_>1?_-1:0),v=1;v<_;v++)f[v-1]=arguments[v];return t=a.call.apply(a,[this].concat(f))||this,t.data=void 0,t.data=i,t}return r}(H(Error))},"./src/loader/fragment.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"ElementaryStreamTypes",function(){return n}),A.d(j,"BaseSegment",function(){return o}),A.d(j,"Fragment",function(){return u}),A.d(j,"Part",function(){return a});var B=A("./src/polyfills/number.ts"),C=A("./node_modules/url-toolkit/src/url-toolkit.js"),I=A.n(C),H=A("./src/utils/logger.ts"),U=A("./src/loader/level-key.ts"),e=A("./src/loader/load-stats.ts");function R(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,p(r,i)}function p(r,i){return p=Object.setPrototypeOf||function(_,f){return _.__proto__=f,_},p(r,i)}function d(r,i){for(var t=0;t<i.length;t++){var _=i[t];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(r,_.key,_)}}function l(r,i,t){return i&&d(r.prototype,i),t&&d(r,t),r}var n;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(n||(n={}));var o=function(){function r(t){var _;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(_={},_[n.AUDIO]=null,_[n.VIDEO]=null,_[n.AUDIOVIDEO]=null,_),this.baseurl=t}var i=r.prototype;return i.setByteRange=function(_,f){var v=_.split("@",2),x=[];v.length===1?x[0]=f?f.byteRangeEndOffset:0:x[0]=parseInt(v[1]),x[1]=parseInt(v[0])+x[0],this._byteRange=x},l(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(C.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(_){this._url=_}}]),r}(),u=function(r){R(i,r);function i(_,f){var v;return v=r.call(this,f)||this,v._decryptdata=null,v.rawProgramDateTime=null,v.programDateTime=null,v.tagList=[],v.duration=0,v.sn=0,v.levelkey=void 0,v.type=void 0,v.loader=null,v.level=-1,v.cc=0,v.startPTS=void 0,v.endPTS=void 0,v.appendedPTS=void 0,v.startDTS=void 0,v.endDTS=void 0,v.start=0,v.deltaPTS=void 0,v.maxStartPTS=void 0,v.minEndPTS=void 0,v.stats=new e.LoadStats,v.urlId=0,v.data=void 0,v.bitrateTest=!1,v.title=null,v.initSegment=null,v.type=_,v}var t=i.prototype;return t.createInitializationVector=function(f){for(var v=new Uint8Array(16),x=12;x<16;x++)v[x]=f>>8*(15-x)&255;return v},t.setDecryptDataFromLevelKey=function(f,v){var x=f;return(f==null?void 0:f.method)==="AES-128"&&f.uri&&!f.iv&&(x=U.LevelKey.fromURI(f.uri),x.method=f.method,x.iv=this.createInitializationVector(v),x.keyFormat="identity"),x},t.setElementaryStreamInfo=function(f,v,x,b,m,s){s===void 0&&(s=!1);var g=this.elementaryStreams,h=g[f];if(!h){g[f]={startPTS:v,endPTS:x,startDTS:b,endDTS:m,partial:s};return}h.startPTS=Math.min(h.startPTS,v),h.endPTS=Math.max(h.endPTS,x),h.startDTS=Math.min(h.startDTS,b),h.endDTS=Math.max(h.endDTS,m)},t.clearElementaryStreamInfo=function(){var f=this.elementaryStreams;f[n.AUDIO]=null,f[n.VIDEO]=null,f[n.AUDIOVIDEO]=null},l(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var f=this.sn;typeof f!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),f=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,f)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(B.isFiniteNumber)(this.programDateTime))return null;var f=Object(B.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+f*1e3}},{key:"encrypted",get:function(){var f;return!!((f=this.decryptdata)!==null&&f!==void 0&&f.keyFormat&&this.decryptdata.uri)}}]),i}(o),a=function(r){R(i,r);function i(t,_,f,v,x){var b;b=r.call(this,f)||this,b.fragOffset=0,b.duration=0,b.gap=!1,b.independent=!1,b.relurl=void 0,b.fragment=void 0,b.index=void 0,b.stats=new e.LoadStats,b.duration=t.decimalFloatingPoint("DURATION"),b.gap=t.bool("GAP"),b.independent=t.bool("INDEPENDENT"),b.relurl=t.enumeratedString("URI"),b.fragment=_,b.index=v;var m=t.enumeratedString("BYTERANGE");return m&&b.setByteRange(m,x),x&&(b.fragOffset=x.fragOffset+x.duration),b}return l(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var _=this.elementaryStreams;return!!(_.audio||_.video||_.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return H});var B=A("./src/events.ts"),C=A("./src/errors.ts"),I=A("./src/utils/logger.ts"),H=function(){function U(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var e=U.prototype;return e._registerListeners=function(){this.hls.on(B.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(B.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var d=this.loaders[p];d&&d.destroy()}this.loaders={}},e.onKeyLoading=function(p,d){var l=d.frag,n=l.type,o=this.loaders[n];if(!l.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var u=l.decryptdata.uri;if(u!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(o&&(I.logger.warn("abort previous key loader for type:"+n),o.abort()),!u){I.logger.warn("key uri is falsy");return}var r=a.loader,i=l.loader=this.loaders[n]=new r(a);this.decrypturl=u,this.decryptkey=null;var t={url:u,frag:l,responseType:"arraybuffer"},_={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(t,_,f)}else this.decryptkey&&(l.decryptdata.key=this.decryptkey,this.hls.trigger(B.Events.KEY_LOADED,{frag:l}))},e.loadsuccess=function(p,d,l){var n=l.frag;if(!n.decryptdata){I.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(p.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(B.Events.KEY_LOADED,{frag:n})},e.loaderror=function(p,d){var l=d.frag,n=l.loader;n&&n.abort(),delete this.loaders[l.type],this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:p})},e.loadtimeout=function(p,d){var l=d.frag,n=l.loader;n&&n.abort(),delete this.loaders[l.type],this.hls.trigger(B.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},U}()},"./src/loader/level-details.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"LevelDetails",function(){return U});var B=A("./src/polyfills/number.ts");function C(e,R){for(var p=0;p<R.length;p++){var d=R[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function I(e,R,p){return R&&C(e.prototype,R),p&&C(e,p),e}var H=10,U=function(){function e(p){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=p}var R=e.prototype;return R.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var l=this.lastPartSn-d.lastPartSn,n=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!n||!!l,this.advanced=this.endSN>d.endSN||l>0||l===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},I(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(B.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var l=this.driftEnd-this.driftStart;return l*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"LevelKey",function(){return U});var B=A("./node_modules/url-toolkit/src/url-toolkit.js"),C=A.n(B);function I(e,R){for(var p=0;p<R.length;p++){var d=R[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function H(e,R,p){return R&&I(e.prototype,R),p&&I(e,p),e}var U=function(){e.fromURL=function(p,d){return new e(p,d)},e.fromURI=function(p){return new e(p)};function e(R,p){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,p?this._uri=Object(B.buildAbsoluteURL)(R,p,{alwaysNormalize:!0}):this._uri=R}return H(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"LoadStats",function(){return B});var B=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i});var B=A("./src/polyfills/number.ts"),C=A("./node_modules/url-toolkit/src/url-toolkit.js"),I=A.n(C),H=A("./src/loader/fragment.ts"),U=A("./src/loader/level-details.ts"),e=A("./src/loader/level-key.ts"),R=A("./src/utils/attr-list.ts"),p=A("./src/utils/logger.ts"),d=A("./src/utils/codecs.ts"),l=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,n=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),u=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function r(x){var b,m;return a.test((b=(m=C.parseURL(x))===null||m===void 0?void 0:m.path)!=null?b:"")}var i=function(){function x(){}return x.findGroup=function(m,s){for(var g=0;g<m.length;g++){var h=m[g];if(h.id===s)return h}},x.convertAVC1ToAVCOTI=function(m){var s=m.split(".");if(s.length>2){var g=s.shift()+".";return g+=parseInt(s.shift()).toString(16),g+=("000"+parseInt(s.shift()).toString(16)).substr(-4),g}return m},x.resolve=function(m,s){return C.buildAbsoluteURL(s,m,{alwaysNormalize:!0})},x.parseMasterPlaylist=function(m,s){var g=[],h={},T=!1;l.lastIndex=0;for(var y;(y=l.exec(m))!=null;)if(y[1]){var w=new R.AttrList(y[1]),P={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:x.resolve(y[2],s)},L=w.decimalResolution("RESOLUTION");L&&(P.width=L.width,P.height=L.height),t((w.CODECS||"").split(/[ ,]+/).filter(function(D){return D}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=x.convertAVC1ToAVCOTI(P.videoCodec)),g.push(P)}else if(y[3]){var S=new R.AttrList(y[3]);S["DATA-ID"]&&(T=!0,h[S["DATA-ID"]]=S)}return{levels:g,sessionData:T?h:null}},x.parseMasterPlaylistMedia=function(m,s,g,h){h===void 0&&(h=[]);var T,y=[],w=0;for(n.lastIndex=0;(T=n.exec(m))!==null;){var P=new R.AttrList(T[1]);if(P.TYPE===g){var L={attrs:P,bitrate:0,id:w++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:g,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?x.resolve(P.URI,s):""};if(h.length){var S=x.findGroup(h,L.groupId)||h[0];_(L,S,"audioCodec"),_(L,S,"textCodec")}y.push(L)}}return y},x.parseLevelPlaylist=function(m,s,g,h,T){var y=new U.LevelDetails(s),w=y.fragments,P=null,L=0,S=0,D=0,F=0,O=null,W=new H.Fragment(h,s),z,Q,q,me=-1,he=!1;for(o.lastIndex=0,y.m3u8=m;(z=o.exec(m))!==null;){he&&(he=!1,W=new H.Fragment(h,s),W.start=D,W.sn=L,W.cc=F,W.level=g,P&&(W.initSegment=P,W.rawProgramDateTime=P.rawProgramDateTime));var ce=z[1];if(ce){W.duration=parseFloat(ce);var pe=(" "+z[2]).slice(1);W.title=pe||null,W.tagList.push(pe?["INF",ce,pe]:["INF",ce])}else if(z[3])Object(B.isFiniteNumber)(W.duration)&&(W.start=D,q&&(W.levelkey=q),W.sn=L,W.level=g,W.cc=F,W.urlId=T,w.push(W),W.relurl=(" "+z[3]).slice(1),v(W,O),O=W,D+=W.duration,L++,S=0,he=!0);else if(z[4]){var ge=(" "+z[4]).slice(1);O?W.setByteRange(ge,O):W.setByteRange(ge)}else if(z[5])W.rawProgramDateTime=(" "+z[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),me===-1&&(me=w.length);else{if(z=z[0].match(u),!z){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(Q=1;Q<z.length&&!(typeof z[Q]!="undefined");Q++);var ee=(" "+z[Q]).slice(1),J=(" "+z[Q+1]).slice(1),Re=z[Q+2]?(" "+z[Q+2]).slice(1):"";switch(ee){case"PLAYLIST-TYPE":y.type=J.toUpperCase();break;case"MEDIA-SEQUENCE":L=y.startSN=parseInt(J);break;case"SKIP":{var Me=new R.AttrList(J),Ie=Me.decimalInteger("SKIPPED-SEGMENTS");if(Object(B.isFiniteNumber)(Ie)){y.skippedSegments=Ie;for(var Fe=Ie;Fe--;)w.unshift(null);L+=Ie}var He=Me.enumeratedString("RECENTLY-REMOVED-DATERANGES");He&&(y.recentlyRemovedDateranges=He.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(J);break;case"VERSION":y.version=parseInt(J);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(J||Re)&&W.tagList.push(Re?[J,Re]:[J]);break;case"DIS":F++;case"GAP":W.tagList.push([ee]);break;case"BITRATE":W.tagList.push([ee,J]);break;case"DISCONTINUITY-SEQ":F=parseInt(J);break;case"KEY":{var _e,Ae=new R.AttrList(J),Se=Ae.enumeratedString("METHOD"),X=Ae.URI,ne=Ae.hexadecimalInteger("IV"),ue=Ae.enumeratedString("KEYFORMATVERSIONS"),de=Ae.enumeratedString("KEYID"),xe=(_e=Ae.enumeratedString("KEYFORMAT"))!=null?_e:"identity",Te=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Te.indexOf(xe)>-1){p.logger.warn("Keyformat "+xe+" is not supported from the manifest");continue}else if(xe!=="identity")continue;Se&&(q=e.LevelKey.fromURL(s,X),X&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Se)>=0&&(q.method=Se,q.keyFormat=xe,de&&(q.keyID=de),ue&&(q.keyFormatVersions=ue),q.iv=ne));break}case"START":{var Le=new R.AttrList(J),Pe=Le.decimalFloatingPoint("TIME-OFFSET");Object(B.isFiniteNumber)(Pe)&&(y.startTimeOffset=Pe);break}case"MAP":{var oe=new R.AttrList(J);W.relurl=oe.URI,oe.BYTERANGE&&W.setByteRange(oe.BYTERANGE),W.level=g,W.sn="initSegment",q&&(W.levelkey=q),W.initSegment=null,P=W,he=!0;break}case"SERVER-CONTROL":{var ke=new R.AttrList(J);y.canBlockReload=ke.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=ke.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&ke.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=ke.optionalFloat("PART-HOLD-BACK",0),y.holdBack=ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var De=new R.AttrList(J);y.partTarget=De.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=y.partList;Ce||(Ce=y.partList=[]);var Ge=S>0?Ce[Ce.length-1]:void 0,Be=S++,ve=new H.Part(new R.AttrList(J),W,s,Be,Ge);Ce.push(ve),W.duration+=ve.duration;break}case"PRELOAD-HINT":{var be=new R.AttrList(J);y.preloadHint=be;break}case"RENDITION-REPORT":{var se=new R.AttrList(J);y.renditionReports=y.renditionReports||[],y.renditionReports.push(se);break}default:p.logger.warn("line parsed but not handled: "+z);break}}}O&&!O.relurl?(w.pop(),D-=O.duration,y.partList&&(y.fragmentHint=O)):y.partList&&(v(W,O),W.cc=F,y.fragmentHint=W);var re=w.length,ae=w[0],V=w[re-1];if(D+=y.skippedSegments*y.targetduration,D>0&&re&&V){y.averagetargetduration=D/re;var Y=V.sn;y.endSN=Y!=="initSegment"?Y:0,ae&&(y.startCC=ae.cc,ae.initSegment||y.fragments.every(function($){return $.relurl&&r($.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new H.Fragment(h,s),W.relurl=V.relurl,W.level=g,W.sn="initSegment",ae.initSegment=W,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(D+=y.fragmentHint.duration),y.totalduration=D,y.endCC=F,me>0&&f(w,me),y},x}();function t(x,b){["video","audio","text"].forEach(function(m){var s=x.filter(function(h){return Object(d.isCodecType)(h,m)});if(s.length){var g=s.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});b[m+"Codec"]=g.length>0?g[0]:s[0],x=x.filter(function(h){return s.indexOf(h)===-1})}}),b.unknownCodecs=x}function _(x,b,m){var s=b[m];s&&(x[m]=s)}function f(x,b){for(var m=x[b],s=b;s--;){var g=x[s];if(!g)return;g.programDateTime=m.programDateTime-g.duration*1e3,m=g}}function v(x,b){x.rawProgramDateTime?x.programDateTime=Date.parse(x.rawProgramDateTime):b!=null&&b.programDateTime&&(x.programDateTime=b.endProgramDateTime),Object(B.isFiniteNumber)(x.programDateTime)||(x.programDateTime=null,x.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/polyfills/number.ts"),C=A("./src/events.ts"),I=A("./src/errors.ts"),H=A("./src/utils/logger.ts"),U=A("./src/utils/mp4-tools.ts"),e=A("./src/loader/m3u8-parser.ts"),R=A("./src/types/loader.ts"),p=A("./src/utils/attr-list.ts");function d(o){var u=o.type;switch(u){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function l(o,u){var a=o.url;return(a===void 0||a.indexOf("data:")===0)&&(a=u.url),a}var n=function(){function o(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var u=o.prototype;return u.registerListeners=function(){var r=this.hls;r.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(C.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(C.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.unregisterListeners=function(){var r=this.hls;r.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(C.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(C.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(C.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.createInternalLoader=function(r){var i=this.hls.config,t=i.pLoader,_=i.loader,f=t||_,v=new f(i);return r.loader=v,this.loaders[r.type]=v,v},u.getInternalLoader=function(r){return this.loaders[r.type]},u.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},u.destroyInternalLoaders=function(){for(var r in this.loaders){var i=this.loaders[r];i&&i.destroy(),this.resetInternalLoader(r)}},u.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},u.onManifestLoading=function(r,i){var t=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},u.onLevelLoading=function(r,i){var t=i.id,_=i.level,f=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:null,level:_,responseType:"text",type:R.PlaylistContextType.LEVEL,url:f,deliveryDirectives:v})},u.onAudioTrackLoading=function(r,i){var t=i.id,_=i.groupId,f=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:_,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:f,deliveryDirectives:v})},u.onSubtitleTrackLoading=function(r,i){var t=i.id,_=i.groupId,f=i.url,v=i.deliveryDirectives;this.load({id:t,groupId:_,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:f,deliveryDirectives:v})},u.load=function(r){var i,t=this.hls.config,_=this.getInternalLoader(r);if(_){var f=_.context;if(f&&f.url===r.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),_.abort()}var v,x,b,m;switch(r.type){case R.PlaylistContextType.MANIFEST:v=t.manifestLoadingMaxRetry,x=t.manifestLoadingTimeOut,b=t.manifestLoadingRetryDelay,m=t.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:v=0,x=t.levelLoadingTimeOut;break;default:v=t.levelLoadingMaxRetry,x=t.levelLoadingTimeOut,b=t.levelLoadingRetryDelay,m=t.levelLoadingMaxRetryTimeout;break}if(_=this.createInternalLoader(r),(i=r.deliveryDirectives)!==null&&i!==void 0&&i.part){var s;if(r.type===R.PlaylistContextType.LEVEL&&r.level!==null?s=this.hls.levels[r.level].details:r.type===R.PlaylistContextType.AUDIO_TRACK&&r.id!==null?s=this.hls.audioTracks[r.id].details:r.type===R.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(s=this.hls.subtitleTracks[r.id].details),s){var g=s.partTarget,h=s.targetduration;g&&h&&(x=Math.min(Math.max(g*3,h*.8)*1e3,x))}}var T={timeout:x,maxRetry:v,retryDelay:b,maxRetryDelay:m,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};_.load(r,T,y)},u.loadsuccess=function(r,i,t,_){if(_===void 0&&(_=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,i,t,_);return}this.resetInternalLoader(t.type);var f=r.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",_);return}i.parsing.start=performance.now(),f.indexOf("#EXTINF:")>0||f.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,i,t,_):this.handleMasterPlaylist(r,i,t,_)},u.loaderror=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!1,r)},u.loadtimeout=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!0)},u.handleMasterPlaylist=function(r,i,t,_){var f=this.hls,v=r.data,x=l(r,t),b=e.default.parseMasterPlaylist(v,x),m=b.levels,s=b.sessionData;if(!m.length){this.handleManifestParsingError(r,t,"no level found in manifest",_);return}var g=m.map(function(L){return{id:L.attrs.AUDIO,audioCodec:L.audioCodec}}),h=m.map(function(L){return{id:L.attrs.SUBTITLES,textCodec:L.textCodec}}),T=e.default.parseMasterPlaylistMedia(v,x,"AUDIO",g),y=e.default.parseMasterPlaylistMedia(v,x,"SUBTITLES",h),w=e.default.parseMasterPlaylistMedia(v,x,"CLOSED-CAPTIONS");if(T.length){var P=T.some(function(L){return!L.url});!P&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}f.trigger(C.Events.MANIFEST_LOADED,{levels:m,audioTracks:T,subtitles:y,captions:w,url:x,stats:i,networkDetails:_,sessionData:s})},u.handleTrackOrLevelPlaylist=function(r,i,t,_){var f=this.hls,v=t.id,x=t.level,b=t.type,m=l(r,t),s=Object(B.isFiniteNumber)(v)?v:0,g=Object(B.isFiniteNumber)(x)?x:s,h=d(t),T=e.default.parseLevelPlaylist(r.data,m,g,h,s);if(!T.fragments.length){f.trigger(C.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(b===R.PlaylistContextType.MANIFEST){var y={attrs:new p.AttrList({}),bitrate:0,details:T,name:"",url:m};f.trigger(C.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:m,stats:i,networkDetails:_,sessionData:null})}if(i.parsing.end=performance.now(),T.needSidxRanges){var w,P=(w=T.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:P,isSidxRequest:!0,type:b,level:x,levelDetails:T,id:v,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=T,this.handlePlaylistLoaded(r,i,t,_)},u.handleSidxRequest=function(r,i){var t=Object(U.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var _=t.references,f=i.levelDetails;_.forEach(function(v,x){var b=v.info,m=f.fragments[x];m.byteRange.length===0&&m.setByteRange(String(1+b.end-b.start)+"@"+String(b.start)),m.initSegment&&m.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},u.handleManifestParsingError=function(r,i,t,_){this.hls.trigger(C.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===R.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:i,networkDetails:_})},u.handleNetworkError=function(r,i,t,_){t===void 0&&(t=!1),H.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var f=I.ErrorDetails.UNKNOWN,v=!1,x=this.getInternalLoader(r);switch(r.type){case R.PlaylistContextType.MANIFEST:f=t?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,v=!0;break;case R.PlaylistContextType.LEVEL:f=t?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,v=!1;break;case R.PlaylistContextType.AUDIO_TRACK:f=t?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,v=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:f=t?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,v=!1;break}x&&this.resetInternalLoader(r.type);var b={type:I.ErrorTypes.NETWORK_ERROR,details:f,fatal:v,url:r.url,loader:x,context:r,networkDetails:i};_&&(b.response=_),this.hls.trigger(C.Events.ERROR,b)},u.handlePlaylistLoaded=function(r,i,t,_){var f=t.type,v=t.level,x=t.id,b=t.groupId,m=t.loader,s=t.levelDetails,g=t.deliveryDirectives;if(!(s!=null&&s.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",_);return}if(!m)return;s.live&&(m.getCacheAge&&(s.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(s.ageHeader))&&(s.ageHeader=0));switch(f){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(C.Events.LEVEL_LOADED,{details:s,level:v||0,id:x||0,stats:i,networkDetails:_,deliveryDirectives:g});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(C.Events.AUDIO_TRACK_LOADED,{details:s,id:x||0,groupId:b||"",stats:i,networkDetails:_,deliveryDirectives:g});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(C.Events.SUBTITLE_TRACK_LOADED,{details:s,id:x||0,groupId:b||"",stats:i,networkDetails:_,deliveryDirectives:g});break}},o}();j.default=n},"./src/polyfills/number.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"isFiniteNumber",function(){return B}),A.d(j,"MAX_SAFE_INTEGER",function(){return C});var B=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},C=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,j,A){"use strict";A.r(j);var B=function(){function C(){}return C.getSilentFrame=function(H,U){switch(H){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===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},C}();j.default=B},"./src/remux/mp4-generator.ts":function(te,j,A){"use strict";A.r(j);var B=Math.pow(2,32)-1,C=function(){function I(){}return I.init=function(){I.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 U;for(U in I.types)I.types.hasOwnProperty(U)&&(I.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var e=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]);I.HDLR_TYPES={video:e,audio:R};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);I.STTS=I.STSC=I.STCO=d,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var l=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,l,o,l,n),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,p))},I.box=function(U){for(var e=8,R=arguments.length,p=new Array(R>1?R-1:0),d=1;d<R;d++)p[d-1]=arguments[d];for(var l=p.length,n=l;l--;)e+=p[l].byteLength;var o=new Uint8Array(e);for(o[0]=e>>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=e&255,o.set(U,4),l=0,e=8;l<n;l++)o.set(p[l],e),e+=p[l].byteLength;return o},I.hdlr=function(U){return I.box(I.types.hdlr,I.HDLR_TYPES[U])},I.mdat=function(U){return I.box(I.types.mdat,U)},I.mdhd=function(U,e){e*=U;var R=Math.floor(e/(B+1)),p=Math.floor(e%(B+1));return I.box(I.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,R>>24,R>>16&255,R>>8&255,R&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},I.mdia=function(U){return I.box(I.types.mdia,I.mdhd(U.timescale,U.duration),I.hdlr(U.type),I.minf(U))},I.mfhd=function(U){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},I.minf=function(U){return U.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(U)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(U))},I.moof=function(U,e,R){return I.box(I.types.moof,I.mfhd(U),I.traf(R,e))},I.moov=function(U){for(var e=U.length,R=[];e--;)R[e]=I.trak(U[e]);return I.box.apply(null,[I.types.moov,I.mvhd(U[0].timescale,U[0].duration)].concat(R).concat(I.mvex(U)))},I.mvex=function(U){for(var e=U.length,R=[];e--;)R[e]=I.trex(U[e]);return I.box.apply(null,[I.types.mvex].concat(R))},I.mvhd=function(U,e){e*=U;var R=Math.floor(e/(B+1)),p=Math.floor(e%(B+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,R>>24,R>>16&255,R>>8&255,R&255,p>>24,p>>16&255,p>>8&255,p&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 I.box(I.types.mvhd,d)},I.sdtp=function(U){var e=U.samples||[],R=new Uint8Array(4+e.length),p,d;for(p=0;p<e.length;p++)d=e[p].flags,R[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return I.box(I.types.sdtp,R)},I.stbl=function(U){return I.box(I.types.stbl,I.stsd(U),I.box(I.types.stts,I.STTS),I.box(I.types.stsc,I.STSC),I.box(I.types.stsz,I.STSZ),I.box(I.types.stco,I.STCO))},I.avc1=function(U){var e=[],R=[],p,d,l;for(p=0;p<U.sps.length;p++)d=U.sps[p],l=d.byteLength,e.push(l>>>8&255),e.push(l&255),e=e.concat(Array.prototype.slice.call(d));for(p=0;p<U.pps.length;p++)d=U.pps[p],l=d.byteLength,R.push(l>>>8&255),R.push(l&255),R=R.concat(Array.prototype.slice.call(d));var n=I.box(I.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|U.sps.length].concat(e).concat([U.pps.length]).concat(R))),o=U.width,u=U.height,a=U.pixelRatio[0],r=U.pixelRatio[1];return I.box(I.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,o>>8&255,o&255,u>>8&255,u&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]),n,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255])))},I.esds=function(U){var e=U.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(U.config).concat([6,1,2]))},I.mp4a=function(U){var e=U.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),I.box(I.types.esds,I.esds(U)))},I.mp3=function(U){var e=U.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},I.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(U)):I.box(I.types.stsd,I.STSD,I.mp4a(U)):I.box(I.types.stsd,I.STSD,I.avc1(U))},I.tkhd=function(U){var e=U.id,R=U.duration*U.timescale,p=U.width,d=U.height,l=Math.floor(R/(B+1)),n=Math.floor(R%(B+1));return I.box(I.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,n>>24,n>>16&255,n>>8&255,n&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,p>>8&255,p&255,0,0,d>>8&255,d&255,0,0]))},I.traf=function(U,e){var R=I.sdtp(U),p=U.id,d=Math.floor(e/(B+1)),l=Math.floor(e%(B+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),I.box(I.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,l>>24,l>>16&255,l>>8&255,l&255])),I.trun(U,R.length+16+20+8+16+8+8),R)},I.trak=function(U){return U.duration=U.duration||4294967295,I.box(I.types.trak,I.tkhd(U),I.mdia(U))},I.trex=function(U){var e=U.id;return I.box(I.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},I.trun=function(U,e){var R=U.samples||[],p=R.length,d=12+16*p,l=new Uint8Array(d),n,o,u,a,r,i;for(e+=8+d,l.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),n=0;n<p;n++)o=R[n],u=o.duration,a=o.size,r=o.flags,i=o.cts,l.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*n);return I.box(I.types.trun,l)},I.initSegment=function(U){I.types||I.init();var e=I.moov(U),R=new Uint8Array(I.FTYP.byteLength+e.byteLength);return R.set(I.FTYP),R.set(e,I.FTYP.byteLength),R},I}();C.types=void 0,C.HDLR_TYPES=void 0,C.STTS=void 0,C.STSC=void 0,C.STCO=void 0,C.STSZ=void 0,C.VMHD=void 0,C.SMHD=void 0,C.STSD=void 0,C.FTYP=void 0,C.DINF=void 0,j.default=C},"./src/remux/mp4-remuxer.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return i}),A.d(j,"normalizePts",function(){return t});var B=A("./src/polyfills/number.ts"),C=A("./src/remux/aac-helper.ts"),I=A("./src/remux/mp4-generator.ts"),H=A("./src/events.ts"),U=A("./src/errors.ts"),e=A("./src/utils/logger.ts"),R=A("./src/types/loader.ts"),p=A("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(x){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var s in m)Object.prototype.hasOwnProperty.call(m,s)&&(x[s]=m[s])}return x},d.apply(this,arguments)}var l=10*1e3,n=1024,o=1152,u=null,a=null,r=!1,i=function(){function x(m,s,g,h){if(h===void 0&&(h=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=m,this.config=s,this.typeSupported=g,this.ISGenerated=!1,u===null){var T=navigator.userAgent||"",y=T.match(/Chrome\/(\d+)/i);u=y?parseInt(y[1]):0}if(a===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);a=w?parseInt(w[1]):0}r=!!u&&u<75||!!a&&a<600}var b=x.prototype;return b.destroy=function(){},b.resetTimeStamp=function(s){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=s},b.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},b.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},b.getVideoStartPts=function(s){var g=!1,h=s.reduce(function(T,y){var w=y.pts-T;return w<-4294967296?(g=!0,t(T,y.pts)):w>0?T:y.pts},s[0].pts);return g&&e.logger.debug("PTS rollover detected"),h},b.remux=function(s,g,h,T,y,w,P,L){var S,D,F,O,W,z,Q=y,q=y,me=s.pid>-1,he=g.pid>-1,ce=g.samples.length,pe=s.samples.length>0,ge=ce>1,ee=(!me||pe)&&(!he||ge)||this.ISGenerated||P;if(ee){this.ISGenerated||(F=this.generateIS(s,g,y));var J=this.isVideoContiguous,Re=-1;if(ge&&(Re=_(g.samples),!J&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,Re>0){e.logger.warn("[mp4-remuxer]: Dropped "+Re+" out of "+ce+" video samples due to a missing keyframe");var Me=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(Re),g.dropped+=Re,q+=(g.samples[0].pts-Me)/(g.timescale||9e4)}else Re===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ce+" video samples"),z=!1);if(this.ISGenerated){if(pe&&ge){var Ie=this.getVideoStartPts(g.samples),Fe=t(s.samples[0].pts,Ie)-Ie,He=Fe/g.inputTimeScale;Q+=Math.max(0,He),q+=Math.max(0,-He)}if(pe){if(s.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(s,g,y)),D=this.remuxAudio(s,Q,this.isAudioContiguous,w,he||ge||L===R.PlaylistLevelType.AUDIO?q:void 0),ge){var _e=D?D.endPTS-D.startPTS:0;g.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(s,g,y)),S=this.remuxVideo(g,q,J,_e)}}else ge&&(S=this.remuxVideo(g,q,J,0));S&&(S.firstKeyFrame=Re,S.independent=Re!==-1)}}return this.ISGenerated&&(h.samples.length&&(W=this.remuxID3(h,y)),T.samples.length&&(O=this.remuxText(T,y))),{audio:D,video:S,initSegment:F,independent:z,text:O,id3:W}},b.generateIS=function(s,g,h){var T=s.samples,y=g.samples,w=this.typeSupported,P={},L=!Object(B.isFiniteNumber)(this._initPTS),S="audio/mp4",D,F,O;if(L&&(D=F=Infinity),s.config&&T.length&&(s.timescale=s.samplerate,s.isAAC||(w.mpeg?(S="audio/mpeg",s.codec=""):w.mp3&&(s.codec="mp3")),P.audio={id:"audio",container:S,codec:s.codec,initSegment:!s.isAAC&&w.mpeg?new Uint8Array(0):I.default.initSegment([s]),metadata:{channelCount:s.channelCount}},L&&(O=s.inputTimeScale,D=F=T[0].pts-Math.round(O*h))),g.sps&&g.pps&&y.length&&(g.timescale=g.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:I.default.initSegment([g]),metadata:{width:g.width,height:g.height}},L)){O=g.inputTimeScale;var W=this.getVideoStartPts(y),z=Math.round(O*h);F=Math.min(F,t(y[0].dts,W)-z),D=Math.min(D,W-z)}if(Object.keys(P).length)return this.ISGenerated=!0,L&&(this._initPTS=D,this._initDTS=F),{tracks:P,initPTS:D,timescale:O}},b.remuxVideo=function(s,g,h,T){var y=s.inputTimeScale,w=s.samples,P=[],L=w.length,S=this._initPTS,D=this.nextAvcDts,F=8,O,W,z,Q=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,me=0,he=!1;if(!h||D===null){var ce=g*y,pe=w[0].pts-t(w[0].dts,w[0].pts);D=ce-pe}for(var ge=0;ge<L;ge++){var ee=w[ge];if(ee.pts=t(ee.pts-S,D),ee.dts=t(ee.dts-S,D),ee.dts>ee.pts){var J=9e4*.2;me=Math.max(Math.min(me,ee.pts-ee.dts),-1*J)}ee.dts<w[ge>0?ge-1:ge].dts&&(he=!0)}he&&w.sort(function(Ve,qe){var ze=Ve.dts-qe.dts,rt=Ve.pts-qe.pts;return ze||rt}),W=w[0].dts,z=w[w.length-1].dts;var Re=Math.round((z-W)/(L-1));if(me<0){if(me<Re*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(p.toMsFromMpegTsClock)(-Re,!0)+" ms");for(var Me=me,Ie=0;Ie<L;Ie++)w[Ie].dts=Me=Math.max(Me,w[Ie].pts-Re),w[Ie].pts=Math.max(Me,w[Ie].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(p.toMsFromMpegTsClock)(me,!0)+" ms to overcome this issue");for(var Fe=0;Fe<L;Fe++)w[Fe].dts=w[Fe].dts+me}W=w[0].dts}if(h){var He=W-D,_e=He>Re,Ae=He<-1;if(_e||Ae){_e?e.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(He,!0)+" ms ("+He+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-He,!0)+" ms ("+He+"dts) overlapping between fragments detected"),W=D;var Se=w[0].pts-He;w[0].dts=W,w[0].pts=Se,e.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(Se,!0)+"/"+Object(p.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(He,!0)+" ms")}}r&&(W=Math.max(0,W));for(var X=0,ne=0,ue=0;ue<L;ue++){for(var de=w[ue],xe=de.units,Te=xe.length,Le=0,Pe=0;Pe<Te;Pe++)Le+=xe[Pe].data.length;ne+=Le,X+=Te,de.length=Le,de.dts=Math.max(de.dts,W),de.pts=Math.max(de.pts,de.dts,0),Q=Math.min(de.pts,Q),q=Math.max(de.pts,q)}z=w[L-1].dts;var oe=ne+4*X+8,ke;try{ke=new Uint8Array(oe)}catch(Ve){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:oe,reason:"fail allocating video mdat "+oe});return}var De=new DataView(ke.buffer);De.setUint32(0,oe),ke.set(I.default.types.mdat,4);for(var Ce=0;Ce<L;Ce++){for(var Ge=w[Ce],Be=Ge.units,ve=0,be=0,se=Be.length;be<se;be++){var re=Be[be],ae=re.data,V=re.data.byteLength;De.setUint32(F,V),F+=4,ke.set(ae,F),F+=V,ve+=4+V}if(Ce<L-1)O=w[Ce+1].dts-Ge.dts;else{var Y=this.config,$=Ge.dts-w[Ce>0?Ce-1:Ce].dts;if(Y.stretchShortVideoTrack&&this.nextAudioPts!==null){var Z=Math.floor(Y.maxBufferHole*y),fe=(T?Q+T*y:this.nextAudioPts)-Ge.pts;fe>Z?(O=fe-$,O<0&&(O=$),e.logger.log("[mp4-remuxer]: It is approximately "+fe/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=$}else O=$}var ye=Math.round(Ge.pts-Ge.dts);P.push(new f(Ge.key,O,ve,ye))}if(P.length&&u&&u<70){var Oe=P[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=D=z+O,this.isVideoContiguous=!0;var Ue=I.default.moof(s.sequenceNumber++,W,d({},s,{samples:P})),We="video",Ne={data1:Ue,data2:ke,startPTS:Q/y,endPTS:(q+O)/y,startDTS:W/y,endDTS:D/y,type:We,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:s.dropped};return s.samples=[],s.dropped=0,console.assert(ke.length,"MDAT length must not be zero"),Ne},b.remuxAudio=function(s,g,h,T,y){var w=s.inputTimeScale,P=s.samplerate?s.samplerate:w,L=w/P,S=s.isAAC?n:o,D=S*L,F=this._initPTS,O=!s.isAAC&&this.typeSupported.mpeg,W=[],z=s.samples,Q=O?0:8,q=this.nextAudioPts||-1,me=g*w;if(this.isAudioContiguous=h=h||z.length&&q>0&&(T&&Math.abs(me-q)<9e3||Math.abs(t(z[0].pts-F,me)-q)<20*D),z.forEach(function(ae){ae.pts=t(ae.pts-F,me)}),!h||q<0){if(z=z.filter(function(ae){return ae.pts>=0}),!z.length)return;y===0?q=0:T?q=Math.max(0,me):q=z[0].pts}if(s.isAAC)for(var he=y!==void 0,ce=this.config.maxAudioFramesDrift,pe=0,ge=q;pe<z.length;pe++){var ee=z[pe],J=ee.pts,Re=J-ge,Me=Math.abs(1e3*Re/w);if(Re<=-ce*D&&he)pe===0&&(e.logger.warn("Audio frame @ "+(J/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Re/w)+" ms."),this.nextAudioPts=q=ge=J);else if(Re>=ce*D&&Me<l&&he){var Ie=Math.round(Re/D);ge=J-Ie*D,ge<0&&(Ie--,ge+=D),pe===0&&(this.nextAudioPts=q=ge),e.logger.warn("[mp4-remuxer]: Injecting "+Ie+" audio frame @ "+(ge/w).toFixed(3)+"s due to "+Math.round(1e3*Re/w)+" ms gap.");for(var Fe=0;Fe<Ie;Fe++){var He=Math.max(ge,0),_e=C.default.getSilentFrame(s.manifestCodec||s.codec,s.channelCount);_e||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),_e=ee.unit.subarray()),z.splice(pe,0,{unit:_e,pts:He}),ge+=D,pe++}}ee.pts=ge,ge+=D}for(var Ae=null,Se=null,X,ne=0,ue=z.length;ue--;)ne+=z[ue].unit.byteLength;for(var de=0,xe=z.length;de<xe;de++){var Te=z[de],Le=Te.unit,Pe=Te.pts;if(Se!==null){var oe=W[de-1];oe.duration=Math.round((Pe-Se)/L)}else if(h&&s.isAAC&&(Pe=q),Ae=Pe,ne>0){ne+=Q;try{X=new Uint8Array(ne)}catch(ae){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ne,reason:"fail allocating audio mdat "+ne});return}if(!O){var ke=new DataView(X.buffer);ke.setUint32(0,ne),X.set(I.default.types.mdat,4)}}else return;X.set(Le,Q);var De=Le.byteLength;Q+=De,W.push(new f(!0,S,De,0)),Se=Pe}var Ce=W.length;if(!Ce)return;var Ge=W[W.length-1];this.nextAudioPts=q=Se+L*Ge.duration;var Be=O?new Uint8Array(0):I.default.moof(s.sequenceNumber++,Ae/L,d({},s,{samples:W}));s.samples=[];var ve=Ae/w,be=q/w,se="audio",re={data1:Be,data2:X,startPTS:ve,endPTS:be,startDTS:ve,endDTS:be,type:se,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(X.length,"MDAT length must not be zero"),re},b.remuxEmptyAudio=function(s,g,h,T){var y=s.inputTimeScale,w=s.samplerate?s.samplerate:y,P=y/w,L=this.nextAudioPts,S=(L!==null?L:T.startDTS*y)+this._initDTS,D=T.endDTS*y+this._initDTS,F=P*n,O=Math.ceil((D-S)/F),W=C.default.getSilentFrame(s.manifestCodec||s.codec,s.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],Q=0;Q<O;Q++){var q=S+Q*F;z.push({unit:W,pts:q,dts:q})}return s.samples=z,this.remuxAudio(s,g,h,!1)},b.remuxID3=function(s,g){var h=s.samples.length;if(!h)return;for(var T=s.inputTimeScale,y=this._initPTS,w=this._initDTS,P=0;P<h;P++){var L=s.samples[P];L.pts=t(L.pts-y,g*T)/T,L.dts=t(L.dts-w,g*T)/T}var S=s.samples;return s.samples=[],{samples:S}},b.remuxText=function(s,g){var h=s.samples.length;if(!h)return;for(var T=s.inputTimeScale,y=this._initPTS,w=0;w<h;w++){var P=s.samples[w];P.pts=t(P.pts-y,g*T)/T}s.samples.sort(function(S,D){return S.pts-D.pts});var L=s.samples;return s.samples=[],{samples:L}},x}();function t(x,b){var m;if(b===null)return x;for(b<x?m=-8589934592:m=8589934592;Math.abs(x-b)>4294967296;)x+=m;return x}function _(x){for(var b=0;b<x.length;b++)if(x[b].key)return b;return-1}var f=function(b,m,s,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=s,this.cts=g,this.flags=new v(b)},v=function(b){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=b?2:1,this.isNonSync=b?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/polyfills/number.ts"),C=A("./src/utils/mp4-tools.ts"),I=A("./src/loader/fragment.ts"),H=A("./src/utils/logger.ts"),U=function(){function p(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var d=p.prototype;return d.destroy=function(){},d.resetTimeStamp=function(n){this.initPTS=n,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(n,o,u){this.audioCodec=o,this.videoCodec=u,this.generateInitSegment(n),this.emitInitSegment=!0},d.generateInitSegment=function(n){var o=this.audioCodec,u=this.videoCodec;if(!n||!n.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(C.parseInitSegment)(n);o||(o=R(a.audio,I.ElementaryStreamTypes.AUDIO)),u||(u=R(a.video,I.ElementaryStreamTypes.VIDEO));var r={};a.audio&&a.video?r.audiovideo={container:"video/mp4",codec:o+","+u,initSegment:n,id:"main"}:a.audio?r.audio={container:"audio/mp4",codec:o,initSegment:n,id:"audio"}:a.video?r.video={container:"video/mp4",codec:u,initSegment:n,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},d.remux=function(n,o,u,a,r){var i=this.initPTS,t=this.lastEndDTS,_={audio:void 0,video:void 0,text:a,id3:u,initSegment:void 0};Object(B.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var f=o.samples;if(!f||!f.length)return _;var v={initPTS:void 0,timescale:1},x=this.initData;if((!x||!x.length)&&(this.generateInitSegment(f),x=this.initData),!x||!x.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),_;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1),Object(B.isFiniteNumber)(i)||(this.initPTS=v.initPTS=i=e(x,f,t));var b=Object(C.getDuration)(f,x),m=t,s=b+m;Object(C.offsetStartDTS)(x,f,i),b>0?this.lastEndDTS=s:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!x.audio,h=!!x.video,T="";g&&(T+="audio"),h&&(T+="video");var y={data1:f,startPTS:m,startDTS:m,endPTS:s,endDTS:s,type:T,hasAudio:g,hasVideo:h,nb:1,dropped:0};return _.audio=y.type==="audio"?y:void 0,_.video=y.type!=="audio"?y:void 0,_.text=a,_.id3=u,_.initSegment=v,_},p}(),e=function(d,l,n){return Object(C.getStartDTS)(d,l)-n};function R(p,d){var l=p==null?void 0:p.codec;return l&&l.length>4?l:l==="hvc1"?"hvc1.1.c.L120.90":l==="av01"?"av01.0.04M.08":l==="avc1"||d===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}j.default=U},"./src/task-loop.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return B});var B=function(){function C(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=C.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},C}()},"./src/types/cmcd.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"CMCDVersion",function(){return B}),A.d(j,"CMCDObjectType",function(){return C}),A.d(j,"CMCDStreamingFormat",function(){return I}),A.d(j,"CMCDStreamType",function(){return H});var B=1,C;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(C||(C={}));var I;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(I||(I={}));var H;(function(U){U.VOD="v",U.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"HlsSkip",function(){return I}),A.d(j,"getSkipValue",function(){return H}),A.d(j,"HlsUrlParameters",function(){return U}),A.d(j,"Level",function(){return e});function B(R,p){for(var d=0;d<p.length;d++){var l=p[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(R,l.key,l)}}function C(R,p,d){return p&&B(R.prototype,p),d&&B(R,d),R}var I;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(I||(I={}));function H(R,p){var d=R.canSkipUntil,l=R.canSkipDateRanges,n=R.endSN,o=p!==void 0?p-n:0;return d&&o<d?l?I.v2:I.Yes:I.No}var U=function(){function R(d,l,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=l,this.skip=n}var p=R.prototype;return p.addDirectives=function(l){var n=new self.URL(l);return this.msn!==void 0&&n.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&n.searchParams.set("_HLS_part",this.part.toString()),this.skip&&n.searchParams.set("_HLS_skip",this.skip),n.toString()},R}(),e=function(){function R(p){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return C(R,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(d){var l=d%this.url.length;this._urlId!==l&&(this.details=void 0,this._urlId=l)}}]),R}()},"./src/types/loader.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"PlaylistContextType",function(){return B}),A.d(j,"PlaylistLevelType",function(){return C});var B;(function(I){I.MANIFEST="manifest",I.LEVEL="level",I.AUDIO_TRACK="audioTrack",I.SUBTITLE_TRACK="subtitleTrack"})(B||(B={}));var C;(function(I){I.MAIN="main",I.AUDIO="audio",I.SUBTITLE="subtitle"})(C||(C={}))},"./src/types/transmuxer.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"ChunkMetadata",function(){return B});var B=function(H,U,e,R,p,d){R===void 0&&(R=0),p===void 0&&(p=-1),d===void 0&&(d=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=C(),this.buffering={audio:C(),video:C(),audiovideo:C()},this.level=H,this.sn=U,this.id=e,this.size=R,this.part=p,this.partial=d};function C(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"AttrList",function(){return I});var B=/^(\d+)x(\d+)$/,C=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,I=function(){function H(e){typeof e=="string"&&(e=H.parseAttrList(e));for(var R in e)e.hasOwnProperty(R)&&(this[R]=e[R])}var U=H.prototype;return U.decimalInteger=function(R){var p=parseInt(this[R],10);return p>Number.MAX_SAFE_INTEGER?Infinity:p},U.hexadecimalInteger=function(R){if(this[R]){var p=(this[R]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var d=new Uint8Array(p.length/2),l=0;l<p.length/2;l++)d[l]=parseInt(p.slice(l*2,l*2+2),16);return d}else return null},U.hexadecimalIntegerAsNumber=function(R){var p=parseInt(this[R],16);return p>Number.MAX_SAFE_INTEGER?Infinity:p},U.decimalFloatingPoint=function(R){return parseFloat(this[R])},U.optionalFloat=function(R,p){var d=this[R];return d?parseFloat(d):p},U.enumeratedString=function(R){return this[R]},U.bool=function(R){return this[R]==="YES"},U.decimalResolution=function(R){var p=B.exec(this[R]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},H.parseAttrList=function(R){var p,d={},l='"';for(C.lastIndex=0;(p=C.exec(R))!==null;){var n=p[2];n.indexOf(l)===0&&n.lastIndexOf(l)===n.length-1&&(n=n.slice(1,-1)),d[p[1]]=n}return d},H}()},"./src/utils/binary-search.ts":function(te,j,A){"use strict";A.r(j);var B={search:function(I,H){for(var U=0,e=I.length-1,R=null,p=null;U<=e;){R=(U+e)/2|0,p=I[R];var d=H(p);if(d>0)U=R+1;else if(d<0)e=R-1;else return p}return null}};j.default=B},"./src/utils/buffer-helper.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"BufferHelper",function(){return I});var B=A("./src/utils/logger.ts"),C={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function H(){}return H.isBuffered=function(e,R){try{if(e){for(var p=H.getBuffered(e),d=0;d<p.length;d++)if(R>=p.start(d)&&R<=p.end(d))return!0}}catch(l){}return!1},H.bufferInfo=function(e,R,p){try{if(e){var d=H.getBuffered(e),l=[],n;for(n=0;n<d.length;n++)l.push({start:d.start(n),end:d.end(n)});return this.bufferedInfo(l,R,p)}}catch(o){}return{len:0,start:R,end:R,nextStart:void 0}},H.bufferedInfo=function(e,R,p){R=Math.max(0,R),e.sort(function(v,x){var b=v.start-x.start;return b||x.end-v.end});var d=[];if(p)for(var l=0;l<e.length;l++){var n=d.length;if(n){var o=d[n-1].end;e[l].start-o<p?e[l].end>o&&(d[n-1].end=e[l].end):d.push(e[l])}else d.push(e[l])}else d=e;for(var u=0,a,r=R,i=R,t=0;t<d.length;t++){var _=d[t].start,f=d[t].end;if(R+p>=_&&R<f)r=_,i=f,u=i-R;else if(R+p<_){a=_;break}}return{len:u,start:r||0,end:i||0,nextStart:a}},H.getBuffered=function(e){try{return e.buffered}catch(R){return B.logger.log("failed to get media.buffered",R),C}},H}()},"./src/utils/cea-608-parser.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"Row",function(){return i}),A.d(j,"CaptionScreen",function(){return t});var B=A("./src/utils/logger.ts"),C={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},I=function(s){var g=s;return C.hasOwnProperty(s)&&(g=C[s]),String.fromCharCode(g)},H=15,U=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],n;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(n||(n={}));var o=function(){function m(){this.time=null,this.verboseLevel=n.ERROR}var s=m.prototype;return s.log=function(h,T){this.verboseLevel>=h&&B.logger.log(this.time+" ["+h+"] "+T)},m}(),u=function(s){for(var g=[],h=0;h<s.length;h++)g.push(s[h].toString(16));return g},a=function(){function m(g,h,T,y,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=h||!1,this.italics=T||!1,this.background=y||"black",this.flash=w||!1}var s=m.prototype;return s.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},s.setStyles=function(h){for(var T=["foreground","underline","italics","background","flash"],y=0;y<T.length;y++){var w=T[y];h.hasOwnProperty(w)&&(this[w]=h[w])}},s.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},s.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},s.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},s.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),r=function(){function m(g,h,T,y,w,P){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new a(h,T,y,w,P)}var s=m.prototype;return s.reset=function(){this.uchar=" ",this.penState.reset()},s.setChar=function(h,T){this.uchar=h,this.penState.copy(T)},s.setPenState=function(h){this.penState.copy(h)},s.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},s.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},s.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),i=function(){function m(g){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<U;h++)this.chars.push(new r);this.logger=g,this.pos=0,this.currPenState=new a}var s=m.prototype;return s.equals=function(h){for(var T=!0,y=0;y<U;y++)if(!this.chars[y].equals(h.chars[y])){T=!1;break}return T},s.copy=function(h){for(var T=0;T<U;T++)this.chars[T].copy(h.chars[T])},s.isEmpty=function(){for(var h=!0,T=0;T<U;T++)if(!this.chars[T].isEmpty()){h=!1;break}return h},s.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},s.moveCursor=function(h){var T=this.pos+h;if(h>1)for(var y=this.pos+1;y<T+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(T)},s.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},s.insertChar=function(h){h>=144&&this.backSpace();var T=I(h);if(this.pos>=U){this.logger.log(n.ERROR,"Cannot insert "+h.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},s.clearFromPos=function(h){var T;for(T=h;T<U;T++)this.chars[T].reset()},s.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},s.clearToEndOfRow=function(){this.clearFromPos(this.pos)},s.getTextString=function(){for(var h=[],T=!0,y=0;y<U;y++){var w=this.chars[y].uchar;w!==" "&&(T=!1),h.push(w)}return T?"":h.join("")},s.setPenStyles=function(h){this.currPenState.setStyles(h);var T=this.chars[this.pos];T.setPenState(this.currPenState)},m}(),t=function(){function m(g){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<H;h++)this.rows.push(new i(g));this.logger=g,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var s=m.prototype;return s.reset=function(){for(var h=0;h<H;h++)this.rows[h].clear();this.currRow=H-1},s.equals=function(h){for(var T=!0,y=0;y<H;y++)if(!this.rows[y].equals(h.rows[y])){T=!1;break}return T},s.copy=function(h){for(var T=0;T<H;T++)this.rows[T].copy(h.rows[T])},s.isEmpty=function(){for(var h=!0,T=0;T<H;T++)if(!this.rows[T].isEmpty()){h=!1;break}return h},s.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},s.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},s.insertChar=function(h){var T=this.rows[this.currRow];T.insertChar(h)},s.setPen=function(h){var T=this.rows[this.currRow];T.setPenStyles(h)},s.moveCursor=function(h){var T=this.rows[this.currRow];T.moveCursor(h)},s.setCursor=function(h){this.logger.log(n.INFO,"setCursor: "+h);var T=this.rows[this.currRow];T.setCursor(h)},s.setPAC=function(h){this.logger.log(n.INFO,"pacData = "+JSON.stringify(h));var T=h.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var y=0;y<H;y++)this.rows[y].clear();var w=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var L=P.rows[w].cueStartTime,S=this.logger.time;if(L&&S!==null&&L<S)for(var D=0;D<this.nrRollUpRows;D++)this.rows[T-this.nrRollUpRows+D+1].copy(P.rows[w+D])}}this.currRow=T;var F=this.rows[this.currRow];if(h.indent!==null){var O=h.indent,W=Math.max(O-1,0);F.setCursor(h.indent),h.color=F.chars[W].penState.foreground}var z={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(z)},s.setBkgData=function(h){this.logger.log(n.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},s.setRollUpRows=function(h){this.nrRollUpRows=h},s.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(h,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(n.INFO,"Rolling up")},s.getDisplayText=function(h){h=h||!1;for(var T=[],y="",w=-1,P=0;P<H;P++){var L=this.rows[P].getTextString();L&&(w=P+1,h?T.push("Row "+w+": '"+L+"'"):T.push(L.trim()))}return T.length>0&&(h?y="["+T.join(" | ")+"]":y=T.join(`
`)),y},s.getTextAndFormat=function(){return this.rows},m}(),_=function(){function m(g,h,T){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=g,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new t(T),this.nonDisplayedMemory=new t(T),this.lastOutputScreen=new t(T),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var s=m.prototype;return s.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},s.getHandler=function(){return this.outputFilter},s.setHandler=function(h){this.outputFilter=h},s.setPAC=function(h){this.writeScreen.setPAC(h)},s.setBkgData=function(h){this.writeScreen.setBkgData(h)},s.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(n.INFO,"MODE="+h),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=h},s.insertChars=function(h){for(var T=0;T<h.length;T++)this.writeScreen.insertChar(h[T]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},s.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},s.ccBS=function(){if(this.logger.log(n.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},s.ccAOF=function(){},s.ccAON=function(){},s.ccDER=function(){this.logger.log(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},s.ccRU=function(h){this.logger.log(n.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},s.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},s.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},s.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},s.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},s.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},s.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},s.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},s.ccEOC=function(){if(this.logger.log(n.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},s.ccTO=function(h){this.logger.log(n.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},s.ccMIDROW=function(h){var T={flash:!1};if(T.underline=h%2===1,T.italics=h>=46,T.italics)T.foreground="white";else{var y=Math.floor(h/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=w[y]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},s.outputDataUpdate=function(h){h===void 0&&(h=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},s.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},m}(),f=function(){function m(g,h,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new o;this.channels=[null,new _(g,h,y),new _(g+1,T,y)],this.cmdHistory=b(),this.logger=y}var s=m.prototype;return s.getHandler=function(h){return this.channels[h].getHandler()},s.setHandler=function(h,T){this.channels[h].setHandler(T)},s.addData=function(h,T){var y,w,P,L=!1;this.logger.time=h;for(var S=0;S<T.length;S+=2){if(w=T[S]&127,P=T[S+1]&127,w===0&&P===0)continue;if(this.logger.log(n.DATA,"["+u([T[S],T[S+1]])+"] -> ("+u([w,P])+")"),y=this.parseCmd(w,P),y||(y=this.parseMidrow(w,P)),y||(y=this.parsePAC(w,P)),y||(y=this.parseBackgroundAttributes(w,P)),!y&&(L=this.parseChars(w,P),L)){var D=this.currentChannel;if(D&&D>0){var F=this.channels[D];F.insertChars(L)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!L&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+u([w,P])+" orig: "+u([T[S],T[S+1]]))}},s.parseCmd=function(h,T){var y=this.cmdHistory,w=(h===20||h===28||h===21||h===29)&&T>=32&&T<=47,P=(h===23||h===31)&&T>=33&&T<=35;if(!(w||P))return!1;if(x(h,T,y))return v(null,null,y),this.logger.log(n.DEBUG,"Repeated command ("+u([h,T])+") is dropped"),!0;var L=h===20||h===21||h===23?1:2,S=this.channels[L];return h===20||h===21||h===28||h===29?T===32?S.ccRCL():T===33?S.ccBS():T===34?S.ccAOF():T===35?S.ccAON():T===36?S.ccDER():T===37?S.ccRU(2):T===38?S.ccRU(3):T===39?S.ccRU(4):T===40?S.ccFON():T===41?S.ccRDC():T===42?S.ccTR():T===43?S.ccRTD():T===44?S.ccEDM():T===45?S.ccCR():T===46?S.ccENM():T===47&&S.ccEOC():S.ccTO(T-32),v(h,T,y),this.currentChannel=L,!0},s.parseMidrow=function(h,T){var y=0;if((h===17||h===25)&&T>=32&&T<=47){if(h===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[y];return w?(w.ccMIDROW(T),this.logger.log(n.DEBUG,"MIDROW ("+u([h,T])+")"),!0):!1}return!1},s.parsePAC=function(h,T){var y,w=this.cmdHistory,P=(h>=17&&h<=23||h>=25&&h<=31)&&T>=64&&T<=127,L=(h===16||h===24)&&T>=64&&T<=95;if(!(P||L))return!1;if(x(h,T,w))return v(null,null,w),!0;var S=h<=23?1:2;T>=64&&T<=95?y=S===1?e[h]:p[h]:y=S===1?R[h]:d[h];var D=this.channels[S];return D?(D.setPAC(this.interpretPAC(y,T)),v(h,T,w),this.currentChannel=S,!0):!1},s.interpretPAC=function(h,T){var y,w={color:null,italics:!1,indent:null,underline:!1,row:h};return T>95?y=T-96:y=T-64,w.underline=(y&1)===1,y<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((y-16)/2)*4,w},s.parseChars=function(h,T){var y,w=null,P=null;if(h>=25?(y=2,P=h-8):(y=1,P=h),P>=17&&P<=19){var L;P===17?L=T+80:P===18?L=T+112:L=T+144,this.logger.log(n.INFO,"Special char '"+I(L)+"' in channel "+y),w=[L]}else h>=32&&h<=127&&(w=T===0?[h]:[h,T]);if(w){var S=u(w);this.logger.log(n.DEBUG,"Char codes = "+S.join(",")),v(h,T,this.cmdHistory)}return w},s.parseBackgroundAttributes=function(h,T){var y=(h===16||h===24)&&T>=32&&T<=47,w=(h===23||h===31)&&T>=45&&T<=47;if(!(y||w))return!1;var P,L={};h===16||h===24?(P=Math.floor((T-32)/2),L.background=l[P],T%2===1&&(L.background=L.background+"_semi")):T===45?L.background="transparent":(L.foreground="black",T===47&&(L.underline=!0));var S=h<=23?1:2,D=this.channels[S];return D.setBkgData(L),v(h,T,this.cmdHistory),!0},s.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var T=this.channels[h];T&&T.reset()}this.cmdHistory=b()},s.cueSplitAtTime=function(h){for(var T=0;T<this.channels.length;T++){var y=this.channels[T];y&&y.cueSplitAtTime(h)}},m}();function v(m,s,g){g.a=m,g.b=s}function x(m,s,g){return g.a===m&&g.b===s}function b(){return{a:null,b:null}}j.default=f},"./src/utils/codecs.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"isCodecType",function(){return C}),A.d(j,"isCodecSupportedInMp4",function(){return I});var B={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function C(H,U){var e=B[U];return!!e&&e[H.slice(0,4)]===!0}function I(H,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/utils/vttparser.ts"),C=A("./src/utils/webvtt-parser.ts"),I=A("./src/utils/texttrack-utils.ts"),H=/\s/,U={newCue:function(R,p,d,l){for(var n=[],o,u,a,r,i,t=self.VTTCue||self.TextTrackCue,_=0;_<l.rows.length;_++)if(o=l.rows[_],a=!0,r=0,i="",!o.isEmpty()){for(var f=0;f<o.chars.length;f++)H.test(o.chars[f].uchar)&&a?r++:(i+=o.chars[f].uchar,a=!1);o.cueStartTime=p,p===d&&(d+=1e-4),r>=16?r--:r++;var v=Object(B.fixLineBreaks)(i.trim()),x=Object(C.generateCueId)(p,d,v);(!R||!R.cues||!R.cues.getCueById(x))&&(u=new t(p,d,v),u.id=x,u.line=_+1,u.align="left",u.position=10+Math.min(80,Math.floor(r*8/32)*10),n.push(u))}return R&&n.length&&(n.sort(function(b,m){return b.line==="auto"||m.line==="auto"?0:b.line>8&&m.line>8?m.line-b.line:b.line-m.line}),n.forEach(function(b){return Object(I.addCueToTrack)(R,b)})),n}};j.default=U},"./src/utils/discontinuities.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"findFirstFragWithCC",function(){return H}),A.d(j,"shouldAlignOnDiscontinuities",function(){return U}),A.d(j,"findDiscontinuousReferenceFrag",function(){return e}),A.d(j,"adjustSlidingStart",function(){return p}),A.d(j,"alignStream",function(){return d}),A.d(j,"alignPDT",function(){return n}),A.d(j,"alignFragmentByPDTDelta",function(){return o}),A.d(j,"alignMediaPlaylistByPDT",function(){return u});var B=A("./src/polyfills/number.ts"),C=A("./src/utils/logger.ts"),I=A("./src/controller/level-helper.ts");function H(a,r){for(var i=null,t=0,_=a.length;t<_;t++){var f=a[t];if(f&&f.cc===r){i=f;break}}return i}function U(a,r,i){return!!(r.details&&(i.endCC>i.startCC||a&&a.cc<i.startCC))}function e(a,r){var i=a.fragments,t=r.fragments;if(!t.length||!i.length){C.logger.log("No fragments to align");return}var _=H(i,t[0].cc);if(!_||_&&!_.startPTS){C.logger.log("No frag in previous level to align on");return}return _}function R(a,r){if(a){var i=a.start+r;a.start=a.startPTS=i,a.endPTS=i+a.duration}}function p(a,r){for(var i=r.fragments,t=0,_=i.length;t<_;t++)R(i[t],a);r.fragmentHint&&R(r.fragmentHint,a),r.alignedSliding=!0}function d(a,r,i){if(!r)return;l(a,i,r),!i.alignedSliding&&r.details&&n(i,r.details),!i.alignedSliding&&r.details&&!i.skippedSegments&&Object(I.adjustSliding)(r.details,i)}function l(a,r,i){if(U(a,i,r)){var t=e(i.details,r);t&&Object(B.isFiniteNumber)(t.start)&&(C.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),p(t.start,r))}}function n(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=a.fragments[0].programDateTime,_=(t-i)/1e3+r.fragments[0].start;_&&Object(B.isFiniteNumber)(_)&&(C.logger.log("Adjusting PTS using programDateTime delta "+(t-i)+"ms, sliding:"+_.toFixed(3)+" "+a.url+" "),p(_,a))}function o(a,r){var i=a.programDateTime;if(!i)return;var t=(i-r)/1e3;a.start=a.startPTS=t,a.endPTS=t+a.duration}function u(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=r.fragments[0].start,_=i-t*1e3;a.fragments.forEach(function(f){o(f,_)}),a.fragmentHint&&o(a.fragmentHint,_),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/utils/ewma.ts"),C=function(){function I(U,e,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new B.default(U),this.fast_=new B.default(e)}var H=I.prototype;return H.update=function(e,R){var p=this.slow_,d=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new B.default(e,p.getEstimate(),p.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new B.default(R,d.getEstimate(),d.getTotalWeight()))},H.sample=function(e,R){e=Math.max(e,this.minDelayMs_);var p=8*R,d=e/1e3,l=p/d;this.fast_.sample(d,l),this.slow_.sample(d,l)},H.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},I}();j.default=C},"./src/utils/ewma.ts":function(te,j,A){"use strict";A.r(j);var B=function(){function C(H,U,e){U===void 0&&(U=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=U,this.totalWeight_=e}var I=C.prototype;return I.sample=function(U,e){var R=Math.pow(this.alpha_,U);this.estimate_=e*(1-R)+R*this.estimate_,this.totalWeight_+=U},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},C}();j.default=B},"./src/utils/fetch-loader.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"fetchSupported",function(){return o});var B=A("./src/polyfills/number.ts"),C=A("./src/loader/load-stats.ts"),I=A("./src/demux/chunk-cache.ts");function H(t,_){t.prototype=Object.create(_.prototype),t.prototype.constructor=t,d(t,_)}function U(t){var _=typeof Map=="function"?new Map:void 0;return U=function(v){if(v===null||!p(v))return v;if(typeof v!="function")throw new TypeError("Super expression must either be null or a function");if(typeof _!="undefined"){if(_.has(v))return _.get(v);_.set(v,x)}function x(){return e(v,arguments,l(this).constructor)}return x.prototype=Object.create(v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),d(x,v)},U(t)}function e(t,_,f){return R()?e=Reflect.construct:e=function(x,b,m){var s=[null];s.push.apply(s,b);var g=Function.bind.apply(x,s),h=new g;return m&&d(h,m.prototype),h},e.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(t){return!1}}function p(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function d(t,_){return d=Object.setPrototypeOf||function(v,x){return v.__proto__=x,v},d(t,_)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},l(t)}function n(){return n=Object.assign||function(t){for(var _=1;_<arguments.length;_++){var f=arguments[_];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(t[v]=f[v])}return t},n.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var u=function(){function t(f){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=f.fetchSetup||r,this.controller=new self.AbortController,this.stats=new C.LoadStats}var _=t.prototype;return _.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},_.abortInternal=function(){var v=this.response;(!v||!v.ok)&&(this.stats.aborted=!0,this.controller.abort())},_.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},_.load=function(v,x,b){var m=this,s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();var g=a(v,this.controller.signal),h=b.onProgress,T=v.responseType==="arraybuffer",y=T?"byteLength":"length";this.context=v,this.config=x,this.callbacks=b,this.request=this.fetchSetup(v,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),b.onTimeout(s,v,m.response)},x.timeout),self.fetch(this.request).then(function(w){if(m.response=m.loader=w,!w.ok){var P=w.status,L=w.statusText;throw new i(L||"fetch, bad network response",P,w)}return s.loading.first=Math.max(self.performance.now(),s.loading.start),s.total=parseInt(w.headers.get("Content-Length")||"0"),h&&Object(B.isFiniteNumber)(x.highWaterMark)?m.loadProgressively(w,s,v,x.highWaterMark,h):T?w.arrayBuffer():w.text()}).then(function(w){var P=m.response;self.clearTimeout(m.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first),s.loaded=s.total=w[y];var L={url:P.url,data:w};h&&!Object(B.isFiniteNumber)(x.highWaterMark)&&h(s,v,w,P),b.onSuccess(L,s,v,P)}).catch(function(w){if(self.clearTimeout(m.requestTimeout),s.aborted)return;var P=w.code||0;b.onError({code:P,text:w.message},v,w.details)})},_.getCacheAge=function(){var v=null;if(this.response){var x=this.response.headers.get("age");v=x?parseFloat(x):null}return v},_.loadProgressively=function(v,x,b,m,s){m===void 0&&(m=0);var g=new I.default,h=v.body.getReader(),T=function y(){return h.read().then(function(w){if(w.done)return g.dataLength&&s(x,b,g.flush(),v),Promise.resolve(new ArrayBuffer(0));var P=w.value,L=P.length;return x.loaded+=L,L<m||g.dataLength?(g.push(P),g.dataLength>=m&&s(x,b,g.flush(),v)):s(x,b,P,v),y()}).catch(function(){return Promise.reject()})};return T()},t}();function a(t,_){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:_,headers:new self.Headers(n({},t.headers))};return t.rangeEnd&&f.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),f}function r(t,_){return new self.Request(t.url,_)}var i=function(t){H(_,t);function _(f,v,x){var b;return b=t.call(this,f)||this,b.code=void 0,b.details=void 0,b.code=v,b.details=x,b}return _}(U(Error));j.default=u},"./src/utils/imsc1-ttml-parser.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"IMSC1_CODEC",function(){return p}),A.d(j,"parseIMSC1",function(){return o});var B=A("./src/utils/mp4-tools.ts"),C=A("./src/utils/vttparser.ts"),I=A("./src/utils/vttcue.ts"),H=A("./src/demux/id3.ts"),U=A("./src/utils/timescale-conversion.ts"),e=A("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(m){for(var s=1;s<arguments.length;s++){var g=arguments[s];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(m[h]=g[h])}return m},R.apply(this,arguments)}var p="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,l=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,n={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(m,s,g,h,T){var y=Object(B.findBox)(new Uint8Array(m),["mdat"]);if(y.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var w=y[0],P=Object(H.utf8ArrayToStr)(new Uint8Array(m,w.start,w.end-w.start)),L=Object(U.toTimescaleFromScale)(s,1,g);try{h(u(P,L))}catch(S){T(S)}}function u(m,s){var g=new DOMParser,h=g.parseFromString(m,"text/xml"),T=h.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(y).reduce(function(F,O){return F[O]=T.getAttribute("ttp:"+O)||y[O],F},{}),P=T.getAttribute("xml:space")!=="preserve",L=r(a(T,"styling","style")),S=r(a(T,"layout","region")),D=a(T,"body","[begin]");return[].map.call(D,function(F){var O=i(F,P);if(!O||!F.hasAttribute("begin"))return null;var W=v(F.getAttribute("begin"),w),z=v(F.getAttribute("dur"),w),Q=v(F.getAttribute("end"),w);if(W===null)throw f(F);if(Q===null){if(z===null)throw f(F);Q=W+z}var q=new I.default(W-s,Q-s,O);q.id=Object(e.generateCueId)(q.startTime,q.endTime,q.text);var me=S[F.getAttribute("region")],he=L[F.getAttribute("style")];q.position=10,q.size=80;var ce=t(me,he),pe=ce.textAlign;if(pe){var ge=n[pe];ge&&(q.lineAlign=ge),q.align=pe}return R(q,ce),q}).filter(function(F){return F!==null})}function a(m,s,g){var h=m.getElementsByTagName(s)[0];return h?[].slice.call(h.querySelectorAll(g)):[]}function r(m){return m.reduce(function(s,g){var h=g.getAttribute("xml:id");return h&&(s[h]=g),s},{})}function i(m,s){return[].slice.call(m.childNodes).reduce(function(g,h,T){var y;return h.nodeName==="br"&&T?g+`
`:(y=h.childNodes)!==null&&y!==void 0&&y.length?i(h,s):s?g+h.textContent.trim().replace(/\s+/g," "):g+h.textContent},"")}function t(m,s){var g="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(T,y){var w=_(s,g,y)||_(m,g,y);return w&&(T[y]=w),T},{})}function _(m,s,g){return m.hasAttributeNS(s,g)?m.getAttributeNS(s,g):null}function f(m){return new Error("Could not parse ttml timestamp "+m)}function v(m,s){if(!m)return null;var g=Object(C.parseTimeStamp)(m);return g===null&&(d.test(m)?g=x(m,s):l.test(m)&&(g=b(m,s))),g}function x(m,s){var g=d.exec(m),h=(g[4]|0)+(g[5]|0)/s.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+h/s.frameRate}function b(m,s){var g=l.exec(m),h=Number(g[1]),T=g[2];switch(T){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/s.frameRate;case"t":return h/s.tickRate}return h}},"./src/utils/logger.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"enableLogs",function(){return e}),A.d(j,"logger",function(){return R});var B=function(){},C={trace:B,debug:B,log:B,warn:B,info:B,error:B},I=C;function H(p){var d=self.console[p];return d?d.bind(self.console,"["+p+"] >"):B}function U(p){for(var d=arguments.length,l=new Array(d>1?d-1:0),n=1;n<d;n++)l[n-1]=arguments[n];l.forEach(function(o){I[o]=p[o]?p[o].bind(p):H(o)})}function e(p){if(self.console&&p===!0||typeof p=="object"){U(p,"debug","log","info","warn","error");try{I.log()}catch(d){I=C}}else I=C}var R=I},"./src/utils/mediakeys-helper.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"KeySystems",function(){return B}),A.d(j,"requestMediaKeySystemAccess",function(){return C});var B;(function(I){I.WIDEVINE="com.widevine.alpha",I.PLAYREADY="com.microsoft.playready"})(B||(B={}));var C=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"getMediaSource",function(){return B});function B(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"bin2str",function(){return U}),A.d(j,"readUint16",function(){return e}),A.d(j,"readUint32",function(){return R}),A.d(j,"writeUint32",function(){return p}),A.d(j,"findBox",function(){return d}),A.d(j,"parseSegmentIndex",function(){return l}),A.d(j,"parseInitSegment",function(){return n}),A.d(j,"getStartDTS",function(){return o}),A.d(j,"getDuration",function(){return u}),A.d(j,"computeRawDurationFromSamples",function(){return a}),A.d(j,"offsetStartDTS",function(){return r}),A.d(j,"segmentValidRange",function(){return i}),A.d(j,"appendUint8Array",function(){return t});var B=A("./src/utils/typed-array.ts"),C=A("./src/loader/fragment.ts"),I=Math.pow(2,32)-1,H=[].push;function U(_){return String.fromCharCode.apply(null,_)}function e(_,f){"data"in _&&(f+=_.start,_=_.data);var v=_[f]<<8|_[f+1];return v<0?65536+v:v}function R(_,f){"data"in _&&(f+=_.start,_=_.data);var v=_[f]<<24|_[f+1]<<16|_[f+2]<<8|_[f+3];return v<0?4294967296+v:v}function p(_,f,v){"data"in _&&(f+=_.start,_=_.data),_[f]=v>>24,_[f+1]=v>>16&255,_[f+2]=v>>8&255,_[f+3]=v&255}function d(_,f){var v=[];if(!f.length)return v;var x,b,m;"data"in _?(x=_.data,b=_.start,m=_.end):(x=_,b=0,m=x.byteLength);for(var s=b;s<m;){var g=R(x,s),h=U(x.subarray(s+4,s+8)),T=g>1?s+g:m;if(h===f[0])if(f.length===1)v.push({data:x,start:s+8,end:T});else{var y=d({data:x,start:s+8,end:T},f.slice(1));y.length&&H.apply(v,y)}s=T}return v}function l(_){var f=d(_,["moov"]),v=f[0],x=v?v.end:null,b=d(_,["sidx"]);if(!b||!b[0])return null;var m=[],s=b[0],g=s.data[0],h=g===0?8:16,T=R(s,h);h+=4;var y=0,w=0;g===0?h+=8:h+=16,h+=2;var P=s.end+w,L=e(s,h);h+=2;for(var S=0;S<L;S++){var D=h,F=R(s,D);D+=4;var O=F&2147483647,W=(F&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=R(s,D);D+=4,m.push({referenceSize:O,subsegmentDuration:z,info:{duration:z/T,start:P,end:P+O-1}}),P+=O,D+=4,h=D}return{earliestPresentationTime:y,timescale:T,version:g,referencesCount:L,references:m,moovEndOffset:x}}function n(_){for(var f=[],v=d(_,["moov","trak"]),x=0;x<v.length;x++){var b=v[x],m=d(b,["tkhd"])[0];if(m){var s=m.data[m.start],g=s===0?12:20,h=R(m,g),T=d(b,["mdia","mdhd"])[0];if(T){s=T.data[T.start],g=s===0?12:20;var y=R(T,g),w=d(b,["mdia","hdlr"])[0];if(w){var P=U(w.data.subarray(w.start+8,w.start+12)),L={soun:C.ElementaryStreamTypes.AUDIO,vide:C.ElementaryStreamTypes.VIDEO}[P];if(L){var S=d(b,["mdia","minf","stbl","stsd"])[0],D=void 0;S&&(D=U(S.data.subarray(S.start+12,S.start+16))),f[h]={timescale:y,type:L},f[L]={timescale:y,id:h,codec:D}}}}}}var F=d(_,["moov","mvex","trex"]);return F.forEach(function(O){var W=R(O,4),z=f[W];z&&(z.default={duration:R(O,12),flags:R(O,20)})}),f}function o(_,f){return d(f,["moof","traf"]).reduce(function(v,x){var b=d(x,["tfdt"])[0],m=b.data[b.start],s=d(x,["tfhd"]).reduce(function(g,h){var T=R(h,4),y=_[T];if(y){var w=R(b,4);m===1&&(w*=Math.pow(2,32),w+=R(b,8));var P=y.timescale||9e4,L=w/P;if(isFinite(L)&&(g===null||L<g))return L}return g},null);return s!==null&&isFinite(s)&&(v===null||s<v)?s:v},null)||0}function u(_,f){for(var v=0,x=0,b=0,m=d(_,["moof","traf"]),s=0;s<m.length;s++){var g=m[s],h=d(g,["tfhd"])[0],T=R(h,4),y=f[T];if(!y)continue;var w=y.default,P=R(h,0)|(w==null?void 0:w.flags),L=w==null?void 0:w.duration;P&8&&(P&2?L=R(h,12):L=R(h,8));for(var S=y.timescale||9e4,D=d(g,["trun"]),F=0;F<D.length;F++){if(L){var O=R(D[F],4);v=L*O}else v=a(D[F]);y.type===C.ElementaryStreamTypes.VIDEO?x+=v/S:y.type===C.ElementaryStreamTypes.AUDIO&&(b+=v/S)}}if(x===0&&b===0){var W=l(_);if(W!=null&&W.references)return W.references.reduce(function(z,Q){return z+Q.info.duration||0},0)}return x||b}function a(_){var f=R(_,0),v=8;f&1&&(v+=4),f&4&&(v+=4);for(var x=0,b=R(_,4),m=0;m<b;m++){if(f&256){var s=R(_,v);x+=s,v+=4}f&512&&(v+=4),f&1024&&(v+=4),f&2048&&(v+=4)}return x}function r(_,f,v){d(f,["moof","traf"]).forEach(function(x){d(x,["tfhd"]).forEach(function(b){var m=R(b,4),s=_[m];if(!s)return;var g=s.timescale||9e4;d(x,["tfdt"]).forEach(function(h){var T=h.data[h.start],y=R(h,4);if(T===0)p(h,4,y-v*g);else{y*=Math.pow(2,32),y+=R(h,8),y-=v*g,y=Math.max(y,0);var w=Math.floor(y/(I+1)),P=Math.floor(y%(I+1));p(h,4,w),p(h,8,P)}})})})}function i(_){var f={valid:null,remainder:null},v=d(_,["moof"]);if(v){if(v.length<2)return f.remainder=_,f}else return f;var x=v[v.length-1];return f.valid=Object(B.sliceUint8)(_,0,x.start-8),f.remainder=Object(B.sliceUint8)(_,x.start-8),f}function t(_,f){var v=new Uint8Array(_.length+f.length);return v.set(_),v.set(f,_.length),v}},"./src/utils/output-filter.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"default",function(){return B});var B=function(){function C(H,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=U}var I=C.prototype;return I.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},I.newCue=function(U,e,R){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=e,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},C}()},"./src/utils/texttrack-utils.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"sendAddTrackEvent",function(){return C}),A.d(j,"addCueToTrack",function(){return I}),A.d(j,"clearCurrentCues",function(){return H}),A.d(j,"removeCuesInRange",function(){return U}),A.d(j,"getCuesInRange",function(){return R});var B=A("./src/utils/logger.ts");function C(p,d){var l;try{l=new Event("addtrack")}catch(n){l=document.createEvent("Event"),l.initEvent("addtrack",!1,!1)}l.track=p,d.dispatchEvent(l)}function I(p,d){var l=p.mode;if(l==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(d.id))try{if(p.addCue(d),!p.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(o){B.logger.debug("[texttrack-utils]: "+o);var n=new self.TextTrackCue(d.startTime,d.endTime,d.text);n.id=d.id,p.addCue(n)}l==="disabled"&&(p.mode=l)}function H(p){var d=p.mode;if(d==="disabled"&&(p.mode="hidden"),p.cues)for(var l=p.cues.length;l--;)p.removeCue(p.cues[l]);d==="disabled"&&(p.mode=d)}function U(p,d,l){var n=p.mode;if(n==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var o=R(p.cues,d,l),u=0;u<o.length;u++)p.removeCue(o[u]);n==="disabled"&&(p.mode=n)}function e(p,d){if(d<p[0].startTime)return 0;var l=p.length-1;if(d>p[l].endTime)return-1;for(var n=0,o=l;n<=o;){var u=Math.floor((o+n)/2);if(d<p[u].startTime)o=u-1;else if(d>p[u].startTime&&n<l)n=u+1;else return u}return p[n].startTime-d<d-p[o].startTime?n:o}function R(p,d,l){var n=[],o=e(p,d);if(o>-1)for(var u=o,a=p.length;u<a;u++){var r=p[u];if(r.startTime>=d&&r.endTime<=l)n.push(r);else if(r.startTime>l)return n}return n}},"./src/utils/time-ranges.ts":function(te,j,A){"use strict";A.r(j);var B={toString:function(I){for(var H="",U=I.length,e=0;e<U;e++)H+="["+I.start(e).toFixed(3)+","+I.end(e).toFixed(3)+"]";return H}};j.default=B},"./src/utils/timescale-conversion.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"toTimescaleFromBase",function(){return C}),A.d(j,"toTimescaleFromScale",function(){return I}),A.d(j,"toMsFromMpegTsClock",function(){return H}),A.d(j,"toMpegTsClockFromTimescale",function(){return U});var B=9e4;function C(e,R,p,d){p===void 0&&(p=1),d===void 0&&(d=!1);var l=e*R*p;return d?Math.round(l):l}function I(e,R,p,d){return p===void 0&&(p=1),d===void 0&&(d=!1),C(e,R,1/p,d)}function H(e,R){return R===void 0&&(R=!1),C(e,1e3,1/B,R)}function U(e,R){return R===void 0&&(R=1),C(e,B,1/R)}},"./src/utils/typed-array.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"sliceUint8",function(){return B});function B(C,I,H){return Uint8Array.prototype.slice?C.slice(I,H):new Uint8Array(Array.prototype.slice.call(C,I,H))}},"./src/utils/vttcue.ts":function(te,j,A){"use strict";A.r(j),j.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var B=["","lr","rl"],C=["start","middle","end","left","right"];function I(p,d){if(typeof d!="string")return!1;if(!Array.isArray(p))return!1;var l=d.toLowerCase();return~p.indexOf(l)?l:!1}function H(p){return I(B,p)}function U(p){return I(C,p)}function e(p){for(var d=arguments.length,l=new Array(d>1?d-1:0),n=1;n<d;n++)l[n-1]=arguments[n];for(var o=1;o<arguments.length;o++){var u=arguments[o];for(var a in u)p[a]=u[a]}return p}function R(p,d,l){var n=this,o={enumerable:!0};n.hasBeenReset=!1;var u="",a=!1,r=p,i=d,t=l,_=null,f="",v=!0,x="auto",b="start",m=50,s="middle",g=50,h="middle";Object.defineProperty(n,"id",e({},o,{get:function(){return u},set:function(y){u=""+y}})),Object.defineProperty(n,"pauseOnExit",e({},o,{get:function(){return a},set:function(y){a=!!y}})),Object.defineProperty(n,"startTime",e({},o,{get:function(){return r},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"endTime",e({},o,{get:function(){return i},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");i=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"text",e({},o,{get:function(){return t},set:function(y){t=""+y,this.hasBeenReset=!0}})),Object.defineProperty(n,"region",e({},o,{get:function(){return _},set:function(y){_=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"vertical",e({},o,{get:function(){return f},set:function(y){var w=H(y);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"snapToLines",e({},o,{get:function(){return v},set:function(y){v=!!y,this.hasBeenReset=!0}})),Object.defineProperty(n,"line",e({},o,{get:function(){return x},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");x=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"lineAlign",e({},o,{get:function(){return b},set:function(y){var w=U(y);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");b=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"position",e({},o,{get:function(){return m},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");m=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",e({},o,{get:function(){return s},set:function(y){var w=U(y);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");s=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",e({},o,{get:function(){return g},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");g=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",e({},o,{get:function(){return h},set:function(y){var w=U(y);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");h=w,this.hasBeenReset=!0}})),n.displayState=void 0}return R.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"parseTimeStamp",function(){return I}),A.d(j,"fixLineBreaks",function(){return d}),A.d(j,"VTTParser",function(){return l});var B=A("./src/utils/vttcue.ts"),C=function(){function n(){}var o=n.prototype;return o.decode=function(a,r){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},n}();function I(n){function o(a,r,i,t){return(a|0)*3600+(r|0)*60+(i|0)+parseFloat(t||0)}var u=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return u?parseFloat(u[2])>59?o(u[2],u[3],0,u[4]):o(u[1],u[2],u[3],u[4]):null}var H=function(){function n(){this.values=Object.create(null)}var o=n.prototype;return o.set=function(a,r){!this.get(a)&&r!==""&&(this.values[a]=r)},o.get=function(a,r,i){return i?this.has(a)?this.values[a]:r[i]:this.has(a)?this.values[a]:r},o.has=function(a){return a in this.values},o.alt=function(a,r,i){for(var t=0;t<i.length;++t)if(r===i[t]){this.set(a,r);break}},o.integer=function(a,r){/^-?\d+$/.test(r)&&this.set(a,parseInt(r,10))},o.percent=function(a,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var i=parseFloat(r);if(i>=0&&i<=100)return this.set(a,i),!0}return!1},n}();function U(n,o,u,a){var r=a?n.split(a):[n];for(var i in r){if(typeof r[i]!="string")continue;var t=r[i].split(u);if(t.length!==2)continue;var _=t[0],f=t[1];o(_,f)}}var e=new B.default(0,0,""),R=e.align==="middle"?"middle":"center";function p(n,o,u){var a=n;function r(){var _=I(n);if(_===null)throw new Error("Malformed timestamp: "+a);return n=n.replace(/^[^\sa-zA-Z-]+/,""),_}function i(_,f){var v=new H;U(_,function(m,s){var g;switch(m){case"region":for(var h=u.length-1;h>=0;h--)if(u[h].id===s){v.set(m,u[h].region);break}break;case"vertical":v.alt(m,s,["rl","lr"]);break;case"line":g=s.split(","),v.integer(m,g[0]),v.percent(m,g[0])&&v.set("snapToLines",!1),v.alt(m,g[0],["auto"]),g.length===2&&v.alt("lineAlign",g[1],["start",R,"end"]);break;case"position":g=s.split(","),v.percent(m,g[0]),g.length===2&&v.alt("positionAlign",g[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":v.percent(m,s);break;case"align":v.alt(m,s,["start",R,"end","left","right"]);break}},/:/,/\s/),f.region=v.get("region",null),f.vertical=v.get("vertical","");var x=v.get("line","auto");x==="auto"&&e.line===-1&&(x=-1),f.line=x,f.lineAlign=v.get("lineAlign","start"),f.snapToLines=v.get("snapToLines",!0),f.size=v.get("size",100),f.align=v.get("align",R);var b=v.get("position","auto");b==="auto"&&e.position===50&&(b=f.align==="start"||f.align==="left"?0:f.align==="end"||f.align==="right"?100:50),f.position=b}function t(){n=n.replace(/^\s+/,"")}if(t(),o.startTime=r(),t(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);n=n.substr(3),t(),o.endTime=r(),t(),i(n,o)}function d(n){return n.replace(/<br(?: \/)?>/gi,`
`)}var l=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new C,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=n.prototype;return o.parse=function(a){var r=this;a&&(r.buffer+=r.decoder.decode(a,{stream:!0}));function i(){var b=r.buffer,m=0;for(b=d(b);m<b.length&&b[m]!=="\r"&&b[m]!==`
`;)++m;var s=b.substr(0,m);return b[m]==="\r"&&++m,b[m]===`
`&&++m,r.buffer=b.substr(m),s}function t(b){U(b,function(m,s){},/:/)}try{var _="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;_=i();var f=_.match(/^()?WEBVTT([ \t].*)?$/);if(!f||!f[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var v=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;v?v=!1:_=i();switch(r.state){case"HEADER":/:/.test(_)?t(_):_||(r.state="ID");continue;case"NOTE":_||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(_)){r.state="NOTE";break}if(!_)continue;if(r.cue=new B.default(0,0,""),r.state="CUE",_.indexOf("-->")===-1){r.cue.id=_;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{p(_,r.cue,r.regionList)}catch(b){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var x=_.indexOf("-->")!==-1;if(!_||x&&(v=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=_}continue;case"BADCUE":_||(r.state="ID")}}}catch(b){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){a.onparsingerror&&a.onparsingerror(r)}return a.onflush&&a.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(te,j,A){"use strict";A.r(j),A.d(j,"generateCueId",function(){return l}),A.d(j,"parseWebVTT",function(){return o});var B=A("./src/polyfills/number.ts"),C=A("./src/utils/vttparser.ts"),I=A("./src/demux/id3.ts"),H=A("./src/utils/timescale-conversion.ts"),U=A("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,R=function(a,r,i){return i===void 0&&(i=0),a.substr(i,r.length)===r},p=function(a){var r=parseInt(a.substr(-3)),i=parseInt(a.substr(-6,2)),t=parseInt(a.substr(-9,2)),_=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(B.isFiniteNumber)(r)||!Object(B.isFiniteNumber)(i)||!Object(B.isFiniteNumber)(t)||!Object(B.isFiniteNumber)(_))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return r+=1e3*i,r+=60*1e3*t,r+=60*60*1e3*_,r},d=function(a){for(var r=5381,i=a.length;i;)r=r*33^a.charCodeAt(--i);return(r>>>0).toString()};function l(u,a,r){return d(u.toString())+d(a.toString())+d(r)}var n=function(a,r,i){var t=a[r],_=a[t.prevCC];if(!_||!_.new&&t.new){a.ccOffset=a.presentationOffset=t.start,t.new=!1;return}for(;(f=_)!==null&&f!==void 0&&f.new;){var f;a.ccOffset+=t.start-_.start,t.new=!1,t=_,_=a[t.prevCC]}a.presentationOffset=i};function o(u,a,r,i,t,_,f,v){var x=new C.VTTParser,b=Object(I.utf8ArrayToStr)(new Uint8Array(u)).trim().replace(e,`
`).split(`
`),m=[],s=Object(H.toMpegTsClockFromTimescale)(a,r),g="00:00.000",h=0,T=0,y,w=!0,P=!1;x.oncue=function(L){var S=i[t],D=i.ccOffset,F=(h-s)/9e4;if(S!=null&&S.new&&(T!==void 0?D=i.ccOffset=S.start:n(i,t,F)),F&&(D=F-i.presentationOffset),P){var O=L.endTime-L.startTime,W=Object(U.normalizePts)((L.startTime+D-T)*9e4,_*9e4)/9e4;L.startTime=W,L.endTime=W+O}var z=L.text.trim();L.text=decodeURIComponent(encodeURIComponent(z)),L.id||(L.id=l(L.startTime,L.endTime,z)),L.endTime>0&&m.push(L)},x.onparsingerror=function(L){y=L},x.onflush=function(){if(y){v(y);return}f(m)},b.forEach(function(L){if(w)if(R(L,"X-TIMESTAMP-MAP=")){w=!1,P=!0,L.substr(16).split(",").forEach(function(S){R(S,"LOCAL:")?g=S.substr(6):R(S,"MPEGTS:")&&(h=parseInt(S.substr(7)))});try{T=p(g)/1e3}catch(S){P=!1,y=S}return}else L===""&&(w=!1);x.parse(L+`
`)}),x.flush()}},"./src/utils/xhr-loader.ts":function(te,j,A){"use strict";A.r(j);var B=A("./src/utils/logger.ts"),C=A("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,H=function(){function U(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 C.LoadStats,this.retryDelay=0}var e=U.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},e.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(p,d,l){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=d,this.callbacks=l,this.retryDelay=d.retryDelay,this.loadInternal()},e.loadInternal=function(){var p=this.config,d=this.context;if(!p)return;var l=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var o=this.xhrSetup;try{if(o)try{o(l,d.url)}catch(r){l.open("GET",d.url,!0),o(l,d.url)}l.readyState||l.open("GET",d.url,!0);var u=this.context.headers;if(u)for(var a in u)l.setRequestHeader(a,u[a])}catch(r){this.callbacks.onError({code:l.status,text:r.message},d,l);return}d.rangeEnd&&l.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),l.onreadystatechange=this.readystatechange.bind(this),l.onprogress=this.loadprogress.bind(this),l.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),l.send()},e.readystatechange=function(){var p=this.context,d=this.loader,l=this.stats;if(!p||!d)return;var n=d.readyState,o=this.config;if(l.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),l.loading.first===0&&(l.loading.first=Math.max(self.performance.now(),l.loading.start)),n===4){d.onreadystatechange=null,d.onprogress=null;var u=d.status;if(u>=200&&u<300){l.loading.end=Math.max(self.performance.now(),l.loading.first);var a,r;if(p.responseType==="arraybuffer"?(a=d.response,r=a.byteLength):(a=d.responseText,r=a.length),l.loaded=l.total=r,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(l,p,a,d),!this.callbacks)return;var t={url:d.responseURL,data:a};this.callbacks.onSuccess(t,l,p,d)}else l.retry>=o.maxRetry||u>=400&&u<499?(B.logger.error(u+" while loading "+p.url),this.callbacks.onError({code:u,text:d.statusText},p,d)):(B.logger.warn(u+" while loading "+p.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,o.maxRetryDelay),l.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},e.loadtimeout=function(){B.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(p){var d=this.stats;d.loaded=p.loaded,p.lengthComputable&&(d.total=p.total)},e.getCacheAge=function(){var p=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");p=d?parseFloat(d):null}return p},U}();j.default=H}}).default})},vHTk:function(Ze,le,K){Ze.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);