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.
403 lines
1.0 MiB
403 lines
1.0 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[221,4,7,8,15],{"+ua5":function(Ke,ye,j){},"+vTd":function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(Ke,ye,j){"use strict";j.d(ye,"f",function(){return R}),j.d(ye,"g",function(){return N}),j.d(ye,"h",function(){return S}),j.d(ye,"e",function(){return F}),j.d(ye,"b",function(){return B}),j.d(ye,"c",function(){return e}),j.d(ye,"d",function(){return w}),j.d(ye,"a",function(){return g});class ue{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(u){setTimeout(()=>{throw u.stack?new Error(u.message+`
|
|
|
|
`+u.stack):u},0)}}emit(u){this.listeners.forEach(l=>{l(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}const W=new ue;function R(u){F(u)||W.onUnexpectedError(u);return}function N(u){F(u)||W.onUnexpectedExternalError(u);return}function S(u){if(u instanceof Error){let{name:l,message:s}=u;const i=u.stacktrace||u.stack;return{$isError:!0,name:l,message:s,stack:i}}return u}const O="Canceled";function F(u){return u instanceof Error&&u.name===O&&u.message===O}function B(){const u=new Error(O);return u.name=u.message,u}function e(u){return u?new Error(`Illegal argument: ${u}`):new Error("Illegal argument")}function w(u){return u?new Error(`Illegal state: ${u}`):new Error("Illegal state")}class g extends Error{constructor(u){super("NotSupported");u&&(this.message=u)}}},"1vnw":function(Ke,ye,j){Ke.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return W});class ue{constructor(R){this.element=R,this.next=ue.Undefined,this.prev=ue.Undefined}}ue.Undefined=new ue(void 0);class W{constructor(){this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ue.Undefined}clear(){let R=this._first;for(;R!==ue.Undefined;){const N=R.next;R.prev=ue.Undefined,R.next=ue.Undefined,R=N}this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}unshift(R){return this._insert(R,!1)}push(R){return this._insert(R,!0)}_insert(R,N){const S=new ue(R);if(this._first===ue.Undefined)this._first=S,this._last=S;else if(N){const F=this._last;this._last=S,S.prev=F,F.next=S}else{const F=this._first;this._first=S,S.next=F,F.prev=S}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(S))}}shift(){if(this._first===ue.Undefined)return;{const R=this._first.element;return this._remove(this._first),R}}pop(){if(this._last===ue.Undefined)return;{const R=this._last.element;return this._remove(this._last),R}}_remove(R){if(R.prev!==ue.Undefined&&R.next!==ue.Undefined){const N=R.prev;N.next=R.next,R.next.prev=N}else R.prev===ue.Undefined&&R.next===ue.Undefined?(this._first=ue.Undefined,this._last=ue.Undefined):R.next===ue.Undefined?(this._last=this._last.prev,this._last.next=ue.Undefined):R.prev===ue.Undefined&&(this._first=this._first.next,this._first.prev=ue.Undefined);this._size-=1}*[Symbol.iterator](){let R=this._first;for(;R!==ue.Undefined;)yield R.element,R=R.next}}},"3/fG":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return W});function ue(R,N){let S;return N.length===0?S=R:S=R.replace(/\{(\d+)\}/g,function(O,F){const B=F[0];return typeof N[B]!="undefined"?N[B]:O}),S}function W(R,N,...S){return ue(N,S)}},"5VLF":function(Ke,ye,j){"use strict";var ue,W;function R(N,S,O){var F=function(B,e){return N.js_beautify(B,e)};return F.js=N.js_beautify,F.css=S.css_beautify,F.html=O.html_beautify,F.js_beautify=N.js_beautify,F.css_beautify=S.css_beautify,F.html_beautify=O.html_beautify,F}!(ue=[j("6UM0"),j("TXwP"),j("psGv")],W=function(N,S,O){return R(N,S,O)}.apply(ye,ue),W!==void 0&&(Ke.exports=W))},"5Y4S":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return R});var ue=j("MNsG");const W=ue.b.performance&&typeof ue.b.performance.now=="function";class R{constructor(N){this._highResolution=W&&N,this._startTime=this._now(),this._stopTime=-1}static create(N=!0){return new R(N)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ue.b.performance.now():Date.now()}}},"6UM0":function(Ke,ye,j){var ue,W;(function(){var R;(function(){"use strict";var S=[function(e,w,g){var u=g(1).Beautifier,l=g(5).Options;function s(i,o){var a=new u(i,o);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new l}},function(e,w,g){var u=g(2).Output,l=g(3).Token,s=g(4),i=g(5).Options,o=g(7).Tokenizer,a=g(7).line_starters,r=g(7).positionable_operators,n=g(7).TOKEN;function t(I,V){return V.indexOf(I)!==-1}function v(I){return I.replace(/^\s+/g,"")}function c(I){for(var V={},$=0;$<I.length;$++)V[I[$].replace(/-/g,"_")]=I[$];return V}function p(I,V){return I&&I.type===n.RESERVED&&I.text===V}function b(I,V){return I&&I.type===n.RESERVED&&t(I.text,V)}var y=["case","return","do","if","throw","else","await","break","continue","async"],d=["before-newline","after-newline","preserve-newline"],f=c(d),m=[f.before_newline,f.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(I,V){if(V.multiline_frame||V.mode===h.ForInitializer||V.mode===h.Conditional)return;I.remove_indent(V.start_line_index)}function _(I){I=I.replace(s.allLineBreaks,`
|
|
`);for(var V=[],$=I.indexOf(`
|
|
`);$!==-1;)V.push(I.substring(0,$)),I=I.substring($+1),$=I.indexOf(`
|
|
`);return I.length&&V.push(I),V}function T(I){return I===h.ArrayLiteral}function k(I){return t(I,[h.Expression,h.ForInitializer,h.Conditional])}function D(I,V){for(var $=0;$<I.length;$++){var ge=I[$].trim();if(ge.charAt(0)!==V)return!1}return!0}function x(I,V){for(var $=0,ge=I.length,te;$<ge;$++)if(te=I[$],te&&te.indexOf(V)!==0)return!1;return!0}function P(I,V){V=V||{},this._source_text=I||"",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 i(V)}P.prototype.create_flags=function(I,V){var $=0;I&&($=I.indentation_level,!this._output.just_added_newline()&&I.line_indent_level>$&&($=I.line_indent_level));var ge={mode:V,parent:I,last_token:I?I.last_token:new l(n.START_BLOCK,""),last_word:I?I.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:$,alignment:0,line_indent_level:I?I.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ge},P.prototype._reset=function(I){var V=I.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new u(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var $=new o(I,this._options);return this._tokens=$.tokenize(),I},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I,V=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
`,V&&s.lineBreak.test(V||"")&&($=V.match(s.lineBreak)[0]));for(var ge=this._tokens.next();ge;)this.handle_token(ge),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ge,ge=this._tokens.next();return I=this._output.get_code($),I},P.prototype.handle_token=function(I,V){I.type===n.START_EXPR?this.handle_start_expr(I):I.type===n.END_EXPR?this.handle_end_expr(I):I.type===n.START_BLOCK?this.handle_start_block(I):I.type===n.END_BLOCK?this.handle_end_block(I):I.type===n.WORD?this.handle_word(I):I.type===n.RESERVED?this.handle_word(I):I.type===n.SEMICOLON?this.handle_semicolon(I):I.type===n.STRING?this.handle_string(I):I.type===n.EQUALS?this.handle_equals(I):I.type===n.OPERATOR?this.handle_operator(I):I.type===n.COMMA?this.handle_comma(I):I.type===n.BLOCK_COMMENT?this.handle_block_comment(I,V):I.type===n.COMMENT?this.handle_comment(I,V):I.type===n.DOT?this.handle_dot(I):I.type===n.EOF?this.handle_eof(I):I.type===n.UNKNOWN?this.handle_unknown(I,V):this.handle_unknown(I,V)},P.prototype.handle_whitespace_and_comments=function(I,V){var $=I.newlines,ge=this._options.keep_array_indentation&&T(this._flags.mode);if(I.comments_before)for(var te=I.comments_before.next();te;)this.handle_whitespace_and_comments(te,V),this.handle_token(te,V),te=I.comments_before.next();if(ge)for(var be=0;be<$;be+=1)this.print_newline(be>0,V);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,V);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,V)}};var H=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(I,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&I.newlines||V,ge=t(this._flags.last_token.text,r)||t(I.text,r);if(ge){var te=t(this._flags.last_token.text,r)&&t(this._options.operator_position,m)||t(I.text,r);$=$&&te}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(b(this._flags.last_token,H))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(I,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&p($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(I)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(I){this._output.just_added_newline()&&(this._options.keep_array_indentation&&I.newlines&&(I.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(I.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))},P.prototype.print_token=function(I){if(this._output.raw){this._output.add_raw_token(I);return}if(this._options.comma_first&&I.previous&&I.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(I),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(I),this._output.non_breaking_space=!0,this._output.add_token(I.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},P.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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))},P.prototype.set_mode=function(I){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,I),this._flags=this.create_flags(this._previous_flags,I),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.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||b(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(I){var V=!1;return V=V||b(this._flags.last_token,["var","let","const"])&&I.type===n.WORD,V=V||p(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&b(this._flags.last_token,H)&&!I.newlines,V=V||p(this._flags.last_token,"else")&&!(p(I,"if")&&!I.comments_before),V=V||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),V=V||this._flags.last_token.type===n.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(I.text==="--"||I.text==="++")&&this._last_last_text!=="function"&&I.type!==n.WORD&&I.type!==n.RESERVED,V=V||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"])),V?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(I,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I,b(I,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I);var V=h.Expression;if(I.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){b(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(I),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=h.ArrayLiteral,T(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,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=h.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=h.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&I.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===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ge=this._tokens.peek(-4);b($,["async","function"])||$.text==="*"&&b(ge,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ge.text==="{"||ge.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(I);(this._flags.last_token.type===n.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===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(I,I.newlines),this.print_token(I),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(I){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(I,I.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.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(I),this.restore_mode(),E(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)},P.prototype.handle_start_block=function(I){this.handle_whitespace_and_comments(I);var V=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):$&&(t($.text,[":",","])&&t(V.type,[n.STRING,n.WORD,n.RESERVED])||t(V.text,["get","set","..."])&&t($.type,[n.WORD,n.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t($.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):t(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||b(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(b(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ge=!V.comments_before&&V.text==="}",te=ge&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var be=0,ve=null;this._flags.inline_frame=!0;do if(be+=1,ve=this._tokens.peek(be-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==n.EOF&&!(ve.type===n.END_BLOCK&&ve.opened===I))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(te||this._flags.last_token.type===n.EQUALS||b(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(I),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(I),this.indent(),!ge&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(I){for(this.handle_whitespace_and_comments(I);this._flags.mode===h.Statement;)this.restore_mode();var V=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(T(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(I)},P.prototype.handle_word=function(I){if(I.type===n.RESERVED){if(t(I.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)I.type=n.WORD;else if(I.text==="import"&&t(this._tokens.peek().text,["(","."]))I.type=n.WORD;else if(t(I.text,["as","from"])&&!this._flags.import_block)I.type=n.WORD;else if(this._flags.mode===h.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(I.type=n.WORD)}}if(this.start_of_statement(I)?b(this._flags.last_token,["var","let","const"])&&I.type===n.WORD&&(this._flags.declaration_statement=!0):I.newlines&&!k(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!b(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(I),this.print_newline()):this.handle_whitespace_and_comments(I),this._flags.do_block&&!this._flags.do_while)if(p(I,"while")){this._output.space_before_token=!0,this.print_token(I),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&&p(I,"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&&b(I,["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(I),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I)),p(I,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!I.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?b(this._flags.last_token,["get","set","new","export"])||b(this._flags.last_token,H)?this._output.space_before_token=!0:p(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===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(k(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(I),this._flags.last_word=I.text;return}var $="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":b(I,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===h.BlockStatement?$="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&k(this._flags.mode)?$="SPACE":this._flags.last_token.type===n.STRING?$="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),b(I,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),b(I,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ge=this._output.current_line;ge.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?b(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&b(I,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!b(I,["var","let","const"]))&&this._flags.last_token.text!==":"&&(p(I,"if")&&p(I.previous,"else")?this._output.space_before_token=!0:this.print_newline()):b(I,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);I.previous&&(I.previous.type===n.WORD||I.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(I),this._flags.last_word=I.text,I.type===n.RESERVED&&(I.text==="do"?this._flags.do_block=!0:I.text==="if"?this._flags.if_block=!0:I.text==="import"?this._flags.import_block=!0:this._flags.import_block&&p(I,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(I){this.start_of_statement(I)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(I);for(var V=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&p(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(I)},P.prototype.handle_string=function(I){I.text.startsWith("`")&&I.newlines===0&&I.whitespace_before===""&&(I.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(I)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(I),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I):I.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(I.previous.text==="]"||I.previous.text===")")&&I.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(I)},P.prototype.handle_equals=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0},P.prototype.handle_comma=function(I){this.handle_whitespace_and_comments(I,!0),this.print_token(I),this._output.space_before_token=!0,this._flags.declaration_statement?(k(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(I)):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(I)},P.prototype.handle_operator=function(I){var V=I.text==="*"&&(b(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),$=t(I.text,["-","+"])&&(t(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||t(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(I)){var ge=!V;this.handle_whitespace_and_comments(I,ge)}if(I.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(I);return}if(I.text==="::"){this.print_token(I);return}if(this._flags.last_token.type===n.OPERATOR&&t(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(I),I.text===":"&&this._flags.in_case){this.print_token(I),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.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 te=!0,be=!0,ve=!1;if(I.text===":"?this._flags.ternary_depth===0?te=!1:(this._flags.ternary_depth-=1,ve=!0):I.text==="?"&&(this._flags.ternary_depth+=1),!$&&!V&&this._options.preserve_newlines&&t(I.text,r)){var oe=I.text===":",le=oe&&ve,_e=oe&&!ve;switch(this._options.operator_position){case f.before_newline:this._output.space_before_token=!_e,this.print_token(I),(!oe||le)&&this.allow_wrap_or_preserved_newline(I),this._output.space_before_token=!0;return;case f.after_newline:this._output.space_before_token=!0,!oe||le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(I):this._output.space_before_token=!1,this.print_token(I),this._output.space_before_token=!0;return;case f.preserve_newline:_e||this.allow_wrap_or_preserved_newline(I),te=!(this._output.just_added_newline()||_e),this._output.space_before_token=te,this.print_token(I),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(I),te=!1;var ee=this._tokens.peek();be=ee&&t(ee.type,[n.WORD,n.RESERVED])}else if(I.text==="...")this.allow_wrap_or_preserved_newline(I),te=this._flags.last_token.type===n.START_BLOCK,be=!1;else if(t(I.text,["--","++","!","~"])||$){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(I),te=!1,be=!1,I.newlines&&(I.text==="--"||I.text==="++"||I.text==="~")){var L=b(this._flags.last_token,y)&&I.newlines;L&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(L,!0)}this._flags.last_token.text===";"&&k(this._flags.mode)&&(te=!0),this._flags.last_token.type===n.RESERVED?te=!0:this._flags.last_token.type===n.END_EXPR?te=!(this._flags.last_token.text==="]"&&(I.text==="--"||I.text==="++")):this._flags.last_token.type===n.OPERATOR&&(te=t(I.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(I.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(be=!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||te,this.print_token(I),this._output.space_before_token=be},P.prototype.handle_block_comment=function(I,V){if(this._output.raw){this._output.add_raw_token(I),I.directives&&I.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(I.directives){this.print_newline(!1,V),this.print_token(I),I.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!s.newline.test(I.text)&&!I.newlines){this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0;return}else this.print_block_commment(I,V)},P.prototype.print_block_commment=function(I,V){var $=_(I.text),ge,te=!1,be=!1,ve=I.whitespace_before,oe=ve.length;if(this.print_newline(!1,V),this.print_token_line_indentation(I),this._output.add_token($[0]),this.print_newline(!1,V),$.length>1){for($=$.slice(1),te=D($,"*"),be=x($,ve),te&&(this._flags.alignment=1),ge=0;ge<$.length;ge++)te?(this.print_token_line_indentation(I),this._output.add_token(v($[ge]))):be&&$[ge]?(this.print_token_line_indentation(I),this._output.add_token($[ge].substring(oe))):(this._output.current_line.set_indent(-1),this._output.add_token($[ge])),this.print_newline(!1,V);this._flags.alignment=0}},P.prototype.handle_comment=function(I,V){I.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(I),this.print_newline(!1,V)},P.prototype.handle_dot=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),b(this._flags.last_token,y)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(I,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(I)},P.prototype.handle_unknown=function(I,V){this.print_token(I),I.text[I.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},P.prototype.handle_eof=function(I){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I)},e.exports.Beautifier=P},function(e){function w(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=[]}w.prototype.clone_empty=function(){var l=new w(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},w.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},w.prototype.has_match=function(l){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(l))return!0;return!1},w.prototype.set_indent=function(l,s){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.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)},w.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},w.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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(l){this.__items.push(l);var s=l.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=l.length-s:this.__character_count+=l.length},w.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.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 g(l,s){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)),s=s||"",l.indent_level>0&&(s=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}g.prototype.get_indent_size=function(l,s){var i=this.__base_string_length;return s=s||0,l<0&&(i=0),i+=l*this.__indent_size,i+=s,i},g.prototype.get_indent_string=function(l,s){var i=this.__base_string;return s=s||0,l<0&&(l=0,i=""),s+=l*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},g.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var l=this.__cache.length,s=0,i="";this.__indent_size&&l>=this.__indent_size&&(s=Math.floor(l/this.__indent_size),l-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),l&&(i+=new Array(l+1).join(" ")),this.__cache.push(i)};function u(l,s){this.__indent_cache=new g(l,s),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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(l,s){return this.__indent_cache.get_indent_string(l,s)},u.prototype.get_indent_size=function(l,s){return this.__indent_cache.get_indent_size(l,s)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(l){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return l!==`
|
|
`&&(i=i.replace(/[\n]/g,l)),i},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(l,s){return l=l||0,s=s||0,this.next_line.set_indent(l,s),this.__lines.length>1?(this.current_line.set_indent(l,s),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(l){for(var s=0;s<l.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(l){for(var s=this.__lines.length;l<s;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(l,s){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(l)!==0&&o.item(-1)!==s){this.__lines.splice(i+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=u},function(e){function w(g,u,l,s){this.type=g,this.text=u,this.comments_before=null,this.newlines=l||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=w},function(e,w){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\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",s="\\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",i="(?:\\\\u[0-9a-fA-F]{4}|["+g+l+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+u+l+s+"])*";w.identifier=new RegExp(i+o,"g"),w.identifierStart=new RegExp(i),w.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+u+l+s+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;w.newline=/[\n\r\u2028\u2029]/,w.lineBreak=new RegExp(`\r
|
|
|`+w.newline.source),w.allLineBreaks=new RegExp(w.lineBreak.source,"g")},function(e,w,g){var u=g(6).Options,l=["before-newline","after-newline","preserve-newline"];function s(i){u.call(this,i,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="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)}s.prototype=new u,e.exports.Options=s},function(e){function w(l,s){this.raw_options=g(l,s),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"])}w.prototype._get_array=function(l,s){var i=this.raw_options[l],o=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},w.prototype._get_boolean=function(l,s){var i=this.raw_options[l],o=i===void 0?!!s:!!i;return o},w.prototype._get_characters=function(l,s){var i=this.raw_options[l],o=s||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},w.prototype._get_number=function(l,s){var i=this.raw_options[l];s=parseInt(s,10),isNaN(s)&&(s=0);var o=parseInt(i,10);return isNaN(o)&&(o=s),o},w.prototype._get_selection=function(l,s,i){var o=this._get_selection_list(l,s,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[l]+"'");return o[0]},w.prototype._get_selection_list=function(l,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var o=this._get_array(l,i);if(!this._is_valid_selection(o,s))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[l]+"'");return o},w.prototype._is_valid_selection=function(l,s){return l.length&&s.length&&!l.some(function(i){return s.indexOf(i)===-1})};function g(l,s){var i={};l=u(l);var o;for(o in l)o!==s&&(i[o]=l[o]);if(s&&l[s])for(o in l[s])i[o]=l[s][o];return i}function u(l){var s={},i;for(i in l){var o=i.replace(/-/g,"_");s[o]=l[i]}return s}e.exports.Options=w,e.exports.normalizeOpts=u,e.exports.mergeOpts=g},function(e,w,g){var u=g(8).InputScanner,l=g(9).Tokenizer,s=g(9).TOKEN,i=g(13).Directives,o=g(4),a=g(12).Pattern,r=g(14).TemplatablePattern;function n(D,x){return x.indexOf(D)!==-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:s.START,RAW:s.RAW,EOF:s.EOF},v=new i(/\/\*/,/\*\//),c=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,p=/[0-9]/,b=/[^\d\.]/,y=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),d=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";d=d.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),d="\\?\\.(?!\\d) "+d,d=d.replace(/ /g,"|");var f=new RegExp(d),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+h.join("|")+")$"),_,T=function(D,x){l.call(this,D,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new a(this._input),H=new r(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(o.identifier).matching(o.identifierMatch),number:P.matching(c),punct:P.matching(f),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(/<!--/),html_comment_end:P.matching(/-->/),include:P.starting_with(/#include/).until_after(o.lineBreak),shebang:P.starting_with(/#!/).until_after(o.lineBreak),xml:P.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:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};T.prototype=new l,T.prototype._is_comment=function(D){return D.type===t.COMMENT||D.type===t.BLOCK_COMMENT||D.type===t.UNKNOWN},T.prototype._is_opening=function(D){return D.type===t.START_BLOCK||D.type===t.START_EXPR},T.prototype._is_closing=function(D,x){return(D.type===t.END_BLOCK||D.type===t.END_EXPR)&&x&&(D.text==="]"&&x.text==="["||D.text===")"&&x.text==="("||D.text==="}"&&x.text==="{")},T.prototype._reset=function(){_=!1},T.prototype._get_next_token=function(D,x){var P=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(t.EOF,""):(P=P||this._read_non_javascript(H),P=P||this._read_string(H),P=P||this._read_word(D),P=P||this._read_singles(H),P=P||this._read_comment(H),P=P||this._read_regexp(H,D),P=P||this._read_xml(H,D),P=P||this._read_punctuation(),P=P||this._create_token(t.UNKNOWN,this._input.next()),P)},T.prototype._read_word=function(D){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(o.allLineBreaks,`
|
|
`),!(D.type===t.DOT||D.type===t.RESERVED&&(D.text==="set"||D.text==="get"))&&E.test(x)?(x==="in"||x==="of")&&(D.type===t.WORD||D.type===t.STRING)?this._create_token(t.OPERATOR,x):this._create_token(t.RESERVED,x):this._create_token(t.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(t.WORD,x)},T.prototype._read_singles=function(D){var x=null;return D==="("||D==="["?x=this._create_token(t.START_EXPR,D):D===")"||D==="]"?x=this._create_token(t.END_EXPR,D):D==="{"?x=this._create_token(t.START_BLOCK,D):D==="}"?x=this._create_token(t.END_BLOCK,D):D===";"?x=this._create_token(t.SEMICOLON,D):D==="."&&b.test(this._input.peek(1))?x=this._create_token(t.DOT,D):D===","&&(x=this._create_token(t.COMMA,D)),x&&this._input.next(),x},T.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(t.EQUALS,D):D==="?."?this._create_token(t.DOT,D):this._create_token(t.OPERATOR,D)},T.prototype._read_non_javascript=function(D){var x="";if(D==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(t.UNKNOWN,x.trim()+`
|
|
`);if(x=this.__patterns.include.read(),x)return this._create_token(t.UNKNOWN,x.trim()+`
|
|
`);D=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(p)){do D=this._input.next(),P+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,P)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)x+=this._input.next();return _=!0,this._create_token(t.COMMENT,x)}}else if(_&&D==="-"&&(x=this.__patterns.html_comment_end.read(),x))return _=!1,this._create_token(t.COMMENT,x);return null},T.prototype._read_comment=function(D){var x=null;if(D==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var H=v.get_directives(P);H&&H.ignore==="start"&&(P+=v.readIgnored(this._input)),P=P.replace(o.allLineBreaks,`
|
|
`),x=this._create_token(t.BLOCK_COMMENT,P),x.directives=H}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),x=this._create_token(t.COMMENT,P))}return x},T.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var x=this._input.next();return this.has_char_escapes=!1,D==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(x=k(x)),this._input.peek()===D&&(x+=this._input.next()),x=x.replace(o.allLineBreaks,`
|
|
`),this._create_token(t.STRING,x)}return null},T.prototype._allow_regexp_or_xml=function(D){return D.type===t.RESERVED&&n(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===t.END_EXPR&&D.text===")"&&D.opened.previous.type===t.RESERVED&&n(D.opened.previous.text,["if","while","for"])||n(D.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},T.prototype._read_regexp=function(D,x){if(D==="/"&&this._allow_regexp_or_xml(x)){for(var P=this._input.next(),H=!1,I=!1;this._input.hasNext()&&(H||I||this._input.peek()!==D)&&!this._input.testChar(o.newline);)P+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?I=!0:this._input.peek()==="]"&&(I=!1)),this._input.next();return this._input.peek()===D&&(P+=this._input.next(),P+=this._input.read(o.identifier)),this._create_token(t.STRING,P)}return null},T.prototype._read_xml=function(D,x){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(x)){var P="",H=this.__patterns.xml.read_match();if(H){for(var I=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=I.indexOf("{")===0,$=0;H;){var ge=!!H[1],te=H[2],be=!!H[H.length-1]||te.slice(0,8)==="![CDATA[";if(!be&&(te===I||V&&te.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ge?--$:++$),P+=H[0],$<=0)break;H=this.__patterns.xml.read_match()}return H||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(o.allLineBreaks,`
|
|
`),this._create_token(t.STRING,P)}}return null};function k(D){for(var x="",P=0,H=new u(D),I=null;H.hasNext();)if(I=H.match(/([\s]|[^\\]|\\\\)+/g),I&&(x+=I[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")I=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")I=H.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",H.hasNext()&&(x+=H.next());continue}if(!I)return D;if(P=parseInt(I[1],16),P>126&&P<=255&&I[0].indexOf("x")===0)return D;if(P>=0&&P<32){x+="\\"+I[0];continue}else P===34||P===39||P===92?x+="\\"+String.fromCharCode(P):x+=String.fromCharCode(P)}return x}T.prototype._read_string_recursive=function(D,x,P){var H,I;D==="'"?I=this.__patterns.single_quote:D==='"'?I=this.__patterns.double_quote:D==="`"?I=this.__patterns.template_text:D==="}"&&(I=this.__patterns.template_expression);for(var V=I.read(),$="";this._input.hasNext();){if($=this._input.next(),$===D||!x&&o.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),$+=this._input.next()):P&&(P==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),P===$&&(D==="`"?$+=this._read_string_recursive("}",x,"`"):$+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&($+=this._input.next())));$+=I.read(),V+=$}return V},e.exports.Tokenizer=T,e.exports.TOKEN=t,e.exports.positionable_operators=y.slice(),e.exports.line_starters=m.slice()},function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},g.prototype.peek=function(u){var l=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(l=this.__input.charAt(u)),l},g.prototype.__match=function(u,l){u.lastIndex=l;var s=u.exec(this.__input);return s&&!(w&&u.sticky)&&(s.index!==l&&(s=null)),s},g.prototype.test=function(u,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(u,l):!1},g.prototype.testChar=function(u,l){var s=this.peek(l);return u.lastIndex=0,s!==null&&u.test(s)},g.prototype.match=function(u){var l=this.__match(u,this.__position);return l?this.__position+=l[0].length:l=null,l},g.prototype.read=function(u,l,s){var i="",o;return u&&(o=this.match(u),o&&(i+=o[0])),l&&(o||!u)&&(i+=this.readUntil(l,s)),i},g.prototype.readUntil=function(u,l){var s="",i=this.__position;u.lastIndex=this.__position;var o=u.exec(this.__input);return o?(i=o.index,l&&(i+=o[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},g.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},g.prototype.get_regexp=function(u,l){var s=null,i="g";return l&&w&&(i="y"),typeof u=="string"&&u!==""?s=new RegExp(u,i):u&&(s=new RegExp(u.source,i)),s},g.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(u){var l=this.__position,s=this.readUntilAfter(u);return this.__position=l,s},g.prototype.lookBack=function(u){var l=this.__position-1;return l>=u.length&&this.__input.substring(l-u.length,l).toLowerCase()===u},e.exports.InputScanner=g},function(e,w,g){var u=g(8).InputScanner,l=g(3).Token,s=g(10).TokenStream,i=g(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(r,n){this._input=new u(r),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var r,n=new l(o.START,""),t=null,v=[],c=new s;n.type!==o.EOF;){for(r=this._get_next_token(n,t);this._is_comment(r);)c.add(r),r=this._get_next_token(n,t);c.isEmpty()||(r.comments_before=c,c=new s),r.parent=t,this._is_opening(r)?(v.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=v.pop(),r.parent=t),r.previous=n,n.next=r,this.__tokens.add(r),n=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,n){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(o.RAW,t):this._create_token(o.EOF,"")},a.prototype._is_comment=function(r){return!1},a.prototype._is_opening=function(r){return!1},a.prototype._is_closing=function(r,n){return!1},a.prototype._create_token=function(r,n){var t=new l(r,n,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=o},function(e){function w(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}w.prototype.restart=function(){this.__position=0},w.prototype.isEmpty=function(){return this.__tokens_length===0},w.prototype.hasNext=function(){return this.__position<this.__tokens_length},w.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},w.prototype.peek=function(g){var u=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(u=this.__tokens[g]),u},w.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=w},function(e,w,g){var u=g(12).Pattern;function l(s,i){u.call(this,s,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new u,l.prototype.__set_whitespace_patterns=function(s,i){s+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var i=this.__split(this._newline_regexp,s);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return s},l.prototype.matching=function(s,i){var o=this._create();return o.__set_whitespace_patterns(s,i),o._update(),o},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(s,i){s.lastIndex=0;for(var o=0,a=[],r=s.exec(i);r;)a.push(i.substring(o,r.index)),o=r.index+r[0].length,r=s.exec(i);return o<i.length?a.push(i.substring(o,i.length)):a.push(""),a},e.exports.WhitespacePattern=l},function(e){function w(g,u){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}w.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},w.prototype.read_match=function(){return this._input.match(this._match_pattern)},w.prototype.until_after=function(g){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(g),u._update(),u},w.prototype.until=function(g){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(g),u._update(),u},w.prototype.starting_with=function(g){var u=this._create();return u._starting_pattern=this._input.get_regexp(g,!0),u._update(),u},w.prototype.matching=function(g){var u=this._create();return u._match_pattern=this._input.get_regexp(g,!0),u._update(),u},w.prototype._create=function(){return new w(this._input,this)},w.prototype._update=function(){},e.exports.Pattern=w},function(e){function w(g,u){g=typeof g=="string"?g:g.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+u,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(g);l;)u[l[1]]=l[2],l=this.__directive_pattern.exec(g);return u},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},function(e,w,g){var u=g(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,o){u.call(this,i,o),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var a=new u(i);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}/)}}s.prototype=new u,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(i){var o=this._create();return o._disabled[i]=!0,o._update(),o},s.prototype.read_options=function(i){var o=this._create();for(var a in l)o._disabled[a]=i.templating.indexOf(a)===-1;return o._update(),o},s.prototype.exclude=function(i){var o=this._create();return o._excluded[i]=!0,o._update(),o},s.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),i+=o,o=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},s.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},s.prototype._read_template=function(){var i="",o=this._input.peek();if(o==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(i=i||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},e.exports.TemplatablePattern=s}],O={};function F(e){var w=O[e];if(w!==void 0)return w.exports;var g=O[e]={exports:{}};return S[e](g,g.exports,F),g.exports}var B=F(0);R=B})();var N=R;!(ue=[],W=function(){return{js_beautify:N}}.apply(ye,ue),W!==void 0&&(Ke.exports=W))})()},"746U":function(Ke,ye,j){"use strict";j.d(ye,"f",function(){return ue}),j.d(ye,"l",function(){return W}),j.d(ye,"k",function(){return R}),j.d(ye,"j",function(){return N}),j.d(ye,"g",function(){return S}),j.d(ye,"m",function(){return O}),j.d(ye,"h",function(){return F}),j.d(ye,"n",function(){return B}),j.d(ye,"c",function(){return e}),j.d(ye,"a",function(){return w}),j.d(ye,"i",function(){return g}),j.d(ye,"o",function(){return u}),j.d(ye,"e",function(){return i}),j.d(ye,"d",function(){return o}),j.d(ye,"p",function(){return a}),j.d(ye,"b",function(){return r});function ue(n){return Array.isArray(n)}function W(n){return typeof n=="string"}function R(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function N(n){return typeof n=="number"&&!isNaN(n)}function S(n){return n===!0||n===!1}function O(n){return typeof n=="undefined"}function F(n){return!B(n)}function B(n){return O(n)||n===null}function e(n,t){if(!n)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function w(n){if(B(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function g(n){return typeof n=="function"}function u(n,t){const v=Math.min(n.length,t.length);for(let c=0;c<v;c++)l(n[c],t[c])}function l(n,t){if(W(t)){if(typeof n!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(n instanceof t)return}catch(v){}if(!B(n)&&n.constructor===t)return;if(t.length===1&&t.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function s(n){let t=[],v=Object.getPrototypeOf(n);for(;Object.prototype!==v;)t=t.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return t}function i(n){const t=[];for(const v of s(n))typeof n[v]=="function"&&t.push(v);return t}function o(n,t){const v=p=>function(){const b=Array.prototype.slice.call(arguments,0);return t(p,b)};let c={};for(const p of n)c[p]=v(p);return c}function a(n){return n===null?void 0:n}function r(n,t="Unreachable"){throw new Error(t)}},"815F":function(Ke,ye,j){"use strict";j.d(ye,"e",function(){return F}),j.d(ye,"c",function(){return e}),j.d(ye,"d",function(){return w}),j.d(ye,"a",function(){return u}),j.d(ye,"f",function(){return l}),j.d(ye,"b",function(){return s});var ue=j("KQm4"),W=j("VTBJ"),R=j("Ff2n"),N=j("Zm9Q"),S=j("Kwbf"),O=j("OZM5");function F(i,o){return i!=null?i:o}function B(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function a(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var v=t.key,c=t.children;Object(S.a)(v!=null,"Tree node must have a certain key: [".concat(n).concat(v,"]"));var p=String(v);Object(S.a)(!o.has(p)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(p)),o.set(p,!0),a(c,"".concat(n).concat(p," > "))})}a(i)}function e(i){function o(a){var r=Object(N.a)(a);return r.map(function(n){if(!Object(O.i)(n))return Object(S.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var t=n.key,v=n.props,c=v.children,p=Object(R.a)(v,["children"]),b=Object(W.a)({key:t},p),y=o(c);return y.length&&(b.children=y),b}).filter(function(n){return n})}return o(i)}function w(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(o===!0?[]:o),r=[];function n(t){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(c,p){var b=Object(O.h)(v?v.pos:"0",p),y=F(c.key,b),d=Object(W.a)(Object(W.a)({},c),{},{parent:v,pos:b,children:null,data:c,isStart:[].concat(Object(ue.a)(v?v.isStart:[]),[p===0]),isEnd:[].concat(Object(ue.a)(v?v.isEnd:[]),[p===t.length-1])});return r.push(d),o===!0||a.has(y)?d.children=n(c.children||[],d):d.children=[],d})}return n(i),r}function g(i,o,a){var r;a?typeof a=="string"?r=function(v){return v[a]}:typeof a=="function"&&(r=function(v){return a(v)}):r=function(v,c){return F(v.key,c)};function n(t,v,c){var p=t?t.children:i,b=t?Object(O.h)(c.pos,v):"0";if(t){var y=r(t,b),d={node:t,index:v,pos:b,key:y,parentPos:c.node?c.pos:null,level:c.level+1};o(d)}p&&p.forEach(function(f,m){n(f,m,{node:t,pos:b,level:c?c.level+1:-1})})}n(null)}function u(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.initWrapper,r=o.processEntity,n=o.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,v={},c={},p={posEntities:v,keyEntities:c};return a&&(p=a(p)||p),g(i,function(b){var y=b.node,d=b.index,f=b.pos,m=b.key,h=b.parentPos,E=b.level,_={node:y,index:d,key:m,pos:f,level:E},T=F(m,f);v[f]=_,c[T]=_,_.parent=v[h],_.parent&&(_.parent.children=_.parent.children||[],_.parent.children.push(_)),r&&r(_,p)},t),n&&n(p),p}function l(i,o){var a=o.expandedKeys,r=o.selectedKeys,n=o.loadedKeys,t=o.loadingKeys,v=o.checkedKeys,c=o.halfCheckedKeys,p=o.dragOverNodeKey,b=o.dropPosition,y=o.keyEntities,d=y[i],f={eventKey:i,expanded:a.indexOf(i)!==-1,selected:r.indexOf(i)!==-1,loaded:n.indexOf(i)!==-1,loading:t.indexOf(i)!==-1,checked:v.indexOf(i)!==-1,halfChecked:c.indexOf(i)!==-1,pos:String(d?d.pos:""),dragOver:p===i&&b===0,dragOverGapTop:p===i&&b===-1,dragOverGapBottom:p===i&&b===1};return f}function s(i){var o=i.data,a=i.expanded,r=i.selected,n=i.checked,t=i.loaded,v=i.loading,c=i.halfChecked,p=i.dragOver,b=i.dragOverGapTop,y=i.dragOverGapBottom,d=i.pos,f=i.active,m=Object(W.a)(Object(W.a)({},o),{},{expanded:a,selected:r,checked:n,loaded:t,loading:v,halfChecked:c,dragOver:p,dragOverGapTop:b,dragOverGapBottom:y,pos:d,active:f});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(S.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),m}},"8HAY":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return S}),j.d(ye,"b",function(){return O}),j.d(ye,"d",function(){return F}),j.d(ye,"e",function(){return B}),j.d(ye,"c",function(){return e});var ue=j("MI8n"),W=j("pmY6"),R=j("3/fG"),N=function(w,g,u,l){function s(i){return i instanceof u?i:new u(function(o){o(i)})}return new(u||(u=Promise))(function(i,o){function a(t){try{n(l.next(t))}catch(v){o(v)}}function r(t){try{n(l.throw(t))}catch(v){o(v)}}function n(t){t.done?i(t.value):s(t.value).then(a,r)}n((l=l.apply(w,g||[])).next())})};class S extends W.a{constructor(w,g="",u="",l=!0,s){super();this._onDidChange=this._register(new ue.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=g,this._cssClass=u,this._enabled=l,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,g){return N(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class O extends W.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ue.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ue.b),this.onDidRun=this._onDidRun.event}run(w,g){return N(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let u;try{yield this.runAction(w,g)}catch(l){u=l}this._onDidRun.fire({action:w,error:u})})}runAction(w,g){return N(this,void 0,void 0,function*(){yield w.run(g)})}}class F extends S{constructor(w){super(F.ID,w,w?"separator text":"separator");this.checked=!1,this.enabled=!1}}F.ID="vs.actions.separator";class B{constructor(w,g,u,l){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=g,this.class=l,this._actions=u}get actions(){return this._actions}dispose(){}run(){return N(this,void 0,void 0,function*(){})}}class e extends S{constructor(){super(e.ID,R.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Ke,ye,j){Ke.exports={button:"button___1wy9m"}},"9Bee":function(Ke,ye,j){"use strict";var ue=j("DYRE"),W=j("zeV3"),R=j("+L6B"),N=j("2/Rp"),S=j("k1fw"),O=j("9og8"),F=j("tJVT"),B=j("WmNS"),e=j.n(B),w=j("q1tI"),g=j.n(w),u=j("vg9a"),l=j("DlQD"),s=j.n(l),i=j("rUJ1");function o(ne,z){var G=ne.match(/^(\s+)(?:```)/);if(G===null)return z;var J=G[1];return z.split(`
|
|
`).map(function(re){var Y=re.match(/^\s+/);if(Y===null)return re;var Z=Object(F.a)(Y,1),se=Z[0];return se.length>=J.length?re.slice(J.length):re}).join(`
|
|
`)}var a=[],r=["<ul>"],n=new s.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){a.length=0,r=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(ne,z,G,J){if(z>=ne.length||ne[z].level<=G)return z;var re=ne[z];J.push("<li><a href='#"+re.anchor+"'>"+re.text+"</a>"),z++;var Y=[];return z=p(ne,z,re.level,Y),Y.length>0&&(J.push("<ul>"),Y.forEach(function(Z){J.push(Z)}),J.push("</ul>")),J.push("</li>"),z=p(ne,z,G,J),z}function b(){return p(a,0,0,r),r.push("</ul>"),r.join("")}var y={heading:function(z){var G=t.exec(z);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},fences:function(z){var G=this.rules.block.fences.exec(z);if(G){var J=G[0],re=o(J,G[3]||""),Y=G[2]?G[2].trim():G[2];if(["latex","katex","math"].indexOf(Y)>=0){var Z=m(),se=re;re=Z,h[Z]={type:"block",expression:se}}return{type:"code",raw:J,lang:Y,text:re}}}},d=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,m=function(){return"__special_katext_id_".concat(f++,"__")},h={};function E(){return h}function _(){f=0,h={}}function T(ne){return ne=ne.replace(d,function(z,G){var J=m();return h[J]={type:"inline",expression:G},J}),ne}var k=n.listitem;n.listitem=function(ne){return k(T(ne))};var D=n.paragraph;n.paragraph=function(ne){return D(T(ne))};var x=n.tablecell;n.tablecell=function(ne,z){return x(T(ne),z)},n.code=function(ne,z,G){var J=(z||"").match(/\S*/)[0];return J?["latex","katex","math"].indexOf(J)>=0?"<p class='editormd-tex'>".concat(ne,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(z,'">').concat(G?ne:Object(i.escape)(ne,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(G?ne:Object(i.escape)(ne,!0))+"</code></pre>"},n.heading=function(ne,z,G){var J=this.options.headerPrefix+G.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:J,level:z,text:ne}),"<h"+z+' id="'+J+'">'+ne+"</h"+z+">"},s.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),s.a.use({tokenizer:y,renderer:n});var P=s.a,H=j("SJMd"),I=j("ulZh"),V=j.n(I),$=j("m3rI"),ge=j("Oy/b"),te=j("p5ED"),be=j("ErOA"),ve=j("STEk");/* **********************************
|
|
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 oe=function(ne,z){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,J){G.__proto__=J}||function(G,J){for(var re in J)Object.prototype.hasOwnProperty.call(J,re)&&(G[re]=J[re])})(ne,z)};function le(ne,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");function G(){this.constructor=ne}oe(ne,z),ne.prototype=z===null?Object.create(z):(G.prototype=z.prototype,new G)}function _e(ne,z,G,J){return new(G||(G=Promise))(function(re,Y){function Z(De){try{he(J.next(De))}catch(Re){Y(Re)}}function se(De){try{he(J.throw(De))}catch(Re){Y(Re)}}function he(De){var Re;De.done?re(De.value):(Re=De.value,Re instanceof G?Re:new G(function(Ue){Ue(Re)})).then(Z,se)}he((J=J.apply(ne,z||[])).next())})}function ee(ne,z){var G,J,re,Y,Z={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return Y={next:se(0),throw:se(1),return:se(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function se(he){return function(De){return function(Re){if(G)throw new TypeError("Generator is already executing.");for(;Z;)try{if(G=1,J&&(re=2&Re[0]?J.return:Re[0]?J.throw||((re=J.return)&&re.call(J),0):J.next)&&!(re=re.call(J,Re[1])).done)return re;switch(J=0,re&&(Re=[2&Re[0],re.value]),Re[0]){case 0:case 1:re=Re;break;case 4:return Z.label++,{value:Re[1],done:!1};case 5:Z.label++,J=Re[1],Re=[0];continue;case 7:Re=Z.ops.pop(),Z.trys.pop();continue;default:if(!(re=Z.trys,(re=re.length>0&&re[re.length-1])||Re[0]!==6&&Re[0]!==2)){Z=0;continue}if(Re[0]===3&&(!re||Re[1]>re[0]&&Re[1]<re[3])){Z.label=Re[1];break}if(Re[0]===6&&Z.label<re[1]){Z.label=re[1],re=Re;break}if(re&&Z.label<re[2]){Z.label=re[2],Z.ops.push(Re);break}re[2]&&Z.ops.pop(),Z.trys.pop();continue}Re=z.call(ne,Z)}catch(Ue){Re=[6,Ue],J=0}finally{G=re=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([he,De])}}}var L=function(){function ne(){}return ne.addKey=function(z){ne.key=z},Object.defineProperty(ne,"isLicensed",{get:function(){return!!ne.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ne.key)},enumerable:!1,configurable:!0}),ne}(),A=function(){function ne(){}return ne.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ne.setAttributes=function(z,G){for(var J=0,re=G;J<re.length;J++){var Y=re[J],Z=Y[0],se=Y[1];z.setAttribute(Z,se)}},ne.createRect=function(z,G,J){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",z.toString()),re.setAttribute("height",G.toString()),J&&ne.setAttributes(re,J),re},ne.createLine=function(z,G,J,re,Y){var Z=document.createElementNS("http://www.w3.org/2000/svg","line");return Z.setAttribute("x1",z.toString()),Z.setAttribute("y1",G.toString()),Z.setAttribute("x2",J.toString()),Z.setAttribute("y2",re.toString()),Y&&ne.setAttributes(Z,Y),Z},ne.createPolygon=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg","polygon");return J.setAttribute("points",z),G&&ne.setAttributes(J,G),J},ne.createCircle=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg","circle");return J.setAttribute("cx",(z/2).toString()),J.setAttribute("cy",(z/2).toString()),J.setAttribute("r",z.toString()),G&&ne.setAttributes(J,G),J},ne.createEllipse=function(z,G,J){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(z/2).toString()),re.setAttribute("cy",(G/2).toString()),re.setAttribute("rx",(z/2).toString()),re.setAttribute("ry",(G/2).toString()),J&&ne.setAttributes(re,J),re},ne.createGroup=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return z&&ne.setAttributes(G,z),G},ne.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ne.createMarker=function(z,G,J,re,Y,Z,se){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return ne.setAttributes(he,[["id",z],["orient",G],["markerWidth",J.toString()],["markerHeight",re.toString()],["refX",Y.toString()],["refY",Z.toString()]]),he.appendChild(se),he},ne.createText=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),z&&ne.setAttributes(G,z),G},ne.createTSpan=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg","tspan");return J.textContent=z,G&&ne.setAttributes(J,G),J},ne.createImage=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return z&&ne.setAttributes(G,z),G},ne.createPoint=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return J.x=z,J.y=G,J},ne.createPath=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg","path");return J.setAttribute("d",z),G&&ne.setAttributes(J,G),J},ne.createElement=function(z,G){var J=document.createElementNS("http://www.w3.org/2000/svg",z);return G&&ne.setAttributes(J,G),J},ne.getHollowRectanglePath=function(z,G,J,re,Y,Z,se,he){return"M"+z+","+G+"V"+(G+re)+"H"+(z+J)+"V"+G+"H"+Y+"V"+Z+"H"+(Y+se)+"V"+(Z+he)+"H"+Y+"V"+G+"Z"},ne}(),C=function(){function ne(z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+z+"_"}return Object.defineProperty(ne.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ne.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(ne.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ne.prototype.addClass=function(z){return this.styleSheet===void 0&&this.addStyleSheet(),z.name=""+this.classNamePrefix+z.localName,this.classes.push(z),this.styleSheet.sheet.insertRule("."+z.name+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length),z},ne.prototype.addRule=function(z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(z),this.styleSheet.sheet.insertRule(z.selector+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length)},ne.prototype.addStyleSheet=function(){var z;this.styleSheet=document.createElement("style"),((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).appendChild(this.styleSheet),this.addRule(new U("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new U("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new U("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new K("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new K("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ne.prototype.removeStyleSheet=function(){var z;this.styleSheet&&(((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ne}(),U=function(ne,z){this.selector=ne,this.style=z},K=function(ne,z){this.localName=ne,this.style=z},M=function(){function ne(){this.blocks=[],this.display=""}return ne.prototype.addButtonBlock=function(z){z.className=this.blockClassName,z.buttonClassName=this.buttonClassName,z.buttonColorsClassName=this.buttonColorsClassName,z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(z)},ne.prototype.addElementBlock=function(z){z.className===void 0&&(z.className=this.blockClassName),this.blocks.push(z)},ne.prototype.getUI=function(){var z=document.createElement("div");return z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,z.style.display=this.display,this.blocks.forEach(function(G){return z.appendChild(G.getUI())}),z},ne}(),ie=function(){function ne(){}return ne.prototype.getUI=function(){var z=document.createElement("div");if(z.className=this.className,this.minWidth!==void 0&&(z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":z.style.justifyContent="flex-start";break;case"center":z.style.justifyContent="center";break;case"end":z.style.justifyContent="flex-end"}return z.style.whiteSpace="nowrap",z},ne}(),Ee=function(ne){function z(){var G=ne!==null&&ne.apply(this,arguments)||this;return G.buttons=[],G}return le(z,ne),z.prototype.addButton=function(G){G.className=this.buttonClassName,G.colorsClassName=this.buttonColorsClassName,G.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(G)},z.prototype.getUI=function(){var G=ne.prototype.getUI.call(this);return this.buttons.forEach(function(J){return G.appendChild(J.getUI())}),G},z}(ie),Oe=function(){function ne(z,G){this._isActive=!1,this._isHidden=!1,this._icon=z,this.title=G,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ne.prototype,"icon",{get:function(){return this._icon},set:function(z){this._icon=z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isActive",{get:function(){return this._isActive},set:function(z){this._isActive=z,this.adjustClassName()},enumerable:!1,configurable:!0}),ne.prototype.getUI=function(){var z=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 z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ne.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,"")))},ne.prototype.hide=function(){this._isHidden=!0},ne}(),q=function(ne){function z(){var G=ne!==null&&ne.apply(this,arguments)||this;return G.elements=[],G}return le(z,ne),z.prototype.addElement=function(G){this.elements.push(G)},z.prototype.getUI=function(){var G=ne.prototype.getUI.call(this);return this.elements.forEach(function(J){return G.appendChild(J)}),G},z}(ie),ce=function(){function ne(z,G){this.horizontal=z,this.vertical=G}return Object.defineProperty(ne.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ne.prototype.getVerticalLength=function(z){return z/this.ratio},ne.prototype.getHorizontalLength=function(z){return z*this.ratio},ne}(),Se=function(){function ne(){}return ne.getIcon=function(z,G){if(z>0&&G>0){var J=new ce(z,G),re=J.ratio>=1?20:J.getHorizontalLength(20),Y=J.ratio<1?20:J.getVerticalLength(20),Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Z);var se=A.createDefs();Z.appendChild(se);var he=A.createElement("clipPath",[["id","text-bg-clip"]]);se.appendChild(he);var De=A.createPath(A.getHollowRectanglePath((24-re)/2,(24-Y)/2,re,Y,(24-re)/2+2,(24-Y)/2+2,re-4,Y-4));Z.appendChild(De);var Re=A.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Re.appendChild(A.createTSpan(z+":"+G)),Z.appendChild(Re);var Ue=Re.getBBox();A.setAttributes(Re,[["x",((24-Ue.width)/2).toString()],["y",((24-Ue.height)/2-Ue.y).toString()]]);var Ve=A.createPath(A.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ue.width))/2,(24-Math.ceil(Ue.height))/2,Math.ceil(Ue.width),Math.ceil(Ue.height)));return he.appendChild(Ve),A.setAttributes(De,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Z),Z.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>'},ne}(),Ce=function(ne){function z(G,J,re){var Y=ne.call(this,G,J)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=re,Y}return le(z,ne),z.prototype.setupDropdown=function(){var G=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(J){J.className=G.className,J.colorsClassName=G.colorsClassName,G.dropdownBlock.appendChild(J.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},z}(Oe),Pe=function(){function ne(z,G){this.GRIP_SIZE=10,this.color=z,this.fillColor=G,this.visual=A.createGroup(),this.visual.appendChild(A.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(A.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ne.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},ne.prototype.setCenter=function(z,G){this.visual.childNodes.forEach(function(J){return A.setAttributes(J,[["cx",z.toString()],["cy",G.toString()]])})},ne}(),Ne=function(){function ne(z,G,J,re){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=z,this.canvasHeight=G,this.margin=J,this.container=re,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(ne.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(z){this._aspectRatio=z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.gridContainer&&A.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(z){this._zoomFactor=z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ne.prototype.open=function(){var z=this;this.cropShadeElement=A.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=A.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var G=0;G<this.numberOfGridLines;G++)this.horizontalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(J){return z.gridContainer.appendChild(J)}),this.verticalGridLines.forEach(function(J){return z.gridContainer.appendChild(J)}),this.cropRectElement=A.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ne.prototype.setCropRectangle=function(z){this.cropRect=z;var G=Object.assign({},this.cropRect);this.zoomFactor!==1&&(G.width=this.cropRect.width*this.zoomFactor,G.height=this.cropRect.height*this.zoomFactor,G.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-G.width/2,G.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-G.height/2),A.setAttributes(this.cropRectElement,[["x",G.x.toString()],["y",G.y.toString()],["width",G.width.toString()],["height",G.height.toString()]]);var J=G.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Z){var se=G.y+J*(Z+1);A.setAttributes(Y,[["x1",""+G.x],["y1",""+se],["x2",""+(G.x+G.width)],["y2",""+se]])});var re=G.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Z){var se=G.x+re*(Z+1);A.setAttributes(Y,[["x1",""+se],["y1",""+G.y],["x2",""+se],["y2",""+(G.y+G.height)]])}),A.setAttributes(this.cropShadeElement,[["d",A.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,G.x,G.y,G.width,G.height)]]),this.topLeftGrip.setCenter(G.x,G.y),this.topRightGrip.setCenter(G.x+G.width,G.y),this.bottomLeftGrip.setCenter(G.x,G.y+G.height),this.bottomRightGrip.setCenter(G.x+G.width,G.y+G.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ne.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)},ne.prototype.clientToLocalCoordinates=function(z,G){var J=this.container.getBoundingClientRect();return{x:z-J.left+this.margin,y:G-J.top+this.margin}},ne.prototype.onPointerDown=function(z){this.container.setPointerCapture(z.pointerId),this.previousPoint=this.clientToLocalCoordinates(z.clientX,z.clientY),this.cropRectElement===z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(z.target)&&(this.activeGrip=this.bottomRightGrip)},ne.prototype.onPointerMove=function(z){if(this.isMoving)this.move(this.clientToLocalCoordinates(z.clientX,z.clientY));else if(this.activeGrip){var G=this.clientToLocalCoordinates(z.clientX,z.clientY);this.resize(G)}z.preventDefault()},ne.prototype.onPointerUp=function(z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(z.pointerId)},ne.prototype.move=function(z){var G=z.x-this.previousPoint.x,J=z.y-this.previousPoint.y;this.zoomFactor!==1&&(G=-G/this.zoomFactor,J=-J/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+G),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+J),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=z},ne.prototype.resize=function(z){var G=Object.assign({},this.cropRect),J=z.x-this.previousPoint.x,re=z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:G.x+J<this.margin&&(J=this.margin-G.x),G.x+=J,G.width=this.cropRect.x+this.cropRect.width-G.x;break;case this.bottomRightGrip:case this.topRightGrip:G.width+J>this.canvasWidth*this.zoomFactor&&(J=this.canvasWidth*this.zoomFactor-G.width),G.width+=J}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(G.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(J),G.height=this.aspectRatio.getVerticalLength(G.width)):(G.y+=re,G.height=this.cropRect.y+this.cropRect.height-G.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?G.height=this.aspectRatio.getVerticalLength(G.width):G.height+=re}G.width<10&&(G.x=this.cropRect.x,G.width=10),G.height<10&&(G.y=this.cropRect.y,G.height=10),this.previousPoint=z,G.x>=this.margin&&G.y>=this.margin&&G.x-this.margin+G.width<=this.canvasWidth&&G.y-this.margin+G.height<=this.canvasHeight&&(this.cropRect=G,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ne.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var z=this.cropRect.x+this.cropRect.width/2,G=this.cropRect.y+this.cropRect.height/2,J=this.aspectRatio.getHorizontalLength(this.cropRect.height),re=this.aspectRatio.getVerticalLength(this.cropRect.width);J/this.canvasWidth<re/this.canvasHeight?this.cropRect.width=J:this.cropRect.height=re,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=z-this.cropRect.width/2,this.cropRect.y=G-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ne.prototype.getRescaledRect=function(z,G,J,re,Y,Z){var se=J/z,he=re/G;return{x:(Y.x-Z)*se+Z,y:(Y.y-Z)*he+Z,width:Y.width*se,height:Y.height*he}},ne.prototype.scaleCanvas=function(z,G){var J=this.getRescaledRect(this.canvasWidth,this.canvasHeight,z,G,this.cropRect,this.margin);this.canvasWidth=z,this.canvasHeight=G,this.onCropChange&&this.onCropChange(J),this.setCropRectangle(J)},ne}(),Ie=function(){function ne(z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=z,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(ne.prototype,"angle",{get:function(){return this._angle},set:function(z){this._angle=z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ne.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},ne.prototype.onPointerDown=function(z){this.controlContainer.setPointerCapture(z.pointerId),this.isDragging=!0,this.previousPoint={x:z.clientX,y:z.clientY}},ne.prototype.onPointerMove=function(z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.previousPoint.x=z.clientX)},ne.prototype.onPointerUp=function(z){this.isDragging&&this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(z.pointerId)},ne.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var z=this.angleLabelText.getBBox();A.setAttributes(this.angleLabelElement,[["x",((this.width-z.width)/2).toString()],["y",(this.height/2).toString()]])}},ne.prototype.positionScaleShape=function(){if(this.scaleShape){var z=this.scaleShape.transform.baseVal.getItem(0);z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(z,0)}},ne.prototype.getVisual=function(){var z=document.createElementNS("http://www.w3.org/2000/svg","svg");z.setAttribute("xmlns","http://www.w3.org/2000/svg"),z.setAttribute("width",this.width+"px"),z.setAttribute("height",this.height+"px"),z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),z.style.flexShrink="0",document.body.appendChild(z);for(var G="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,J=1;J<=this.width/5+10;J++){var re=J%5==0?this.height/3:this.height/6;G+="h4v"+-re+"h1v"+re}G+="v1H0Z",this.scaleShape=A.createPath(G);var Y=A.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),z.appendChild(this.scaleShape),this.angleLabelElement=A.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=A.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Z=A.createTSpan("");return Z.innerHTML="°",this.angleLabelElement.appendChild(Z),z.appendChild(this.angleLabelElement),document.body.removeChild(z),z},ne}(),Me=function(){function ne(){this.naturalSize=!1,this.imageType="image/png"}return ne.prototype.rasterize=function(z,G,J,re,Y,Z,se){var he=this;return new Promise(function(De){var Re=document.createElement("canvas");Re.width=z.width.baseVal.value-2*re,Re.height=z.height.baseVal.value-2*re;var Ue=1,Ve=1;he.naturalSize===!0?(Ue=G.naturalWidth/(z.width.baseVal.value-2*re)/Z,Ve=G.naturalHeight/(z.height.baseVal.value-2*re)/se,Re.width=G.naturalWidth/Z,Re.height=G.naturalHeight/se):he.width!==void 0&&he.height!==void 0&&(Ue=he.width/J.width,Ve=he.height/J.height,Re.width*=Ue,Re.height*=Ve);var Je=Re.getContext("2d");Je.translate(Re.width/2,Re.height/2),Je.rotate(Y*Math.PI/180),Je.scale(Z,se),Je.translate(-Re.width/2,-Re.height/2),Je.drawImage(G,0,0,Re.width,Re.height);var Qe=document.createElement("canvas");Qe.width=J.width*Ue,Qe.height=J.height*Ve,Qe.getContext("2d").putImageData(Je.getImageData((J.x-re)*Ue,(J.y-re)*Ve,J.width*Ue,J.height*Ve),0,0),De(Qe.toDataURL(he.imageType,he.imageQuality))})},ne}(),He=function(){function ne(z){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=ne.instanceCounter++,this.styles=new C(this.instanceNo),this.target=z,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(ne.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(z){this._zoomToCropEnabled=z,z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"gridLines",{get:function(){return this._gridLines},set:function(z){this._gridLines=z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(z){this._rotationAngle=z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"aspectRatio",{get:function(){var z;return(z=this._aspectRatio)!==null&&z!==void 0?z:this.aspectRatios[0]},set:function(z){this._aspectRatio=z},enumerable:!1,configurable:!0}),ne.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},ne.prototype.show=function(){this.showUI(),this.open()},ne.prototype.close=function(z){z===void 0&&(z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),z||this.closeEventListeners.forEach(function(G){return G()}),this._isOpen=!1)},ne.prototype.addRenderEventListener=function(z){this.renderEventListeners.push(z)},ne.prototype.removeRenderEventListener=function(z){this.renderEventListeners.indexOf(z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(z),1)},ne.prototype.addCloseEventListener=function(z){this.closeEventListeners.push(z)},ne.prototype.removeCloseEventListener=function(z){this.closeEventListeners.indexOf(z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(z),1)},ne.prototype.setupResizeObserver=function(){var z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){z.resize(z.target.clientWidth,z.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))},ne.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var z=1*this.target.clientWidth/this.target.clientHeight,G=this.contentDiv.clientWidth/z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,J=G+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/z;this.resize(G,J)}},ne.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ne.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",A.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ne.prototype.resize=function(z,G){this.imageWidth=Math.round(z),this.imageHeight=Math.round(G),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()},ne.prototype.setEditingTarget=function(){var z=document.createElement("canvas");z.width=this.target.naturalWidth,z.height=this.target.naturalHeight,z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var G=z.toDataURL();A.setAttributes(this.editingTarget,[["href",G]]),this.setEditingTargetSize()},ne.prototype.setTopLeft=function(){var z=this.target.getBoundingClientRect(),G=this.editorCanvas.getBoundingClientRect();this.left=z.left-G.left-this.CANVAS_MARGIN,this.top=z.top-G.top-this.CANVAS_MARGIN},ne.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=A.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=A.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=A.createGroup(),this.editingTargetRotationScaleContainer=A.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var z=A.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(z);var G=A.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(G),this.editingTargetContainer=A.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)},ne.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ne.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=A.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ne(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()},ne.prototype.zoomToCrop=function(){if(this.cropRect){var z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,G=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=z+"px "+G+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-G+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ne.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)},ne.prototype.cropRectChanged=function(z){this.cropRect=z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ne.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ne.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"},ne.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ne.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 z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,G=this.target.offsetTop>z+this.CANVAS_MARGIN?this.target.offsetTop-(z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=G+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ne.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ne.prototype.addTopToolbar=function(){var z=this;this.topToolbar=new M,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var G=new Ee;G.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(G);var J=[];this.aspectRatios.forEach(function(Ve){var Je=new Oe(Se.getIcon(Ve.horizontal,Ve.vertical),Ve.horizontal===0&&Ve.vertical===0?"FREE":Ve.horizontal+":"+Ve.vertical);Je.onClick=function(){return z.ratioButtonClicked(Ve)},J.push(Je)}),this.aspectRatioButton=new Ce(Se.getIcon(0,0),"Aspect ratio",J),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,G.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var re=new Oe('<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");re.isActive=this.isGridVisible,re.onClick=function(){z.isGridVisible=!z.isGridVisible,re.isActive=z.isGridVisible},G.addButton(re);var Y=new Oe('<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(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){z.zoomToCropEnabled=!z.zoomToCropEnabled,Y.isActive=z.zoomToCropEnabled},G.addButton(Y),!L.isLicensed){var Z=new q;this.topToolbar.addElementBlock(Z);var se=document.createElement("div");se.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var he=document.createElement("a");he.style.color="currentColor",he.href="https://markerjs.com/products/cropro",he.target="_blank",he.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>',se.appendChild(he),Z.addElement(se)}var De=new Ee;De.minWidth=3*this.toolbarHeight+"px",De.contentAlign="end",this.topToolbar.addButtonBlock(De);var Re=new Oe('<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");Re.onClick=this.startRenderAndClose,De.addButton(Re),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Re.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ue=new Oe('<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");Ue.onClick=this.close,De.addButton(Ue),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ne.prototype.addBottomToolbar=function(){var z=this;this.bottomToolbar=new M,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var G=new Ee;G.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(G);var J=new Oe('<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");J.onClick=this.rotateLeftButtonClicked,G.addButton(J);var re=new Oe('<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");re.onClick=this.rotateRightButtonClicked,G.addButton(re);var Y=new q;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Ie("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(De){z.rotateBy(De),z.straightener.angle=z.rotationAngle},Y.addElement(this.straightener.getUI());var Z=new Ee;Z.minWidth=2*this.toolbarHeight+"px",Z.contentAlign="end",this.bottomToolbar.addButtonBlock(Z);var se=new Oe('<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");se.onClick=this.flipHorizontallyButtonClicked,Z.addButton(se);var he=new Oe('<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");he.onClick=this.flipVerticallyButtonClicked,Z.addButton(he)},ne.prototype.ratioButtonClicked=function(z){this.aspectRatio=z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ne.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Se.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ne.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ce(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ne.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ne.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ne.prototype.restoreState=function(z){if(z){var G=this.cropLayer.getRescaledRect(z.width,z.height,this.imageWidth,this.imageHeight,z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(G),this.cropRectChanged(G),this.flippedHorizontally=z.flippedHorizontally,this.flippedVertically=z.flippedVertically,this.applyFlip(),this.rotationAngle=z.rotationAngle,this.applyRotation()}},ne.prototype.clientToLocalCoordinates=function(z,G){var J=this.cropImage.getBoundingClientRect();return{x:z-J.left,y:G-J.top}},ne.prototype.onWindowResize=function(){this.positionUI()},ne.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=z+"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()},ne.prototype.rotateLeftButtonClicked=function(){var z=this.rotationAngle-90;this.rotationAngle%90!=0&&(z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(z)},ne.prototype.rotateRightButtonClicked=function(){var z=this.rotationAngle+90;this.rotationAngle%90!=0&&(z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(z)},ne.prototype.rotateTo=function(z){z=(z=z>180?z-360:z)<=-180?z+360:z,this.rotationAngle=z,this.applyRotation()},ne.prototype.rotateBy=function(z){this.rotateTo((this.rotationAngle+z)%360)},ne.prototype.applyRotation=function(){var z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var G=this.editingTargetRotationContainer.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(G,0);var J=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/J.width,this.imageHeight/J.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=z},ne.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ne.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ne.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ne.prototype.startRenderAndClose=function(){return _e(this,void 0,void 0,function(){var z,G;return ee(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return z=J.sent(),G=this.getState(),this.renderEventListeners.forEach(function(re){return re(z,G)}),this.close(!0),[2]}})})},ne.prototype.render=function(){return _e(this,void 0,void 0,function(){var z;return ee(this,function(G){switch(G.label){case 0:return(z=new Me).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.width=this.renderWidth,z.height=this.renderHeight,this.unzoomFromCrop(),A.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return G.sent(),[4,z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,G.sent()]}})})},ne.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new K("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 K("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new K("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new K("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*z)+`px;
|
|
height: `+(this.toolbarHeight-2*z)+`px;
|
|
padding: `+z+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new K("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new K("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new U("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new U("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new K("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 K("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new K("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 K("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*z)+`px;
|
|
padding: `+z+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new K("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},ne.instanceCounter=0,ne}(),We=j("8hTe"),Ge=j.n(We),Be=/<pre[^>]*>/g;function Xe(ne){var z=document.createElement("div");return z.innerHTML=ne,z.childNodes.length===0?"":z.childNodes[0].nodeValue}var Ye=ye.a=function(ne){var z=ne.value,G=z===void 0?"":z,J=ne.edit,re=J===void 0?!1:J,Y=ne.className,Z=ne.showTextOnly,se=ne.showLines,he=ne.replaces,De=ne.zoomImg,Re=ne.hasMask,Ue=ne.style,Ve=Ue===void 0?{}:Ue,Je=ne.stylesPrev,Qe=Je===void 0?{}:Je,ht=String(G),st=Object(w.useRef)(),qe=Object(w.useRef)(),Ut=Object(w.useState)(""),Et=Object(F.a)(Ut,2),Ft=Et[0],kt=Et[1],ot=Object(w.useState)("office"),jt=Object(F.a)(ot,2),Jt=jt[0],Vt=jt[1],rn=function(){var pt=new He(qe.current);pt.displayMode="popup",pt.addRenderEventListener(function(){var yt=Object(O.a)(e.a.mark(function ut(Qt){var Rt;return e.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return st.current.style.display="none",Kt.next=3,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qt}});case 3:Rt=Kt.sent,Rt!=null&&Rt.id&&he(qe.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 5:case"end":return Kt.stop()}},ut)}));return function(ut){return yt.apply(this,arguments)}}()),pt.show()},Ze=function(){var pt=new ve.a(qe.current);pt.settings.displayMode="popup",pt.addEventListener("render",function(){var yt=Object(O.a)(e.a.mark(function ut(Qt){var Rt;return e.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(st.current.style.display="none",!qe.current){Kt.next=6;break}return Kt.next=4,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qt.dataUrl}});case 4:Rt=Kt.sent,Rt!=null&&Rt.id&&he(qe.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 6:case"end":return Kt.stop()}},ut)}));return function(ut){return yt.apply(this,arguments)}}()),pt.show(),window.markerArea=pt},it=Object(w.useMemo)(function(){st.current&&(st.current.style.zIndex=-1);try{var Nt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,pt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ht=ht.replace(Nt,"("+$.a.API_SERVER+"/api/attachments/").replace(pt,'"'+$.a.API_SERVER+"/api/attachments/").replace(yt,'"'+$.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(dn){}var ut=P(ht),Qt=E();if(ht.match(/\[TOC\]/)&&(ut=ut.replace("<p>[TOC]</p>",b()),v()),ut=ut.replace(/(__special_katext_id_\d+__)/g,function(dn,Kt){var gn=Qt[Kt],xn=gn.type,Sn=gn.expression;return Object(ge.renderToString)(Xe(Sn)||"",{displayMode:xn==="block",throwOnError:!1,output:"html"})}),ut=ut.replace(/▁/g,"\u2581\u2581\u2581"),_(),Z){var Rt=document.createElement("div");return Rt.innerHTML=ut,Rt.innerText}return setTimeout(function(){return $t()},500),ut},[ht]),ft=Object(w.useRef)();c.WebkitLineClamp=se,se&&(Ve=Object(S.a)(Object(S.a)({},Ve),c));function It(Nt){var pt=Nt.target;if(pt.tagName.toUpperCase()==="IMG"){if(De){var yt=pt.getAttribute("src");kt(yt),Vt("image")}}else if(pt.tagName.toUpperCase()==="A"){var ut=pt.getAttribute("href");if(ut.indexOf("office")>-1)Nt.preventDefault(),kt(ut),Vt("office");else if(ut.indexOf("application/pdf")>-1)Nt.preventDefault(),kt(ut),Vt("pdf");else if(ut.indexOf("text/html")>-1)Nt.preventDefault(),kt(ut),Vt("html");else if(ut.startsWith("#")){Nt.preventDefault();var Qt=document.getElementById(ut.replace("#",""));Qt&&Qt.scrollIntoView(!0)}}}var $t=function(){var pt,yt=(pt=ft.current)===null||pt===void 0?void 0:pt.querySelectorAll("video");yt==null||yt.forEach(function(ut){if(ut.oncontextmenu=function(){return!1},ut.src.indexOf(".m3u8")>-1&&!ut.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Qt=new V.a;Qt.loadSource(ut.src),Qt.attachMedia(ut)}}})};Object(w.useEffect)(function(){if(ft.current&&it&&(it.match(Be)&&window.PR.prettyPrint()),ft.current)return ft.current.addEventListener("click",It),function(){ft.current.removeEventListener("click",It),_(),v()}},[it,ft.current,It]);var ln=function(pt){if(!re)return;pt.target.nodeName==="IMG"?(st.current.style.zIndex=1,st.current.style.display="flex",st.current.style.width=pt.target.clientWidth+"px",st.current.style.height=pt.target.clientHeight+"px",st.current.style.top=pt.target.offsetTop+"px",st.current.style.left=pt.target.offsetLeft+"px",qe.current.src=pt.target.getAttribute("src")):st.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:ft,style:Object(S.a)({},Ve),className:"".concat(Y||""," markdown-body ").concat(Ge.a.mdBody),onMouseOver:ln,dangerouslySetInnerHTML:{__html:it}}),g.a.createElement("div",{ref:st,className:Ge.a.button},g.a.createElement(W.a,null,g.a.createElement(N.a,{onClick:function(){return rn()}},"\u88C1\u526A"),g.a.createElement(N.a,{onClick:function(){return Ze()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:qe,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(te.a,{close:!0,data:Ft,type:Ft!=null&&Ft.length?Jt:"",style:Object(S.a)({},Qe),onClose:function(){return kt("")}}))}},BU3w:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return O});var ue=j("MNnm"),W="rc-util-key";function R(F){if(F.attachTo)return F.attachTo;var B=document.querySelector("head");return B||document.body}function N(F){var B,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var w=document.createElement("style");if((B=e.csp)===null||B===void 0?void 0:B.nonce){var g;w.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}w.innerHTML=F;var u=R(e),l=u.firstChild;return e.prepend&&u.prepend?u.prepend(w):e.prepend&&l?u.insertBefore(w,l):u.appendChild(w),w}var S=new Map;function O(F,B){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=R(e);if(!S.has(w)){var g=N("",e),u=g.parentNode;S.set(w,u),u.removeChild(g)}var l=Array.from(S.get(w).children).find(function(r){return r.tagName==="STYLE"&&r[W]===B});if(l){var s,i;if(((s=e.csp)===null||s===void 0?void 0:s.nonce)&&l.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var o;l.nonce=(o=e.csp)===null||o===void 0?void 0:o.nonce}return l.innerHTML!==F&&(l.innerHTML=F),l}var a=N(F,e);return a[W]=B,a}},BdwD:function(Ke,ye,j){"use strict";var ue=j("+L6B"),W=j("2/Rp"),R=j("0Owb"),N=j("k1fw"),S=j("q1tI"),O=j.n(S),F=j("FOrL"),B=j.n(F),e=function(g){var u=g.buttonProps,l=u===void 0?{}:u,s=g.styles,i=s===void 0?{}:s,o=g.imgStyles,a=o===void 0?{}:o,r=g.customText,n=g.ButtonText,t=g.ButtonClick,v=g.Buttonclass,c=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(N.a)(Object(N.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),i)},O.a.createElement("img",{src:B.a,style:Object(N.a)(Object(N.a)({},{width:"200px",height:"150px"}),a)}),O.a.createElement("p",{className:"mt10 font14"},r||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),n&&O.a.createElement(W.a,Object(R.a)({className:v,onClick:t},l),n),c&&c)};ye.a=e},"C/vA":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return ue});function ue(W){const R=this;let N=!1,S;return function(){return N||(N=!0,S=W.apply(R,arguments)),S}}},"Cg/j":function(Ke,ye,j){"use strict";j.d(ye,"b",function(){return ue}),j.d(ye,"a",function(){return W}),j.d(ye,"c",function(){return N}),j.d(ye,"d",function(){return S});var ue;(function(O){O.serviceIds=new Map,O.DI_TARGET="$di$target",O.DI_DEPENDENCIES="$di$dependencies";function F(B){return B[O.DI_DEPENDENCIES]||[]}O.getServiceDependencies=F})(ue||(ue={}));const W=N("instantiationService");function R(O,F,B,e){F[ue.DI_TARGET]===F?F[ue.DI_DEPENDENCIES].push({id:O,index:B,optional:e}):(F[ue.DI_DEPENDENCIES]=[{id:O,index:B,optional:e}],F[ue.DI_TARGET]=F)}function N(O){if(ue.serviceIds.has(O))return ue.serviceIds.get(O);const F=function(B,e,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(F,B,w,!1)};return F.toString=()=>O,ue.serviceIds.set(O,F),F}function S(O){return function(F,B,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");R(O,F,e,!0)}}},DlQD:function(Ke,ye,j){(function(ue,W){Ke.exports=W()})(this,function(){"use strict";function ue(G,J){for(var re=0;re<J.length;re++){var Y=J[re];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(G,Y.key,Y)}}function W(G,J,re){return J&&ue(G.prototype,J),re&&ue(G,re),G}function R(G,J){if(!G)return;if(typeof G=="string")return N(G,J);var re=Object.prototype.toString.call(G).slice(8,-1);if(re==="Object"&&G.constructor&&(re=G.constructor.name),re==="Map"||re==="Set")return Array.from(G);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return N(G,J)}function N(G,J){(J==null||J>G.length)&&(J=G.length);for(var re=0,Y=new Array(J);re<J;re++)Y[re]=G[re];return Y}function S(G,J){var re;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(re=R(G))||J&&G&&typeof G.length=="number"){re&&(G=re);var Y=0;return function(){return Y>=G.length?{done:!0}:{done:!1,value:G[Y++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return re=G[Symbol.iterator](),re.next.bind(re)}function O(G,J){return J={exports:{}},G(J,J.exports),J.exports}var F=O(function(G){function J(){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 re(Y){G.exports.defaults=Y}G.exports={defaults:J(),getDefaults:J,changeDefaults:re}}),B=F.defaults,e=F.getDefaults,w=F.changeDefaults,g=/[&<>"']/,u=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,i={"&":"&","<":"<",">":">",'"':""","'":"'"},o=function(J){return i[J]};function a(G,J){if(J){if(g.test(G))return G.replace(u,o)}else if(l.test(G))return G.replace(s,o);return G}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(G){return G.replace(r,function(J,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var t=/(^|[^\[])\^/g;function v(G,J){G=G.source||G,J=J||"";var re={replace:function(Z,se){return se=se.source||se,se=se.replace(t,"$1"),G=G.replace(Z,se),re},getRegex:function(){return new RegExp(G,J)}};return re}var c=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(G,J,re){if(G){var Y;try{Y=decodeURIComponent(n(re)).replace(c,"").toLowerCase()}catch(Z){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}J&&!p.test(re)&&(re=h(J,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(Z){return null}return re}var y={},d=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(G,J){y[" "+G]||(d.test(G)?y[" "+G]=G+"/":y[" "+G]=k(G,"/",!0)),G=y[" "+G];var re=G.indexOf(":")===-1;return J.substring(0,2)==="//"?re?J:G.replace(f,"$1")+J:J.charAt(0)==="/"?re?J:G.replace(m,"$1")+J:G+J}var E={exec:function(){}};function _(G){for(var J=1,re,Y;J<arguments.length;J++){re=arguments[J];for(Y in re)Object.prototype.hasOwnProperty.call(re,Y)&&(G[Y]=re[Y])}return G}function T(G,J){var re=G.replace(/\|/g,function(se,he,De){for(var Re=!1,Ue=he;--Ue>=0&&De[Ue]==="\\";)Re=!Re;return Re?"|":" |"}),Y=re.split(/ \|/),Z=0;if(Y.length>J)Y.splice(J);else for(;Y.length<J;)Y.push("");for(;Z<Y.length;Z++)Y[Z]=Y[Z].trim().replace(/\\\|/g,"|");return Y}function k(G,J,re){var Y=G.length;if(Y===0)return"";for(var Z=0;Z<Y;){var se=G.charAt(Y-Z-1);if(se===J&&!re)Z++;else if(se!==J&&re)Z++;else break}return G.substr(0,Y-Z)}function D(G,J){if(G.indexOf(J[1])===-1)return-1;for(var re=G.length,Y=0,Z=0;Z<re;Z++)if(G[Z]==="\\")Z++;else if(G[Z]===J[0])Y++;else if(G[Z]===J[1]&&(Y--,Y<0))return Z;return-1}function x(G){G&&G.sanitize&&!G.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 P={escape:a,unescape:n,edit:v,cleanUrl:b,resolveUrl:h,noopTest:E,merge:_,splitCells:T,rtrim:k,findClosingBracket:D,checkSanitizeDeprecation:x},H=F.defaults,I=P.rtrim,V=P.splitCells,$=P.escape,ge=P.findClosingBracket;function te(G,J,re){var Y=J.href,Z=J.title?$(J.title):null,se=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:re,href:Y,title:Z,text:se}:{type:"image",raw:re,href:Y,title:Z,text:$(se)}}function be(G,J){var re=G.match(/^(\s+)(?:```)/);if(re===null)return J;var Y=re[1];return J.split(`
|
|
`).map(function(Z){var se=Z.match(/^\s+/);if(se===null)return Z;var he=se[0];return he.length>=Y.length?Z.slice(Y.length):Z}).join(`
|
|
`)}var ve=function(){function G(re){this.options=re||H}var J=G.prototype;return J.space=function(Y){var Z=this.rules.block.newline.exec(Y);if(Z)return Z[0].length>1?{type:"space",raw:Z[0]}:{raw:`
|
|
`}},J.code=function(Y,Z){var se=this.rules.block.code.exec(Y);if(se){var he=Z[Z.length-1];if(he&&he.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var De=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?De:I(De,`
|
|
`)}}},J.fences=function(Y){var Z=this.rules.block.fences.exec(Y);if(Z){var se=Z[0],he=be(se,Z[3]||"");return{type:"code",raw:se,lang:Z[2]?Z[2].trim():Z[2],text:he}}},J.heading=function(Y){var Z=this.rules.block.heading.exec(Y);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},J.nptable=function(Y){var Z=this.rules.block.nptable.exec(Y);if(Z){var se={type:"table",header:V(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Z[0]};if(se.header.length===se.align.length){var he=se.align.length,De;for(De=0;De<he;De++)/^ *-+: *$/.test(se.align[De])?se.align[De]="right":/^ *:-+: *$/.test(se.align[De])?se.align[De]="center":/^ *:-+ *$/.test(se.align[De])?se.align[De]="left":se.align[De]=null;for(he=se.cells.length,De=0;De<he;De++)se.cells[De]=V(se.cells[De],se.header.length);return se}}},J.hr=function(Y){var Z=this.rules.block.hr.exec(Y);if(Z)return{type:"hr",raw:Z[0]}},J.blockquote=function(Y){var Z=this.rules.block.blockquote.exec(Y);if(Z){var se=Z[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Z[0],text:se}}},J.list=function(Y){var Z=this.rules.block.list.exec(Y);if(Z){for(var se=Z[0],he=Z[2],De=he.length>1,Re=he[he.length-1]===")",Ue={type:"list",raw:se,ordered:De,start:De?+he.slice(0,-1):"",loose:!1,items:[]},Ve=Z[0].match(this.rules.block.item),Je=!1,Qe,ht,st,qe,Ut,Et,Ft,kt=Ve.length,ot=0;ot<kt;ot++)Qe=Ve[ot],se=Qe,ht=Qe.length,Qe=Qe.replace(/^ *([*+-]|\d+[.)]) */,""),~Qe.indexOf(`
|
|
`)&&(ht-=Qe.length,Qe=this.options.pedantic?Qe.replace(/^ {1,4}/gm,""):Qe.replace(new RegExp("^ {1,"+ht+"}","gm"),"")),ot!==kt-1&&(st=this.rules.block.bullet.exec(Ve[ot+1])[0],(De?st.length===1||!Re&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==he)&&(qe=Ve.slice(ot+1).join(`
|
|
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-qe.length),ot=kt-1)),Ut=Je||/\n\n(?!\s*$)/.test(Qe),ot!==kt-1&&(Je=Qe.charAt(Qe.length-1)===`
|
|
`,Ut||(Ut=Je)),Ut&&(Ue.loose=!0),Et=/^\[[ xX]\] /.test(Qe),Ft=void 0,Et&&(Ft=Qe[1]!==" ",Qe=Qe.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:se,task:Et,checked:Ft,loose:Ut,text:Qe});return Ue}},J.html=function(Y){var Z=this.rules.block.html.exec(Y);if(Z)return{type:this.options.sanitize?"paragraph":"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):$(Z[0]):Z[0]}},J.def=function(Y){var Z=this.rules.block.def.exec(Y);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var se=Z[1].toLowerCase().replace(/\s+/g," ");return{tag:se,raw:Z[0],href:Z[2],title:Z[3]}}},J.table=function(Y){var Z=this.rules.block.table.exec(Y);if(Z){var se={type:"table",header:V(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[]};if(se.header.length===se.align.length){se.raw=Z[0];var he=se.align.length,De;for(De=0;De<he;De++)/^ *-+: *$/.test(se.align[De])?se.align[De]="right":/^ *:-+: *$/.test(se.align[De])?se.align[De]="center":/^ *:-+ *$/.test(se.align[De])?se.align[De]="left":se.align[De]=null;for(he=se.cells.length,De=0;De<he;De++)se.cells[De]=V(se.cells[De].replace(/^ *\| *| *\| *$/g,""),se.header.length);return se}}},J.lheading=function(Y){var Z=this.rules.block.lheading.exec(Y);if(Z)return{type:"heading",raw:Z[0],depth:Z[2].charAt(0)==="="?1:2,text:Z[1]}},J.paragraph=function(Y){var Z=this.rules.block.paragraph.exec(Y);if(Z)return{type:"paragraph",raw:Z[0],text:Z[1].charAt(Z[1].length-1)===`
|
|
`?Z[1].slice(0,-1):Z[1]}},J.text=function(Y,Z){var se=this.rules.block.text.exec(Y);if(se){var he=Z[Z.length-1];return he&&he.type==="text"?{raw:se[0],text:se[0]}:{type:"text",raw:se[0],text:se[0]}}},J.escape=function(Y){var Z=this.rules.inline.escape.exec(Y);if(Z)return{type:"escape",raw:Z[0],text:$(Z[1])}},J.tag=function(Y,Z,se){var he=this.rules.inline.tag.exec(Y);if(he)return!Z&&/^<a /i.test(he[0])?Z=!0:Z&&/^<\/a>/i.test(he[0])&&(Z=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:Z,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):$(he[0]):he[0]}},J.link=function(Y){var Z=this.rules.inline.link.exec(Y);if(Z){var se=ge(Z[2],"()");if(se>-1){var he=Z[0].indexOf("!")===0?5:4,De=he+Z[1].length+se;Z[2]=Z[2].substring(0,se),Z[0]=Z[0].substring(0,De).trim(),Z[3]=""}var Re=Z[2],Ue="";if(this.options.pedantic){var Ve=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Re);Ve?(Re=Ve[1],Ue=Ve[3]):Ue=""}else Ue=Z[3]?Z[3].slice(1,-1):"";Re=Re.trim().replace(/^<([\s\S]*)>$/,"$1");var Je=te(Z,{href:Re&&Re.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},Z[0]);return Je}},J.reflink=function(Y,Z){var se;if((se=this.rules.inline.reflink.exec(Y))||(se=this.rules.inline.nolink.exec(Y))){var he=(se[2]||se[1]).replace(/\s+/g," ");if(he=Z[he.toLowerCase()],!he||!he.href){var De=se[0].charAt(0);return{type:"text",raw:De,text:De}}var Re=te(se,he,se[0]);return Re}},J.strong=function(Y,Z,se){se===void 0&&(se="");var he=this.rules.inline.strong.start.exec(Y);if(he&&(!he[1]||he[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){Z=Z.slice(-1*Y.length);var De=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var Re;(he=De.exec(Z))!=null;)if(Re=this.rules.inline.strong.middle.exec(Z.slice(0,he.index+3)),Re)return{type:"strong",raw:Y.slice(0,Re[0].length),text:Y.slice(2,Re[0].length-2)}}},J.em=function(Y,Z,se){se===void 0&&(se="");var he=this.rules.inline.em.start.exec(Y);if(he&&(!he[1]||he[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){Z=Z.slice(-1*Y.length);var De=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var Re;(he=De.exec(Z))!=null;)if(Re=this.rules.inline.em.middle.exec(Z.slice(0,he.index+2)),Re)return{type:"em",raw:Y.slice(0,Re[0].length),text:Y.slice(1,Re[0].length-1)}}},J.codespan=function(Y){var Z=this.rules.inline.code.exec(Y);if(Z){var se=Z[2].replace(/\n/g," "),he=/[^ ]/.test(se),De=se.startsWith(" ")&&se.endsWith(" ");return he&&De&&(se=se.substring(1,se.length-1)),se=$(se,!0),{type:"codespan",raw:Z[0],text:se}}},J.br=function(Y){var Z=this.rules.inline.br.exec(Y);if(Z)return{type:"br",raw:Z[0]}},J.del=function(Y){var Z=this.rules.inline.del.exec(Y);if(Z)return{type:"del",raw:Z[0],text:Z[1]}},J.autolink=function(Y,Z){var se=this.rules.inline.autolink.exec(Y);if(se){var he,De;return se[2]==="@"?(he=$(this.options.mangle?Z(se[1]):se[1]),De="mailto:"+he):(he=$(se[1]),De=he),{type:"link",raw:se[0],text:he,href:De,tokens:[{type:"text",raw:he,text:he}]}}},J.url=function(Y,Z){var se;if(se=this.rules.inline.url.exec(Y)){var he,De;if(se[2]==="@")he=$(this.options.mangle?Z(se[0]):se[0]),De="mailto:"+he;else{var Re;do Re=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Re!==se[0]);he=$(se[0]),se[1]==="www."?De="http://"+he:De=he}return{type:"link",raw:se[0],text:he,href:De,tokens:[{type:"text",raw:he,text:he}]}}},J.inlineText=function(Y,Z,se){var he=this.rules.inline.text.exec(Y);if(he){var De;return Z?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):$(he[0]):he[0]:De=$(this.options.smartypants?se(he[0]):he[0]),{type:"text",raw:he[0],text:De}}},G}(),oe=P.noopTest,le=P.edit,_e=P.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:oe,table:oe,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=le(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=le(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=le(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=le(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=le(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=le(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=_e({},ee),ee.gfm=_e({},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=le(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=le(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=_e({},ee.normal,{html:le(`^ *(?: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:oe,paragraph:le(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 L={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:oe,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:oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};L._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",L.punctuation=le(L.punctuation).replace(/punctuation/g,L._punctuation).getRegex(),L._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",L._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",L.em.start=le(L.em.start).replace(/punctuation/g,L._punctuation).getRegex(),L.em.middle=le(L.em.middle).replace(/punctuation/g,L._punctuation).replace(/overlapSkip/g,L._overlapSkip).getRegex(),L.em.endAst=le(L.em.endAst,"g").replace(/punctuation/g,L._punctuation).getRegex(),L.em.endUnd=le(L.em.endUnd,"g").replace(/punctuation/g,L._punctuation).getRegex(),L.strong.start=le(L.strong.start).replace(/punctuation/g,L._punctuation).getRegex(),L.strong.middle=le(L.strong.middle).replace(/punctuation/g,L._punctuation).replace(/blockSkip/g,L._blockSkip).getRegex(),L.strong.endAst=le(L.strong.endAst,"g").replace(/punctuation/g,L._punctuation).getRegex(),L.strong.endUnd=le(L.strong.endUnd,"g").replace(/punctuation/g,L._punctuation).getRegex(),L.blockSkip=le(L._blockSkip,"g").getRegex(),L.overlapSkip=le(L._overlapSkip,"g").getRegex(),L._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,L._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,L._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])?)+(?![-_])/,L.autolink=le(L.autolink).replace("scheme",L._scheme).replace("email",L._email).getRegex(),L._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,L.tag=le(L.tag).replace("comment",ee._comment).replace("attribute",L._attribute).getRegex(),L._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,L._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,L._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,L.link=le(L.link).replace("label",L._label).replace("href",L._href).replace("title",L._title).getRegex(),L.reflink=le(L.reflink).replace("label",L._label).getRegex(),L.reflinkSearch=le(L.reflinkSearch,"g").replace("reflink",L.reflink).replace("nolink",L.nolink).getRegex(),L.normal=_e({},L),L.pedantic=_e({},L.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",L._label).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",L._label).getRegex()}),L.gfm=_e({},L.normal,{escape:le(L.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),L.gfm.url=le(L.gfm.url,"i").replace("email",L.gfm._extended_email).getRegex(),L.breaks=_e({},L.gfm,{br:le(L.br).replace("{2,}","*").getRegex(),text:le(L.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var A={block:ee,inline:L},C=F.defaults,U=A.block,K=A.inline;function M(G){return G.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 ie(G){var J="",re,Y,Z=G.length;for(re=0;re<Z;re++)Y=G.charCodeAt(re),Math.random()>.5&&(Y="x"+Y.toString(16)),J+="&#"+Y+";";return J}var Ee=function(){function G(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||C,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:U.normal,inline:K.normal};this.options.pedantic?(Y.block=U.pedantic,Y.inline=K.pedantic):this.options.gfm&&(Y.block=U.gfm,this.options.breaks?Y.inline=K.breaks:Y.inline=K.gfm),this.tokenizer.rules=Y}G.lex=function(Y,Z){var se=new G(Z);return se.lex(Y)};var J=G.prototype;return J.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},J.blockTokens=function(Y,Z,se){Z===void 0&&(Z=[]),se===void 0&&(se=!0),Y=Y.replace(/^ +$/gm,"");for(var he,De,Re,Ue;Y;){if(he=this.tokenizer.space(Y)){Y=Y.substring(he.raw.length),he.type&&Z.push(he);continue}if(he=this.tokenizer.code(Y,Z)){Y=Y.substring(he.raw.length),he.type?Z.push(he):(Ue=Z[Z.length-1],Ue.raw+=`
|
|
`+he.raw,Ue.text+=`
|
|
`+he.text);continue}if(he=this.tokenizer.fences(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.heading(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.nptable(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.hr(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.blockquote(Y)){Y=Y.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],se),Z.push(he);continue}if(he=this.tokenizer.list(Y)){for(Y=Y.substring(he.raw.length),Re=he.items.length,De=0;De<Re;De++)he.items[De].tokens=this.blockTokens(he.items[De].text,[],!1);Z.push(he);continue}if(he=this.tokenizer.html(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(se&&(he=this.tokenizer.def(Y))){Y=Y.substring(he.raw.length),this.tokens.links[he.tag]||(this.tokens.links[he.tag]={href:he.href,title:he.title});continue}if(he=this.tokenizer.table(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.lheading(Y)){Y=Y.substring(he.raw.length),Z.push(he);continue}if(se&&(he=this.tokenizer.paragraph(Y))){Y=Y.substring(he.raw.length),Z.push(he);continue}if(he=this.tokenizer.text(Y,Z)){Y=Y.substring(he.raw.length),he.type?Z.push(he):(Ue=Z[Z.length-1],Ue.raw+=`
|
|
`+he.raw,Ue.text+=`
|
|
`+he.text);continue}if(Y){var Ve="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return Z},J.inline=function(Y){var Z,se,he,De,Re,Ue,Ve=Y.length;for(Z=0;Z<Ve;Z++){Ue=Y[Z];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},De=Ue.header.length,se=0;se<De;se++)Ue.tokens.header[se]=[],this.inlineTokens(Ue.header[se],Ue.tokens.header[se]);for(De=Ue.cells.length,se=0;se<De;se++)for(Re=Ue.cells[se],Ue.tokens.cells[se]=[],he=0;he<Re.length;he++)Ue.tokens.cells[se][he]=[],this.inlineTokens(Re[he],Ue.tokens.cells[se][he]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(De=Ue.items.length,se=0;se<De;se++)this.inline(Ue.items[se].tokens);break}}}return Y},J.inlineTokens=function(Y,Z,se,he,De){Z===void 0&&(Z=[]),se===void 0&&(se=!1),he===void 0&&(he=!1),De===void 0&&(De="");var Re,Ue=Y,Ve;if(this.tokens.links){var Je=Object.keys(this.tokens.links);if(Je.length>0)for(;(Ve=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)Je.includes(Ve[0].slice(Ve[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ve=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Ve.index)+"["+"a".repeat(Ve[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(Re=this.tokenizer.escape(Y)){Y=Y.substring(Re.raw.length),Z.push(Re);continue}if(Re=this.tokenizer.tag(Y,se,he)){Y=Y.substring(Re.raw.length),se=Re.inLink,he=Re.inRawBlock,Z.push(Re);continue}if(Re=this.tokenizer.link(Y)){Y=Y.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,he)),Z.push(Re);continue}if(Re=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,he)),Z.push(Re);continue}if(Re=this.tokenizer.strong(Y,Ue,De)){Y=Y.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],se,he),Z.push(Re);continue}if(Re=this.tokenizer.em(Y,Ue,De)){Y=Y.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],se,he),Z.push(Re);continue}if(Re=this.tokenizer.codespan(Y)){Y=Y.substring(Re.raw.length),Z.push(Re);continue}if(Re=this.tokenizer.br(Y)){Y=Y.substring(Re.raw.length),Z.push(Re);continue}if(Re=this.tokenizer.del(Y)){Y=Y.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],se,he),Z.push(Re);continue}if(Re=this.tokenizer.autolink(Y,ie)){Y=Y.substring(Re.raw.length),Z.push(Re);continue}if(!se&&(Re=this.tokenizer.url(Y,ie))){Y=Y.substring(Re.raw.length),Z.push(Re);continue}if(Re=this.tokenizer.inlineText(Y,he,M)){Y=Y.substring(Re.raw.length),De=Re.raw.slice(-1),Z.push(Re);continue}if(Y){var Qe="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return Z},W(G,null,[{key:"rules",get:function(){return{block:U,inline:K}}}]),G}(),Oe=F.defaults,q=P.cleanUrl,ce=P.escape,Se=function(){function G(re){this.options=re||Oe}var J=G.prototype;return J.code=function(Y,Z,se){var he=(Z||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(Y,he);De!=null&&De!==Y&&(se=!0,Y=De)}return he?'<pre><code class="'+this.options.langPrefix+ce(he,!0)+'">'+(se?Y:ce(Y,!0))+`</code></pre>
|
|
`:"<pre><code>"+(se?Y:ce(Y,!0))+`</code></pre>
|
|
`},J.blockquote=function(Y){return`<blockquote>
|
|
`+Y+`</blockquote>
|
|
`},J.html=function(Y){return Y},J.heading=function(Y,Z,se,he){return this.options.headerIds?"<h"+Z+' id="'+this.options.headerPrefix+he.slug(se)+'">'+Y+"</h"+Z+`>
|
|
`:"<h"+Z+">"+Y+"</h"+Z+`>
|
|
`},J.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},J.list=function(Y,Z,se){var he=Z?"ol":"ul",De=Z&&se!==1?' start="'+se+'"':"";return"<"+he+De+`>
|
|
`+Y+"</"+he+`>
|
|
`},J.listitem=function(Y){return"<li>"+Y+`</li>
|
|
`},J.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},J.paragraph=function(Y){return"<p>"+Y+`</p>
|
|
`},J.table=function(Y,Z){return Z&&(Z="<tbody>"+Z+"</tbody>"),`<table>
|
|
<thead>
|
|
`+Y+`</thead>
|
|
`+Z+`</table>
|
|
`},J.tablerow=function(Y){return`<tr>
|
|
`+Y+`</tr>
|
|
`},J.tablecell=function(Y,Z){var se=Z.header?"th":"td",he=Z.align?"<"+se+' align="'+Z.align+'">':"<"+se+">";return he+Y+"</"+se+`>
|
|
`},J.strong=function(Y){return"<strong>"+Y+"</strong>"},J.em=function(Y){return"<em>"+Y+"</em>"},J.codespan=function(Y){return"<code>"+Y+"</code>"},J.br=function(){return this.options.xhtml?"<br/>":"<br>"},J.del=function(Y){return"<del>"+Y+"</del>"},J.link=function(Y,Z,se){if(Y=q(this.options.sanitize,this.options.baseUrl,Y),Y===null)return se;var he='<a href="'+ce(Y)+'"';return Z&&(he+=' title="'+Z+'"'),he+=">"+se+"</a>",he},J.image=function(Y,Z,se){if(Y=q(this.options.sanitize,this.options.baseUrl,Y),Y===null)return se;var he='<img src="'+Y+'" alt="'+se+'"';return Z&&(he+=' title="'+Z+'"'),he+=this.options.xhtml?"/>":">",he},J.text=function(Y){return Y},G}(),Ce=function(){function G(){}var J=G.prototype;return J.strong=function(Y){return Y},J.em=function(Y){return Y},J.codespan=function(Y){return Y},J.del=function(Y){return Y},J.html=function(Y){return Y},J.text=function(Y){return Y},J.link=function(Y,Z,se){return""+se},J.image=function(Y,Z,se){return""+se},J.br=function(){return""},G}(),Pe=function(){function G(){this.seen={}}var J=G.prototype;return J.slug=function(Y){var Z=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Z)){var se=Z;do this.seen[se]++,Z=se+"-"+this.seen[se];while(this.seen.hasOwnProperty(Z))}return this.seen[Z]=0,Z},G}(),Ne=F.defaults,Ie=P.unescape,Me=function(){function G(re){this.options=re||Ne,this.options.renderer=this.options.renderer||new Se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Pe}G.parse=function(Y,Z){var se=new G(Z);return se.parse(Y)};var J=G.prototype;return J.parse=function(Y,Z){Z===void 0&&(Z=!0);var se="",he,De,Re,Ue,Ve,Je,Qe,ht,st,qe,Ut,Et,Ft,kt,ot,jt,Jt,Vt,rn=Y.length;for(he=0;he<rn;he++){qe=Y[he];switch(qe.type){case"space":continue;case"hr":{se+=this.renderer.hr();continue}case"heading":{se+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,Ie(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{se+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(ht="",Qe="",Ue=qe.header.length,De=0;De<Ue;De++)Qe+=this.renderer.tablecell(this.parseInline(qe.tokens.header[De]),{header:!0,align:qe.align[De]});for(ht+=this.renderer.tablerow(Qe),st="",Ue=qe.cells.length,De=0;De<Ue;De++){for(Je=qe.tokens.cells[De],Qe="",Ve=Je.length,Re=0;Re<Ve;Re++)Qe+=this.renderer.tablecell(this.parseInline(Je[Re]),{header:!1,align:qe.align[Re]});st+=this.renderer.tablerow(Qe)}se+=this.renderer.table(ht,st);continue}case"blockquote":{st=this.parse(qe.tokens),se+=this.renderer.blockquote(st);continue}case"list":{for(Ut=qe.ordered,Et=qe.start,Ft=qe.loose,Ue=qe.items.length,st="",De=0;De<Ue;De++)ot=qe.items[De],jt=ot.checked,Jt=ot.task,kt="",ot.task&&(Vt=this.renderer.checkbox(jt),Ft?ot.tokens.length>0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=Vt+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=Vt+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:Vt}):kt+=Vt),kt+=this.parse(ot.tokens,Ft),st+=this.renderer.listitem(kt,Jt,jt);se+=this.renderer.list(st,Ut,Et);continue}case"html":{se+=this.renderer.html(qe.text);continue}case"paragraph":{se+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(st=qe.tokens?this.parseInline(qe.tokens):qe.text;he+1<rn&&Y[he+1].type==="text";)qe=Y[++he],st+=`
|
|
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);se+=Z?this.renderer.paragraph(st):st;continue}default:{var Ze='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(Ze);return}else throw new Error(Ze)}}}return se},J.parseInline=function(Y,Z){Z=Z||this.renderer;var se="",he,De,Re=Y.length;for(he=0;he<Re;he++){De=Y[he];switch(De.type){case"escape":{se+=Z.text(De.text);break}case"html":{se+=Z.html(De.text);break}case"link":{se+=Z.link(De.href,De.title,this.parseInline(De.tokens,Z));break}case"image":{se+=Z.image(De.href,De.title,De.text);break}case"strong":{se+=Z.strong(this.parseInline(De.tokens,Z));break}case"em":{se+=Z.em(this.parseInline(De.tokens,Z));break}case"codespan":{se+=Z.codespan(De.text);break}case"br":{se+=Z.br();break}case"del":{se+=Z.del(this.parseInline(De.tokens,Z));break}case"text":{se+=Z.text(De.text);break}default:{var Ue='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return se},G}(),He=P.merge,We=P.checkSanitizeDeprecation,Ge=P.escape,Be=F.getDefaults,Xe=F.changeDefaults,Ye=F.defaults;function ne(G,J,re){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof J=="function"&&(re=J,J=null),J=He({},ne.defaults,J||{}),We(J),re){var Y=J.highlight,Z;try{Z=Ee.lex(G,J)}catch(Re){return re(Re)}var se=function(Ue){var Ve;if(!Ue)try{Ve=Me.parse(Z,J)}catch(Je){Ue=Je}return J.highlight=Y,Ue?re(Ue):re(null,Ve)};if(!Y||Y.length<3)return se();if(delete J.highlight,!Z.length)return se();var he=0;ne.walkTokens(Z,function(Re){Re.type==="code"&&(he++,setTimeout(function(){Y(Re.text,Re.lang,function(Ue,Ve){if(Ue)return se(Ue);Ve!=null&&Ve!==Re.text&&(Re.text=Ve,Re.escaped=!0),he--,he===0&&se()})},0))}),he===0&&se();return}try{var De=Ee.lex(G,J);return J.walkTokens&&ne.walkTokens(De,J.walkTokens),Me.parse(De,J)}catch(Re){if(Re.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,J.silent)return"<p>An error occurred:</p><pre>"+Ge(Re.message+"",!0)+"</pre>";throw Re}}ne.options=ne.setOptions=function(G){return He(ne.defaults,G),Xe(ne.defaults),ne},ne.getDefaults=Be,ne.defaults=Ye,ne.use=function(G){var J=He({},G);if(G.renderer&&function(){var Y=ne.defaults.renderer||new Se,Z=function(De){var Re=Y[De];Y[De]=function(){for(var Ue=arguments.length,Ve=new Array(Ue),Je=0;Je<Ue;Je++)Ve[Je]=arguments[Je];var Qe=G.renderer[De].apply(Y,Ve);return Qe===!1&&(Qe=Re.apply(Y,Ve)),Qe}};for(var se in G.renderer)Z(se);J.renderer=Y}(),G.tokenizer&&function(){var Y=ne.defaults.tokenizer||new ve,Z=function(De){var Re=Y[De];Y[De]=function(){for(var Ue=arguments.length,Ve=new Array(Ue),Je=0;Je<Ue;Je++)Ve[Je]=arguments[Je];var Qe=G.tokenizer[De].apply(Y,Ve);return Qe===!1&&(Qe=Re.apply(Y,Ve)),Qe}};for(var se in G.tokenizer)Z(se);J.tokenizer=Y}(),G.walkTokens){var re=ne.defaults.walkTokens;J.walkTokens=function(Y){G.walkTokens(Y),re&&re(Y)}}ne.setOptions(J)},ne.walkTokens=function(G,J){for(var re=S(G),Y;!(Y=re()).done;){var Z=Y.value;J(Z);switch(Z.type){case"table":{for(var se=S(Z.tokens.header),he;!(he=se()).done;){var De=he.value;ne.walkTokens(De,J)}for(var Re=S(Z.tokens.cells),Ue;!(Ue=Re()).done;)for(var Ve=Ue.value,Je=S(Ve),Qe;!(Qe=Je()).done;){var ht=Qe.value;ne.walkTokens(ht,J)}break}case"list":{ne.walkTokens(Z.items,J);break}default:Z.tokens&&ne.walkTokens(Z.tokens,J)}}},ne.Parser=Me,ne.parser=Me.parse,ne.Renderer=Se,ne.TextRenderer=Ce,ne.Lexer=Ee,ne.lexer=Ee.lex,ne.Tokenizer=ve,ne.Slugger=Pe,ne.parse=ne;var z=ne;return z})},EJTS:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return c});var ue=j("qVdP"),W=j("jsC+"),R=j("lUTK"),N=j("BvKs"),S=j("sRBo"),O=j("kaz8"),F=j("oBTY"),B=j("7Kak"),e=j("9yH6"),w=j("tJVT"),g=j("q1tI"),u=j.n(g),l=j("9Bee"),s=j("+vTd"),i=j.n(s),o=j("xKgJ"),a=j("Is5a"),r=j.n(a),n=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],t=["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"],v=function(b){var y,d=b.data,f=b.selectIds,m=b.onSelectCheckBox,h=m===void 0?function(){}:m,E=b.showCheckbox,_=E===void 0?!0:E,T=Object(g.useState)(!1),k=Object(w.a)(T,2),D=k[0],x=k[1],P=function(){if(d.item_type==="JUDGMENT")return u.a.createElement("div",{className:i.a.judgmentContent},d.choices.map(function(be,ve){return u.a.createElement(e.a,{key:ve,disabled:!0},be.choice_text)}));if(d.item_type==="PROGRAM"){var ge;return u.a.createElement("div",{className:i.a.programContent},u.a.createElement(l.a,{value:(ge=d.program_attr)===null||ge===void 0?void 0:ge.description}))}if(d.item_type==="COMBINATION"){var te;return u.a.createElement("div",{className:i.a.combinationContent},d==null||((te=d.sub_item_banks)===null||te===void 0)?void 0:te.map(function(be,ve){var oe,le="(\u9898\u76EE".concat(ve+1,"-\u5355\u9009\u9898) ");return u.a.createElement(g.Fragment,null,u.a.createElement("div",{style:{marginTop:10,marginBottom:10}},u.a.createElement(l.a,{value:le+be.name})),be.choices.map(function(_e,ee){return u.a.createElement("div",{key:ee,className:i.a.otherContentItem},u.a.createElement("p",null,n[ee]),u.a.createElement(l.a,{className:i.a.otehrContentHtml,value:_e.choice_text}))}),u.a.createElement("div",{className:i.a.con},u.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",t==null?void 0:t[be==null||((oe=be.choices)===null||oe===void 0)?void 0:oe.findIndex(function(_e){return _e==null?void 0:_e.is_answer})]," "),u.a.createElement("div",null,u.a.createElement("span",null,"\u89E3\u6790\uFF1A"),u.a.createElement(l.a,{className:i.a.parseAnswerHtml,value:be.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return u.a.createElement("div",{className:i.a.otherContent},d.choices.map(function(be,ve){return u.a.createElement("div",{key:ve,className:i.a.otherContentItem},u.a.createElement("p",null,n[ve]),u.a.createElement(l.a,{className:i.a.otehrContentHtml,value:be.choice_text}))}))},H=function(){var ge;return u.a.createElement("div",null,(ge=d.standard_answer)===null||ge===void 0?void 0:ge.map(function(te,be){return u.a.createElement(l.a,{key:be,className:i.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(te.position,"\uFF09\uFF1A").concat(te.answer_text.join("\u3001"))})}))},I=function(){var ge,te,be,ve={SUBJECTIVE:(ge=d.answer_texts)===null||ge===void 0?void 0:ge[0],JUDGMENT:(te=d.choices)===null||te===void 0||((be=te.find(function(C){return C.is_answer}))===null||be===void 0)?void 0:be.choice_text},oe=d.choices.map(function(C){return C.is_answer}).findIndex(function(C){return C}),le=oe>-1?t[oe]:"",_e="";d.choices.map(function(C,U){C.is_answer&&(_e+=t[U])});var ee=ve[d.item_type],L={SINGLE:u.a.createElement(l.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(le||"\u65E0")}),MULTIPLE:u.a.createElement(l.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(_e||"\u65E0")}),COMPLETION:H()},A=u.a.createElement(l.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ee||"\u65E0")});return L[d.item_type]||A},V=function(ge){var te=Object(F.a)(f);ge.target.checked?te.push(d.id):te=te.filter(function(be){return be!==d.id}),h(te)};return u.a.createElement("div",{className:i.a.itemWrap},u.a.createElement("div",{className:i.a.list},_&&u.a.createElement(O.a,{className:"mr10",onChange:V,checked:f.includes(d.id)}),u.a.createElement("div",{className:i.a.title},u.a.createElement(l.a,{key:1,showLines:1,showTextOnly:!0,className:i.a.topicTitleContent,value:d.name})),u.a.createElement("div",{className:i.a.line},u.a.createElement("b",{className:i.a.b1}),u.a.createElement("b",{className:i.a.b2})),u.a.createElement("div",{onClick:function(){return x(!D)},className:i.a.tr},D?"\u6536\u8D77":"\u5C55\u5F00",u.a.createElement("i",{style:{transform:D?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),u.a.createElement("aside",{style:D?{display:"block"}:{display:"none"},className:i.a.itemDetail},u.a.createElement("div",{style:{marginBottom:44}},u.a.createElement(l.a,{key:2,className:i.a.topicTitleContent,value:d.name}),u.a.createElement("div",{className:"".concat(i.a.row," mt15")},P()),u.a.createElement("div",{className:i.a.row},u.a.createElement("div",{className:i.a.updateTimeRow},u.a.createElement("div",{className:i.a.updateTimeWrap},d.item_type==="PROGRAM"&&u.a.createElement("p",{className:i.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(y=d.program_attr)===null||y===void 0?void 0:y.language))))),d.item_type!=="PROGRAM"&&d.item_type!=="COMBINATION"&&u.a.createElement("div",{className:i.a.answerWrapper},u.a.createElement("img",{src:r.a,alt:"",className:i.a.decoration}),u.a.createElement("div",{className:i.a.answer},I()),u.a.createElement("div",{className:i.a.parse},u.a.createElement("div",{className:i.a.parseText},"\u89E3\u6790\uFF1A"),u.a.createElement("div",{className:i.a.parseAnswer},d.analysis?u.a.createElement(l.a,{className:i.a.parseAnswerHtml,value:d.analysis}):"\u6682\u65E0\u89E3\u6790")))))},c=function(b){var y,d,f,m,h,E,_,T,k,D,x,P,H,I,V,$,ge=b.isProblemset,te=b.data,be=b.user,ve=b.activeTabsKey,oe=b.onPublicReview,le=oe===void 0?function(){}:oe,_e=b.onStartExperience,ee=_e===void 0?function(){}:_e,L=b.onSetPrivate,A=L===void 0?function(){}:L,C=b.onCorrection,U=C===void 0?function(){}:C,K=b.onCollect,M=K===void 0?function(){}:K,ie=b.onSetPublic,Ee=ie===void 0?function(){}:ie,Oe=b.onDelete,q=Oe===void 0?function(){}:Oe,ce=b.onCancel,Se=ce===void 0?function(){}:ce,Ce=b.onSelect,Pe=Ce===void 0?function(){}:Ce,Ne=b.onMoveTo,Ie=Ne===void 0?function(){}:Ne,Me=b.onSetShare,He=Me===void 0?function(){}:Me,We=b.onCancelShare,Ge=We===void 0?function(){}:We,Be=b.onPublish,Xe=Be===void 0?function(){}:Be,Ye=b.onCancelPublish,ne=Ye===void 0?function(){}:Ye,z=te.item_type==="PROGRAM"?"/problems/".concat((y=te.program_attr)===null||y===void 0?void 0:y.identifier,"/edit"):"/problemset/edit/".concat(te.id),G=ve==="0"&&!te.public&&!te.apply&&(te.item_type==="PROGRAM"&&((d=te.program_attr)===null||d===void 0?void 0:d.status)!==0||te.item_type!=="PROGRAM"),J=u.a.createElement(N.a,{forceSubMenuRender:!0,className:i.a.menu},ve==="0"&&!te.public&&u.a.createElement(N.a.Item,{key:"-1"},u.a.createElement("a",{className:i.a.actionLink,target:"_blank",href:z},"\u7F16\u8F91")),(ve==="0"||ve==="3")&&te.item_type==="PROGRAM"&&((f=te.program_attr)===null||f===void 0?void 0:f.status)!==0&&!te.public&&((m=te.author)===null||m===void 0?void 0:m.login)===((h=be.userInfo)===null||h===void 0?void 0:h.login)&&u.a.createElement(N.a.Item,{key:"0"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return ne(te==null||((se=te.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u64A4\u9500\u53D1\u5E03")),ve==="0"&&u.a.createElement(N.a.Item,{key:"1"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ie(te.id)}},"\u79FB\u52A8\u5230")),ve==="0"&&!(te!=null&&te.is_share)&&u.a.createElement(N.a.Item,{key:"3"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return He(te.id)}},"\u5171\u4EAB")),(ve==="0"&&(te==null?void 0:te.is_share)||ve==="3"&&((E=te.author)===null||E===void 0?void 0:E.login)===((_=be.userInfo)===null||_===void 0?void 0:_.login))&&u.a.createElement(N.a.Item,{key:"3"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ge(te.id)}},"\u64A4\u9500\u5171\u4EAB")),G&&u.a.createElement(N.a.Item,{key:"4"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ee(te.id)}},"\u516C\u5F00")),ve==="0"&&!te.public&&te.apply&&(te.item_type==="PROGRAM"&&te.program_attr.status!==0||te.item_type!=="PROGRAM")&&u.a.createElement(N.a.Item,{key:"5"},u.a.createElement("a",{className:i.a.reviewFlag,onClick:le},"\u5BA1\u6838\u4E2D")),(ve==="0"||ve==="1")&&te.public&&((T=te.author)===null||T===void 0?void 0:T.login)===((k=be.userInfo)===null||k===void 0?void 0:k.login)&&u.a.createElement(N.a.Item,{key:"6"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return A(te.id)}},"\u64A4\u9500\u516C\u5F00")),ve==="2"&&u.a.createElement(N.a.Item,{key:"7"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return M(te.id,te.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(ve==="0"||ve==="3")&&te.item_type==="PROGRAM"&&((D=te.program_attr)===null||D===void 0?void 0:D.status)===0&&!te.public&&((x=te.author)===null||x===void 0?void 0:x.login)===((P=be.userInfo)===null||P===void 0?void 0:P.login)&&u.a.createElement(N.a.Item,{key:"8"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return Xe(te==null||((se=te.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u53D1\u5E03")),(ve==="1"||ve==="3")&&!Object(o.o)()&&!Object(o.m)()&&((H=te.author)===null||H===void 0?void 0:H.login)!==((I=be.userInfo)===null||I===void 0?void 0:I.login)&&u.a.createElement(N.a.Item,{key:"9"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return M(te.id,te.is_collected)}},te.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),ve!=="0"&&!Object(o.o)()&&!Object(o.m)()&&u.a.createElement(N.a.Item,{key:"10"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return U(te.id)}},"\u7EA0\u9519")),(ve==="0"&&!te.public||ve==="1"&&Object(o.o)()&&((V=te.author)===null||V===void 0?void 0:V.login)!==(($=be.userInfo)===null||$===void 0?void 0:$.login))&&u.a.createElement(N.a.Item,{key:"11"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return q(te.id)}},"\u5220\u9664"))),re=u.a.createElement(N.a,{forceSubMenuRender:!0,className:i.a.menu},u.a.createElement(N.a.Item,{key:"10"},u.a.createElement("a",{className:i.a.actionLink,onClick:function(){return U(te.id)}},"\u7EA0\u9519"))),Y=ve!=="0"&&!Object(o.o)()&&!Object(o.m)();return u.a.createElement(u.a.Fragment,null,ge?u.a.createElement(u.a.Fragment,null,te.item_type!=="SUBJECTIVE"&&te.item_type!=="COMBINATION"&&u.a.createElement("span",{className:i.a.textBtn,style:{cursor:"pointer"},onClick:function(){return ee(te)}},"\u4F53\u9A8C"),u.a.createElement(W.a,{overlay:J},u.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},u.a.createElement("span",{className:i.a.textBtn},"\u66F4\u591A")))):Y?u.a.createElement(W.a,{className:"ml40",overlay:re},u.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},u.a.createElement("span",null,"\u66F4\u591A"))):u.a.createElement("span",null))};ye.b=v},FKdj:function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___3uXpC",flex_space_between:"flex_space_between___1R5l3",flex_box_vertical_center:"flex_box_vertical_center___2whw-",flex_box_center_end:"flex_box_center_end___Jni7d",flex_box_column:"flex_box_column___bQWh0",page:"page___2wqIC",wrap:"wrap___3ThhU",title:"title___3BwkD",select:"select___2Ozsr",contentWrap:"contentWrap___3srp0",pngIcon:"pngIcon___2ckkq",tabsWrap:"tabsWrap___2Y959",searchWrap:"searchWrap___H9GsL",addQuestionBtn:"addQuestionBtn___1b8s_",search:"search___3d1EJ",searchIcon:"searchIcon___1mrzV",batchWrap:"batchWrap___j1Er3",contentListWrap:"contentListWrap___3pty2",li:"li___2UOPB",bottom:"bottom___I7MVG",actionLeftItem:"actionLeftItem___3bGeH",questionTypeName:"questionTypeName___Aiyux",more:"more___YExtS",btnAdd:"btnAdd___2RrWf",treeWrapper:"treeWrapper___U0OPC",treeHeader:"treeHeader___1LB2p",treeContent:"treeContent___Ckfqx",action:"action___Xn5RP",headerWrapper:"headerWrapper___3ECJD",exportBtn:"exportBtn___35cZE"}},FOrL:function(Ke,ye,j){Ke.exports=j.p+"static/nodata.a6b3f948.png"},FWmy:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return ue});function ue(W,R){if(!W)throw new Error(R?`Assertion failed (${R})`:"Assertion Failed")}},Is5a:function(Ke,ye){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(Ke,ye){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JYp7:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return ue});var ue;(function(W){function R(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}W.is=R;const N=Object.freeze([]);function S(){return N}W.empty=S;function*O(t){yield t}W.single=O;function F(t){return t||N}W.from=F;function B(t){return!t||t[Symbol.iterator]().next().done===!0}W.isEmpty=B;function e(t){return t[Symbol.iterator]().next().value}W.first=e;function w(t,v){for(const c of t)if(v(c))return!0;return!1}W.some=w;function g(t,v){for(const c of t)if(v(c))return c;return}W.find=g;function*u(t,v){for(const c of t)v(c)&&(yield c)}W.filter=u;function*l(t,v){let c=0;for(const p of t)yield v(p,c++)}W.map=l;function*s(...t){for(const v of t)for(const c of v)yield c}W.concat=s;function*i(t){for(const v of t)for(const c of v)yield c}W.concatNested=i;function o(t,v,c){let p=c;for(const b of t)p=v(p,b);return p}W.reduce=o;function*a(t,v,c=t.length){for(v<0&&(v+=t.length),c<0?c+=t.length:c>t.length&&(c=t.length);v<c;v++)yield t[v]}W.slice=a;function r(t,v=Number.POSITIVE_INFINITY){const c=[];if(v===0)return[c,t];const p=t[Symbol.iterator]();for(let b=0;b<v;b++){const y=p.next();if(y.done)return[c,W.empty()];c.push(y.value)}return[c,{[Symbol.iterator](){return p}}]}W.consume=r;function n(t,v,c=(p,b)=>p===b){const p=t[Symbol.iterator](),b=v[Symbol.iterator]();for(;;){const y=p.next(),d=b.next();if(y.done!==d.done)return!1;if(y.done)return!0;if(!c(y.value,d.value))return!1}}W.equals=n})(ue||(ue={}))},KMxT:function(Ke,ye,j){"use strict";j.r(ye);var ue=j("DjyN"),W=j("NUBc"),R=j("qVdP"),N=j("jsC+"),S=j("lUTK"),O=j("BvKs"),F=j("T2oS"),B=j("W9HT"),e=j("+L6B"),w=j("2/Rp"),g=j("k1fw"),u=j("9og8"),l=j("tJVT"),s=j("PpiC"),i=j("5NDa"),o=j("5rEg"),a=j("Znn+"),r=j("ZTPi"),n=j("WmNS"),t=j.n(n),v=j("q1tI"),c=j.n(v),p=j("9kvl"),b=j("iris"),y=j("jcZT"),d=j("BdwD"),f=j("SAoR"),m=j("FKdj"),h=j.n(m),E=j("EJTS"),_=j("LE3n"),T=j("xKgJ"),k=j("SVaM"),D=j("xTzM"),x=j.n(D),P=j("1vsH"),H=j("ErOA"),I=r.a.TabPane,V=o.a.Search,$;(function(te){te.Mine="0",te.Public="1",te.Collection="2",te.TeachGroupShare="3"})($||($={}));var ge=function(be){var ve,oe,le,_e,ee,L,A,C,U=be.classroomList,K=be.problemset,M=be.user,ie=be.globalSetting,Ee=be.loading,Oe=be.dispatch,q=be.match,ce=be.shixunHomeworks,Se=Object(s.a)(be,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Ce=Object(P.I)(),Pe=Object(v.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:Ce.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((ve=Se.location)===null||ve===void 0||((oe=ve.query)===null||oe===void 0)?void 0:oe.id)||null,exam_id:(q==null||((le=q.params)===null||le===void 0)?void 0:le.id)||null,exercise_id:(q==null||((_e=q.params)===null||_e===void 0)?void 0:_e.categoryId)||null}),Ne=Object(l.a)(Pe,2),Ie=Ne[0],Me=Ne[1],He=Object(v.useState)(0),We=Object(l.a)(He,2),Ge=We[0],Be=We[1],Xe=Object(v.useState)([]),Ye=Object(l.a)(Xe,2),ne=Ye[0],z=Ye[1],G=Object(v.useState)($.Mine),J=Object(l.a)(G,2),re=J[0],Y=J[1],Z=Object(v.useState)(-1),se=Object(l.a)(Z,2),he=se[0],De=se[1],Re=Object(v.useState)([]),Ue=Object(l.a)(Re,2),Ve=Ue[0],Je=Ue[1],Qe=Object(v.useState)([]),ht=Object(l.a)(Qe,2),st=ht[0],qe=ht[1],Ut=Object(v.useState)(!1),Et=Object(l.a)(Ut,2),Ft=Et[0],kt=Et[1],ot=Object(v.useRef)(!1),jt=Object(v.useState)([]),Jt=Object(l.a)(jt,2),Vt=Jt[0],rn=Jt[1],Ze=Object(v.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),it=Object(l.a)(Ze,2),ft=it[0],It=it[1],$t=Object(v.useState)([]),ln=Object(l.a)($t,2),Nt=ln[0],pt=ln[1],yt=Object(v.useRef)(null),ut=Object(v.useState)(!1),Qt=Object(l.a)(ut,2),Rt=Qt[0],dn=Qt[1],Kt=Object(v.useState)(""),gn=Object(l.a)(Kt,2),xn=gn[0],Sn=gn[1],Cn=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(v.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(v.useEffect)(function(){var tt;Oe({type:"problemset/getDisciplines",payload:{source:"question"}});var et=((tt=Se.location.query)===null||tt===void 0?void 0:tt.group_id)||0;Ie.group_id=Number(et),Me(Ie),en(Ie).then(function(mt){mt!=null&&mt.status||pt(mt==null?void 0:mt.item_banks_group),dn(!1)}),ni(),ti()},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Oe({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Oe({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Oe({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Oe({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Oe({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var ti=function(){var tt=Object(u.a)(t.a.mark(function et(){return t.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:Oe({type:"problemset/getTeachGroupData"});case 1:case"end":return Ot.stop()}},et)}));return function(){return tt.apply(this,arguments)}}(),en=function(){var tt=Object(u.a)(t.a.mark(function et(mt){var Ot;return t.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return mt.item_type=mt.item_type,dn(!0),Xt.next=4,Oe({type:"problemset/getItemBanks",payload:mt});case 4:if(Ot=Xt.sent,!(Ot&&Ot.status!==403&&Ot.status!==401&&Ot.status!==500)){Xt.next=14;break}return Be(Ot.items_count||0),z(Ot.items||[]),Je(Ot.tag_disciplines||[]),ii(Ot.items||[]),rn([]),qe((Ot==null?void 0:Ot.navigation)||[]),dn(!1),Xt.abrupt("return",Ot);case 14:case"end":return Xt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),ni=function(){Oe({type:"problemset/getBasketList",payload:{}})},ii=function(et){var mt=et.every(function(Ot){var qt;return((qt=Ot.program_attr)===null||qt===void 0?void 0:qt.status)===0});ot.current=mt},ri=function(et,mt){if(Ie.discipline_id=et||"",Ie.sub_discipline_id=mt||"",Ie.tag_discipline_id="",Ie.page=1,Ie.per_page=20,delete Ie.id,De(et===null?-1:null),Me(Ie),en(Ie),et===null)return},Ai=function(et){Ie.difficulty=et||"",Ie.page=1,Ie.per_page=20,delete Ie.id,Me(Ie),en(Ie)},On=function(et){Ie.tag_discipline_id=et,Ie.page=1,Ie.per_page=20,delete Ie.id,et===-1&&(Ie.discipline_id="",Ie.sub_discipline_id="",Ie.tag_discipline_id=""),De(et),Me(Ie),en(Ie)},Hn=Object(v.useState)(!1),Kn=Object(l.a)(Hn,2),ai=Kn[0],Gn=Kn[1],zn=function(et){Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:et}}),Ie.discipline_id="",Ie.sub_discipline_id="",Ie.tag_discipline_id="",Ie.difficulty=null,Ie.type=et,et==="0"?Ie.group_id=0:Ie.group_id=null,et==="3"?Gn(!0):Gn(!1),Ie.page=1,Ie.per_page=20,delete Ie.id,De(-1),Y(et),Me(Ie),en(Ie)},si=function(et,mt){Ie.page=et,Ie.per_page=mt,Me(Ie),en(Ie)},Ln=function(et){Ie.discipline_id="",Ie.sub_discipline_id="",Ie.tag_discipline_id="",Ie.difficulty=null,Ie.page=1,Ie.keyword=et,delete Ie.id,et?(kt(!0),Object(k.a)({name:et,copywriting:et,position:"ItemBank"})):kt(!1),De(-1),Me(Ie),en(Ie)},oi=function(){Ie.per_page=20,Me(Ie),en(Ie)},Vn=function(){var tt=Object(u.a)(t.a.mark(function et(mt){return t.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(mt),group_type:$.Mine}}),Ie.page=1,Ie.per_page=20,Ie.group_id=Math.abs(mt),Me(Ie),en(Ie).then(function(Xt){return pt(Xt==null?void 0:Xt.item_banks_group)});case 6:case"end":return qt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),Xn=function(){Oe({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Ie}});return},li=function(){Oe({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Yn=function(){var tt=Object(u.a)(t.a.mark(function et(mt){return t.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:mt,group_type:$.TeachGroupShare}}),Ie.page=1,Ie.group_id=mt||null,delete Ie.id,Me(Object(g.a)({},Ie)),en(Ie);case 6:case"end":return qt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),ui=function(et){Ie.sort_by=et.type,Ie.sort_direction=et.direction,Ie.page=1,Ie.per_page=20,It(et.name),Me(Ie),en(Ie)},di=function(et){Ie.discipline_id="",Ie.sub_discipline_id="",Ie.tag_discipline_id="",Ie.difficulty=null,Ie.page=1,Ie.per_page=20,Ie.group_id=et,De(-1),Me(Ie),en(Ie).then(function(mt){return pt(mt==null?void 0:mt.item_banks_group)})},$n=function(et){rn(et)},ci=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],hi={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Qn=function(){var tt=Object(u.a)(t.a.mark(function et(mt){var Ot;return t.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(Ce.type==="exercise")){Xt.next=6;break}return Xt.next=3,Object(H.a)("/api/exercises/".concat(Ce.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:Ce.qid,item_bank_id:mt}});case 3:return Ot=Xt.sent,Ot!=null&&Ot.status||p.d.push(Ce.from),Xt.abrupt("return");case 6:case"end":return Xt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}();return c.a.createElement("div",{className:h.a.page},c.a.createElement("section",null,c.a.createElement("div",{className:h.a.wrap},c.a.createElement("div",{className:h.a.title},"\u8BD5\u9898\u5E93"),c.a.createElement("div",{className:h.a.headerWrapper},c.a.createElement("div",{className:h.a.tabsWrap},c.a.createElement(r.a,{activeKey:re,onChange:zn,tabBarExtraContent:c.a.createElement("div",{className:h.a.searchWrap},c.a.createElement(V,{allowClear:!0,suffix:c.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(h.a.searchIcon),onClick:function(){return Ln(Ie.keyword)}}),className:h.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:Ie.keyword,onChange:function(et){Ie.keyword=et.target.value,Me(Object(g.a)({},Ie))},onSearch:Ln}))},c.a.createElement(I,{tab:"\u516C\u5171",key:"1"}),((ee=K.teachGroupData)===null||ee===void 0||((L=ee.groups)===null||L===void 0)?void 0:L.length)&&c.a.createElement(I,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(T.o)()&&!Object(T.m)()&&c.a.createElement(I,{tab:"\u6536\u85CF\u5939",key:"2"}),c.a.createElement(I,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),c.a.createElement(b.a,{showSelectAll:!1,className:h.a.select,disciplinesData:(A=K.disciplinesData)===null||A===void 0?void 0:A.disciplines,knowledgeData:Ve,directionValue:Ie.discipline_id,subDisciplineValue:Ie.sub_discipline_id,typeValue:Ie.item_type,isprogram_homework:!1,showItemType:!1,showKnowledge:!0,name:xn,setname:Sn,difficultyValue:Ie.difficulty,showShixun:!1,onShixunChange:li,onDirectionChange:ri,onTypeChange:function(){},onDifficultyChange:Ai,knowledgeValue:he,onKnowledgeChange:On,teachGroupData:(C=K.teachGroupData)===null||C===void 0?void 0:C.groups,onTeachGroupChange:Yn,teachGroupValue:Ie.group_id,showTeachGroup:ai})),c.a.createElement("div",{className:h.a.treeWrapper,style:{display:re===$.Mine?"block":"none"}},c.a.createElement("div",{className:h.a.treeHeader},c.a.createElement(f.a,{data:st,onClick:Vn}),c.a.createElement(w.a,{type:"link",onClick:Xn,className:h.a.exportBtn},c.a.createElement("img",{src:x.a,alt:"",className:h.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),c.a.createElement(B.a,{spinning:Rt},c.a.createElement("div",{ref:yt,className:h.a.treeContent},c.a.createElement(_.a,{isProblemset:!1,reloadData:oi,data:Nt,onShare:function(){},onOpen:Vn})))),c.a.createElement("div",{className:h.a.contentWrap},c.a.createElement("div",{className:h.a.batchWrap},c.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},c.a.createElement("div",{className:"font14"},c.a.createElement(N.a,{overlay:c.a.createElement(O.a,{selectedKeys:[ft]},Cn==null?void 0:Cn.map(function(tt,et){return c.a.createElement(O.a.Item,{key:tt.name,onClick:function(){return ui(tt)}},tt.name)}))},c.a.createElement("span",{style:{color:"#464F66"}},c.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),ft))))),Ft?c.a.createElement("div",null,c.a.createElement(w.a,{style:{paddingLeft:0},onClick:function(){Ie.page=1,Ie.keyword=null,delete Ie.id,Me(Ie),kt(!1),en(Ie)},type:"link"},c.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),c.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",Ie.keyword,"\u201D")):null,c.a.createElement("div",{className:h.a.contentListWrap},Ge!==0?c.a.createElement(B.a,{size:"large",spinning:Ee["problemset/getItemBanks"]},ne.map(function(tt,et){var mt,Ot;return c.a.createElement("div",{className:h.a.li,key:tt.id},c.a.createElement("div",{className:h.a.top},c.a.createElement(E.b,{showCheckbox:!1,data:tt,selectIds:Vt,onSelectCheckBox:$n})),c.a.createElement("div",{className:h.a.bottom},c.a.createElement("p",{className:"".concat(h.a.actionLeftItem," ").concat(h.a.questionTypeName)},(mt=ci.find(function(qt){return qt.type===tt.item_type}))===null||mt===void 0?void 0:mt.name),c.a.createElement("p",{className:h.a.actionLeftItem},hi[tt.difficulty]),c.a.createElement("p",{className:h.a.actionLeftItem},"\u521B\u5EFA\u8005",c.a.createElement("span",{className:"c-grey-333"},tt==null||((Ot=tt.author)===null||Ot===void 0)?void 0:Ot.name)),c.a.createElement("p",{className:h.a.actionLeftItem},"\u66F4\u65B0",c.a.createElement("span",{className:"c-grey-333"},tt==null?void 0:tt.updated_at)),c.a.createElement("p",{className:h.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",c.a.createElement("span",{className:"c-grey-333"},tt==null?void 0:tt.quotes)),c.a.createElement("div",{className:h.a.more},c.a.createElement("span",{className:h.a.btnAdd,onClick:function(){return Qn(tt.id)}},"\u66FF\u6362"))))})):c.a.createElement(B.a,{size:"large",spinning:Ee["problemset/getItemBanks"]},c.a.createElement(d.a,null))),Ge!==0&&c.a.createElement(W.a,{showQuickJumper:!0,onChange:si,defaultCurrent:1,pageSize:Ie==null?void 0:Ie.per_page,current:Ie.page||1,total:Ge,showTotal:function(et){return c.a.createElement("span",{className:"mr10"},"\u5171",c.a.createElement("span",{className:"c-light-primary"},et),"\u6761\u6570\u636E")}}))),c.a.createElement(y.a,{onOk:di})))};ye.default=Object(p.a)(function(te){var be=te.classroomList,ve=te.problemset,oe=te.user,le=te.loading,_e=te.globalSetting,ee=te.shixunHomeworks;return{classroomList:be,problemset:ve,user:oe,globalSetting:_e,loading:le.effects,shixunHomeworks:ee}})(ge)},LE3n:function(Ke,ye,j){"use strict";var ue=j("ozfa"),W=j("MJZm"),R=j("k1fw"),N=j("+L6B"),S=j("2/Rp"),O=j("5NDa"),F=j("5rEg"),B=j("2qtc"),e=j("kLXV"),w=j("miYZ"),g=j("tsqr"),u=j("9og8"),l=j("tJVT"),s=j("WmNS"),i=j.n(s),o=j("q1tI"),a=j.n(o),r=j("1vnw"),n=j.n(r),t=j("ErOA"),v=j("Ix/O"),c=j.n(v),p=j("xTzM"),b=j.n(p),y=j("WCUW"),d=j("LvDl"),f=j.n(d),m=function(_){var T=_.isProblemset,k=_.name,D=_.id,x=_.itemBanksCount,P=_.onOpen,H=P===void 0?function(){}:P,I=_.onShare,V=I===void 0?function(){}:I,$=_.onMove,ge=$===void 0?function(){}:$,te=_.onDeleteOk,be=te===void 0?function(){}:te,ve=Object(o.useState)(!1),oe=Object(l.a)(ve,2),le=oe[0],_e=oe[1],ee=Object(o.useState)(k),L=Object(l.a)(ee,2),A=L[0],C=L[1],U=Object(o.useState)(k),K=Object(l.a)(U,2),M=K[0],ie=K[1],Ee=function(){var q=Object(u.a)(i.a.mark(function ce(Se){var Ce,Pe,Ne;return i.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(Ce=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],M.trim()){Me.next=4;break}return g.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Me.abrupt("return");case 4:if(!(M.charAt(0)===" ")){Me.next=7;break}return g.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Me.abrupt("return");case 7:Pe=0;case 8:if(!(Pe<M.length)){Me.next=15;break}if(!Ce.includes(M.charAt(Pe))){Me.next=12;break}return g.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Me.abrupt("return",!1);case 12:Pe++,Me.next=8;break;case 15:return Me.next=17,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(Se),".json"),{method:"put",body:{name:M}});case 17:Ne=Me.sent,Ne.status===0&&(_e(!1),C(M));case 19:case"end":return Me.stop()}},ce)}));return function(Se){return q.apply(this,arguments)}}(),Oe=function(ce){e.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:a.a.createElement("div",null,a.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),a.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Se=Object(u.a)(i.a.mark(function Pe(){var Ne;return i.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(ce),".json"),{method:"delete",body:{}});case 2:Ne=Me.sent,Ne.status===0&&be(ce);case 4:case"end":return Me.stop()}},Pe)}));function Ce(){return Se.apply(this,arguments)}return Ce}()})};return a.a.createElement("div",{className:n.a.list},le?a.a.createElement(F.a,{style:{maxWidth:780},value:M,onChange:function(ce){return ie(ce.target.value)}}):a.a.createElement("div",{title:A,onClick:function(){return H(D)},className:n.a.name},A),T&&a.a.createElement("div",{className:n.a.btns},le?a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{style:{height:16},onClick:function(){return Ee(D)},className:"ml0"},a.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),a.a.createElement("div",{style:{height:16},onClick:function(){ie(A),_e(!1)},className:"ml10"},a.a.createElement("i",{className:"iconfont icon-qingchu"}))):a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{onClick:function(){return ge(D,"up")},className:"ml0"},a.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),a.a.createElement("div",{onClick:function(){return ge(D,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},a.a.createElement("i",{className:"iconfont icon-shangyi3"}))),a.a.createElement(S.a,{className:"ml10",onClick:function(){if(!x){g.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}V(Math.abs(D))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),a.a.createElement(S.a,{className:"ml10",onClick:function(){return _e(!0)},type:"link"},"\u91CD\u547D\u540D"),a.a.createElement(S.a,{onClick:function(){return Oe(D)},type:"link",danger:!0},"\u5220\u9664")))},h=function(_){var T=_.isProblemset,k=_.data,D=_.onOpen,x=D===void 0?function(){}:D,P=_.onShare,H=P===void 0?function(){}:P,I=_.reloadData,V=Object(o.useState)(),$=Object(l.a)(V,2),ge=$[0],te=$[1];Object(o.useEffect)(function(){te(k==null?void 0:k.map(function(A){return{title:a.a.createElement(m,{isProblemset:T,name:A.name,id:A.id,itemBanksCount:A.item_banks_count,onMove:ve,onOpen:x,onShare:H,onDeleteOk:le}),key:A.id,icon:a.a.createElement("img",{src:c.a,className:n.a.folderIcon}),isLeaf:!1}}))},[k]);var be=function A(C,U,K){for(var M=Object(d.cloneDeep)(C),ie=0;ie<M.length;ie++){if(M[ie].key===U){if(K==="up"){var Ee=[M[ie],M[ie-1]];M[ie-1]=Ee[0],M[ie]=Ee[1]}else{var Oe=[M[ie+1],M[ie]];M[ie]=Oe[0],M[ie+1]=Oe[1]}break}M[ie].children&&(M[ie].children=A(M[ie].children,U,K))}return M},ve=function(){var A=Object(u.a)(i.a.mark(function C(U,K){var M;return i.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:if(!(K==="up")){Ee.next=6;break}return Ee.next=3,Object(y.I)({id:Math.abs(U)});case 3:Ee.t0=Ee.sent,Ee.next=9;break;case 6:return Ee.next=8,Object(y.H)({id:Math.abs(U)});case 8:Ee.t0=Ee.sent;case 9:M=Ee.t0,M.status===0&&te(function(Oe){return be(Oe,U,K)});case 11:case"end":return Ee.stop()}},C)}));return function(U,K){return A.apply(this,arguments)}}(),oe=function A(C,U){return C.filter(function(K){return K.key===U?!1:(K.children&&(K.children=A(K.children,U)),!0)})},le=function(C){te(function(U){return oe(U,C)}),I()},_e=function A(C,U,K){return C.map(function(M){return M.key===U?Object(R.a)(Object(R.a)({},M),K):M.children?Object(R.a)(Object(R.a)({},M),{},{children:A(M.children,U,K)}):M})},ee=function(){var A=Object(u.a)(i.a.mark(function C(U){var K,M,ie,Ee,Oe;return i.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return K=U.key,ce.next=3,Object(y.B)({group_id:Math.abs(K)});case 3:M=ce.sent,ie=M||{},Ee=ie.item_banks_group,Oe=ie.item_banks_group_count,Oe>0?te(function(Se){return _e(Se,K,{children:Ee.map(function(Ce){return{title:a.a.createElement(m,{isProblemset:T,name:Ce.name,id:Ce.id,itemBanksCount:Ce.item_banks_count,onMove:ve,onOpen:x,onShare:H,onDeleteOk:le}),key:Ce.id,icon:a.a.createElement("img",{src:c.a,className:n.a.folderIcon}),isLeaf:!1}})})}):te(function(Se){return _e(Se,K,{isLeaf:!0})});case 6:case"end":return ce.stop()}},C)}));return function(U){return A.apply(this,arguments)}}(),L=function(C,U){var K=U.node,M=U.expanded;te(function(ie){return _e(ie,K.key,{icon:M?a.a.createElement("img",{src:b.a,className:n.a.folderIcon}):a.a.createElement("img",{src:c.a,className:n.a.folderIcon})})})};return(ge==null?void 0:ge.length)>0&&a.a.createElement(W.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:ge,loadData:ee,onExpand:L,className:n.a.folderWrapper,selectable:!1})};ye.a=h},MI8n:function(Ke,ye,j){"use strict";j.d(ye,"c",function(){return S}),j.d(ye,"b",function(){return e}),j.d(ye,"e",function(){return w}),j.d(ye,"a",function(){return g}),j.d(ye,"d",function(){return u}),j.d(ye,"f",function(){return l});var ue=j("/cxE"),W=j("pmY6"),R=j("24hK"),N=j("5Y4S"),S;(function(s){s.None=()=>W.a.None;function i(T){return(k,D=null,x)=>{let P=!1,H;return H=T(I=>P?void 0:(H?H.dispose():P=!0,k.call(D,I)),null,x),P&&H.dispose(),H}}s.once=i;function o(T,k){return c((D,x=null,P)=>T(H=>D.call(x,k(H)),null,P))}s.map=o;function a(T,k){return c((D,x=null,P)=>T(H=>{k(H),D.call(x,H)},null,P))}s.forEach=a;function r(T,k){return c((D,x=null,P)=>T(H=>k(H)&&D.call(x,H),null,P))}s.filter=r;function n(T){return T}s.signal=n;function t(...T){return(k,D=null,x)=>Object(W.e)(...T.map(P=>P(H=>k.call(D,H),null,x)))}s.any=t;function v(T,k,D){let x=D;return o(T,P=>(x=k(x,P),x))}s.reduce=v;function c(T){let k;const D=new e({onFirstListenerAdd(){k=T(D.fire,D)},onLastListenerRemove(){k.dispose()}});return D.event}function p(T,k,D=100,x=!1,P){let H,I,V,$=0;const ge=new e({leakWarningThreshold:P,onFirstListenerAdd(){H=T(te=>{$++,I=k(I,te),x&&!V&&(ge.fire(I),I=void 0),clearTimeout(V),V=setTimeout(()=>{const be=I;I=void 0,V=void 0,(!x||$>1)&&ge.fire(be),$=0},D)})},onLastListenerRemove(){H.dispose()}});return ge.event}s.debounce=p;function b(T,k=(D,x)=>D===x){let D=!0,x;return r(T,P=>{const H=D||!k(P,x);return D=!1,x=P,H})}s.latch=b;function y(T,k){return[s.filter(T,k),s.filter(T,D=>!k(D))]}s.split=y;function d(T,k=!1,D=[]){let x=D.slice(),P=T(V=>{x?x.push(V):I.fire(V)});const H=()=>{x&&x.forEach(V=>I.fire(V)),x=null},I=new e({onFirstListenerAdd(){P||(P=T(V=>I.fire(V)))},onFirstListenerDidAdd(){x&&(k?setTimeout(H):H())},onLastListenerRemove(){P&&P.dispose(),P=null}});return I.event}s.buffer=d;class f{constructor(T){this.event=T}map(T){return new f(o(this.event,T))}forEach(T){return new f(a(this.event,T))}filter(T){return new f(r(this.event,T))}reduce(T,k){return new f(v(this.event,T,k))}latch(){return new f(b(this.event))}debounce(T,k=100,D=!1,x){return new f(p(this.event,T,k,D,x))}on(T,k,D){return this.event(T,k,D)}once(T,k,D){return i(this.event)(T,k,D)}}function m(T){return new f(T)}s.chain=m;function h(T,k,D=x=>x){const x=(...V)=>I.fire(D(...V)),P=()=>T.on(k,x),H=()=>T.removeListener(k,x),I=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return I.event}s.fromNodeEventEmitter=h;function E(T,k,D=x=>x){const x=(...V)=>I.fire(D(...V)),P=()=>T.addEventListener(k,x),H=()=>T.removeEventListener(k,x),I=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return I.event}s.fromDOMEventEmitter=E;function _(T){return new Promise(k=>i(T)(k))}s.toPromise=_})(S||(S={}));class O{constructor(s){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${s}_${O._idPool++}`}start(s){this._stopWatch=new N.a(!0),this._listenerCount=s}stop(){if(this._stopWatch){const s=this._stopWatch.elapsed();this._elapsedOverall+=s,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${s.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}O._idPool=0;let F=-1;class B{constructor(s,i=Math.random().toString(18).slice(2,5)){this.customThreshold=s,this.name=i,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(s){let i=F;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||s<i)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),a=this._stacks.get(o)||0;if(this._stacks.set(o,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let r,n=0;for(const[t,v]of this._stacks)(!r||n<v)&&(r=t,n=v);console.warn(`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${n}):`),console.warn(r)}return()=>{const r=this._stacks.get(o)||0;this._stacks.set(o,r-1)}}}class e{constructor(s){var i;this._disposed=!1,this._options=s,this._leakageMon=F>0?new B(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new O(this._options._profName):void 0}get event(){return this._event||(this._event=(s,i,o)=>{var a;this._listeners||(this._listeners=new R.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const n=this._listeners.push(i?[s,i]:s);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,s,i);const t=(a=this._leakageMon)===null||a===void 0?void 0:a.check(this._listeners.size),v=Object(W.i)(()=>{if(t&&t(),!this._disposed&&(n(),this._options&&this._options.onLastListenerRemove)){const c=this._listeners&&!this._listeners.isEmpty();c||this._options.onLastListenerRemove(this)}});return o instanceof W.b?o.add(v):Array.isArray(o)&&o.push(v),v}),this._event}fire(s){var i,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new R.a);for(let a of this._listeners)this._deliveryQueue.push([a,s]);for((i=this._perfMon)===null||i===void 0||i.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(n){Object(ue.f)(n)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var s,i,o,a,r;this._disposed||(this._disposed=!0,(s=this._listeners)===null||s===void 0||s.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(a=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||a===void 0||a.call(o),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class w extends e{constructor(s){super(s);this._isPaused=0,this._eventQueue=new R.a,this._mergeFn=s==null?void 0:s.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const s=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(s))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(s){this._listeners&&(this._isPaused!==0?this._eventQueue.push(s):super.fire(s))}}class g extends w{constructor(s){var i;super(s);this._delay=(i=s.delay)!==null&&i!==void 0?i:100}fire(s){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(s)}}class u{constructor(){this.buffers=[]}wrapEvent(s){return(i,o,a)=>s(r=>{const n=this.buffers[this.buffers.length-1];n?n.push(()=>i.call(o,r)):i.call(o,r)},void 0,a)}bufferEvents(s){const i=[];this.buffers.push(i);const o=s();return this.buffers.pop(),i.forEach(a=>a()),o}}class l{constructor(){this.listening=!1,this.inputEvent=S.None,this.inputEventListener=W.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(s){this.inputEvent=s,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=s(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ke,ye,j){"use strict";(function(ue,W){j.d(ye,"b",function(){return o}),j.d(ye,"i",function(){return t}),j.d(ye,"f",function(){return v}),j.d(ye,"d",function(){return c}),j.d(ye,"g",function(){return p}),j.d(ye,"h",function(){return b}),j.d(ye,"c",function(){return y}),j.d(ye,"k",function(){return d}),j.d(ye,"j",function(){return f}),j.d(ye,"a",function(){return m}),j.d(ye,"e",function(){return _});var R;const N="en";let S=!1,O=!1,F=!1,B=!1,e=!1,w=!1,g=!1,u,l=N,s,i;const o=typeof self=="object"?self:typeof ue=="object"?ue:{};let a;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?a=o.vscode.process:typeof W!="undefined"&&(a=W);const r=typeof((R=a==null?void 0:a.versions)===null||R===void 0?void 0:R.electron)=="string"&&a.type==="renderer";if(typeof navigator=="object"&&!r)i=navigator.userAgent,S=i.indexOf("Windows")>=0,O=i.indexOf("Macintosh")>=0,g=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,F=i.indexOf("Linux")>=0,w=!0,u=navigator.language,l=u;else if(typeof a=="object"){S=a.platform==="win32",O=a.platform==="darwin",F=a.platform==="linux",B=F&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,u=N,l=N;const T=a.env.VSCODE_NLS_CONFIG;if(T)try{const k=JSON.parse(T),D=k.availableLanguages["*"];u=k.locale,l=D||N,s=k._translationsConfigFile}catch(k){}e=!0}else console.error("Unable to resolve platform.");let n=0;O?n=1:S?n=3:F&&(n=2);const t=S,v=O,c=F,p=e,b=w,y=g,d=i,f=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let D=[];o.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let H=0,I=D.length;H<I;H++){const V=D[H];if(V.id===P.data.vscodeSetImmediateId){D.splice(H,1),V.callback();return}}});let x=0;return P=>{const H=++x;D.push({id:H,callback:P}),o.postMessage({vscodeSetImmediateId:H},"*")}}if(typeof(a==null?void 0:a.nextTick)=="function")return a.nextTick.bind(a);const k=Promise.resolve();return D=>k.then(D)}(),m=O||g?2:S?1:3;let h=!0,E=!1;function _(){if(!E){E=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2;const k=new Uint16Array(T.buffer);h=k[0]===(2<<8)+1}return h}}).call(this,j("IyRk"),j("Q2Ig"))},N0LK:function(Ke,ye,j){"use strict";j.d(ye,"C",function(){return ue}),j.d(ye,"v",function(){return R}),j.d(ye,"s",function(){return N}),j.d(ye,"t",function(){return S}),j.d(ye,"U",function(){return O}),j.d(ye,"J",function(){return F}),j.d(ye,"O",function(){return B}),j.d(ye,"p",function(){return e}),j.d(ye,"T",function(){return w}),j.d(ye,"q",function(){return g}),j.d(ye,"N",function(){return u}),j.d(ye,"M",function(){return l}),j.d(ye,"Q",function(){return s}),j.d(ye,"u",function(){return i}),j.d(ye,"x",function(){return o}),j.d(ye,"I",function(){return a}),j.d(ye,"f",function(){return r}),j.d(ye,"h",function(){return n}),j.d(ye,"g",function(){return t}),j.d(ye,"i",function(){return v}),j.d(ye,"G",function(){return c}),j.d(ye,"H",function(){return p}),j.d(ye,"r",function(){return b}),j.d(ye,"R",function(){return y}),j.d(ye,"d",function(){return d}),j.d(ye,"e",function(){return f}),j.d(ye,"E",function(){return m}),j.d(ye,"F",function(){return h}),j.d(ye,"j",function(){return E}),j.d(ye,"z",function(){return _}),j.d(ye,"K",function(){return k}),j.d(ye,"L",function(){return D}),j.d(ye,"m",function(){return P}),j.d(ye,"k",function(){return I}),j.d(ye,"A",function(){return $}),j.d(ye,"a",function(){return ge}),j.d(ye,"n",function(){return te}),j.d(ye,"l",function(){return be}),j.d(ye,"D",function(){return ve}),j.d(ye,"B",function(){return oe}),j.d(ye,"b",function(){return le}),j.d(ye,"S",function(){return _e}),j.d(ye,"o",function(){return ee}),j.d(ye,"P",function(){return L}),j.d(ye,"w",function(){return A}),j.d(ye,"c",function(){return C}),j.d(ye,"y",function(){return M});function ue(q){return!q||typeof q!="string"?!0:q.trim().length===0}const W=/{(\d+)}/g;function R(q,...ce){return ce.length===0?q:q.replace(W,function(Se,Ce){const Pe=parseInt(Ce,10);return isNaN(Pe)||Pe<0||Pe>=ce.length?Se:ce[Pe]})}function N(q){return q.replace(/[<>&]/g,function(ce){switch(ce){case"<":return"<";case">":return">";case"&":return"&";default:return ce}})}function S(q){return q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function O(q,ce=" "){const Se=F(q,ce);return B(Se,ce)}function F(q,ce){if(!q||!ce)return q;const Se=ce.length;if(Se===0||q.length===0)return q;let Ce=0;for(;q.indexOf(ce,Ce)===Ce;)Ce=Ce+Se;return q.substring(Ce)}function B(q,ce){if(!q||!ce)return q;const Se=ce.length,Ce=q.length;if(Se===0||Ce===0)return q;let Pe=Ce,Ne=-1;for(;!(Ne=q.lastIndexOf(ce,Pe-1),Ne===-1||Ne+Se!==Pe);){if(Ne===0)return"";Pe=Ne}return q.substring(0,Pe)}function e(q){return q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w(q){return q.replace(/\*/g,"")}function g(q,ce,Se={}){if(!q)throw new Error("Cannot create regex from empty string");ce||(q=S(q)),Se.wholeWord&&(/\B/.test(q.charAt(0))||(q="\\b"+q),/\B/.test(q.charAt(q.length-1))||(q=q+"\\b"));let Ce="";return Se.global&&(Ce+="g"),Se.matchCase||(Ce+="i"),Se.multiline&&(Ce+="m"),Se.unicode&&(Ce+="u"),new RegExp(q,Ce)}function u(q){if(q.source==="^"||q.source==="^$"||q.source==="$"||q.source==="^\\s*$")return!1;const ce=q.exec("");return!!(ce&&q.lastIndex===0)}function l(q){return(q.global?"g":"")+(q.ignoreCase?"i":"")+(q.multiline?"m":"")+(q.unicode?"u":"")}function s(q){return q.split(/\r\n|\r|\n/)}function i(q){for(let ce=0,Se=q.length;ce<Se;ce++){const Ce=q.charCodeAt(ce);if(Ce!==32&&Ce!==9)return ce}return-1}function o(q,ce=0,Se=q.length){for(let Ce=ce;Ce<Se;Ce++){const Pe=q.charCodeAt(Ce);if(Pe!==32&&Pe!==9)return q.substring(ce,Ce)}return q.substring(ce,Se)}function a(q,ce=q.length-1){for(let Se=ce;Se>=0;Se--){const Ce=q.charCodeAt(Se);if(Ce!==32&&Ce!==9)return Se}return-1}function r(q,ce){return q<ce?-1:q>ce?1:0}function n(q,ce,Se=0,Ce=q.length,Pe=0,Ne=ce.length){for(;Se<Ce&&Pe<Ne;Se++,Pe++){let He=q.charCodeAt(Se),We=ce.charCodeAt(Pe);if(He<We)return-1;if(He>We)return 1}const Ie=Ce-Se,Me=Ne-Pe;return Ie<Me?-1:Ie>Me?1:0}function t(q,ce){return v(q,ce,0,q.length,0,ce.length)}function v(q,ce,Se=0,Ce=q.length,Pe=0,Ne=ce.length){for(;Se<Ce&&Pe<Ne;Se++,Pe++){let He=q.charCodeAt(Se),We=ce.charCodeAt(Pe);if(He===We)continue;if(He>=128||We>=128)return n(q.toLowerCase(),ce.toLowerCase(),Se,Ce,Pe,Ne);c(He)&&(He-=32),c(We)&&(We-=32);const Ge=He-We;if(Ge===0)continue;return Ge}const Ie=Ce-Se,Me=Ne-Pe;return Ie<Me?-1:Ie>Me?1:0}function c(q){return q>=97&&q<=122}function p(q){return q>=65&&q<=90}function b(q,ce){return q.length===ce.length&&v(q,ce)===0}function y(q,ce){const Se=ce.length;return ce.length>q.length?!1:v(q,ce,0,Se)===0}function d(q,ce){let Se,Ce=Math.min(q.length,ce.length);for(Se=0;Se<Ce;Se++)if(q.charCodeAt(Se)!==ce.charCodeAt(Se))return Se;return Ce}function f(q,ce){let Se,Ce=Math.min(q.length,ce.length);const Pe=q.length-1,Ne=ce.length-1;for(Se=0;Se<Ce;Se++)if(q.charCodeAt(Pe-Se)!==ce.charCodeAt(Ne-Se))return Se;return Ce}function m(q){return 55296<=q&&q<=56319}function h(q){return 56320<=q&&q<=57343}function E(q,ce){return(q-55296<<10)+(ce-56320)+65536}function _(q,ce,Se){const Ce=q.charCodeAt(Se);if(m(Ce)&&Se+1<ce){const Pe=q.charCodeAt(Se+1);if(h(Pe))return E(Ce,Pe)}return Ce}function T(q,ce){const Se=q.charCodeAt(ce-1);if(h(Se)&&ce>1){const Ce=q.charCodeAt(ce-2);if(m(Ce))return E(Ce,Se)}return Se}function k(q,ce){const Se=U.getInstance(),Ce=ce,Pe=q.length,Ne=_(q,Pe,ce);ce+=Ne>=65536?2:1;let Ie=Se.getGraphemeBreakType(Ne);for(;ce<Pe;){const Me=_(q,Pe,ce),He=Se.getGraphemeBreakType(Me);if(C(Ie,He))break;ce+=Me>=65536?2:1,Ie=He}return ce-Ce}function D(q,ce){const Se=U.getInstance(),Ce=ce,Pe=T(q,ce);ce-=Pe>=65536?2:1;let Ne=Se.getGraphemeBreakType(Pe);for(;ce>0;){const Ie=T(q,ce),Me=Se.getGraphemeBreakType(Ie);if(C(Me,Ne))break;ce-=Ie>=65536?2:1,Ne=Me}return Ce-ce}const x=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function P(q){return x.test(q)}const H=/(?:[\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 I(q){return H.test(q)}const V=/^[\t\n\r\x20-\x7E]*$/;function $(q){return V.test(q)}const ge=/[\u2028\u2029]/;function te(q){return ge.test(q)}function be(q){for(let ce=0,Se=q.length;ce<Se;ce++)if(ve(q.charCodeAt(ce)))return!0;return!1}function ve(q){return q=+q,q>=11904&&q<=55215||q>=63744&&q<=64255||q>=65281&&q<=65374}function oe(q){return q>=127462&&q<=127487||q===8986||q===8987||q===9200||q===9203||q>=9728&&q<=10175||q===11088||q===11093||q>=127744&&q<=128591||q>=128640&&q<=128764||q>=128992&&q<=129003||q>=129280&&q<=129535||q>=129648&&q<=129750}const le=String.fromCharCode(65279);function _e(q){return!!(q&&q.length>0&&q.charCodeAt(0)===65279)}function ee(q,ce=!1){return q?(ce&&(q=q.replace(/\\./g,"")),q.toLowerCase()!==q):!1}function L(q){const ce=90-65+1;return q=q%(2*ce),q<ce?String.fromCharCode(97+q):String.fromCharCode(65+q-ce)}function A(q){const ce=U.getInstance();return ce.getGraphemeBreakType(q)}function C(q,ce){return q===0?ce!==5&&ce!==7:q===2&&ce===3?!1:q===4||q===2||q===3||(ce===4||ce===2||ce===3)?!0:q===8&&(ce===8||ce===9||ce===11||ce===12)||((q===11||q===9)&&(ce===9||ce===10)||((q===12||q===10)&&ce===10||(ce===5||ce===13||(ce===7||(q===1||q===13&&ce===14)))))?!1:!(q===6&&ce===6)}class U{constructor(){this._data=K()}static getInstance(){return U._INSTANCE||(U._INSTANCE=new U),U._INSTANCE}getGraphemeBreakType(q){if(q<32)return q===10?3:q===13?2:4;if(q<127)return 0;const ce=this._data,Se=ce.length/3;let Ce=1;for(;Ce<=Se;)if(q<ce[3*Ce])Ce=2*Ce;else if(q>ce[3*Ce+1])Ce=2*Ce+1;else return ce[3*Ce+2];return 0}}U._INSTANCE=null;function K(){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 M(q,ce){if(q===0)return 0;const Se=ie(q,ce);if(Se!==void 0)return Se;const Ce=T(ce,q);return q-=Ee(Ce),q}function ie(q,ce){let Se=T(ce,q);for(q-=Ee(Se);Oe(Se)||Se===65039||Se===8419;){if(q===0)return;Se=T(ce,q),q-=Ee(Se)}if(!oe(Se))return;if(q>=0){const Ce=T(ce,q);Ce===8205&&(q-=Ee(Ce))}return q}function Ee(q){return q>=65536?2:1}function Oe(q){return 127995<=q&&q<=127999}},NvD2:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return O});var ue=j("Kwbf");function W(F,B){var e=new Set;return F.forEach(function(w){B.has(w)||e.add(w)}),e}function R(F){var B=F||{},e=B.disabled,w=B.disableCheckbox,g=B.checkable;return!!(e||w)||g===!1}function N(F,B,e,w){for(var g=new Set(F),u=new Set,l=0;l<=e;l+=1){var s=B.get(l)||new Set;s.forEach(function(r){var n=r.key,t=r.node,v=r.children,c=v===void 0?[]:v;g.has(n)&&!w(t)&&c.filter(function(p){return!w(p.node)}).forEach(function(p){g.add(p.key)})})}for(var i=new Set,o=e;o>=0;o-=1){var a=B.get(o)||new Set;a.forEach(function(r){var n=r.parent,t=r.node;if(w(t)||!r.parent||i.has(r.parent.key))return;if(w(r.parent.node)){i.add(n.key);return}var v=!0,c=!1;(n.children||[]).filter(function(p){return!w(p.node)}).forEach(function(p){var b=p.key,y=g.has(b);v&&!y&&(v=!1),!c&&(y||u.has(b))&&(c=!0)}),v&&g.add(n.key),c&&u.add(n.key),i.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(W(u,g))}}function S(F,B,e,w,g){for(var u=new Set(F),l=new Set(B),s=0;s<=w;s+=1){var i=e.get(s)||new Set;i.forEach(function(n){var t=n.key,v=n.node,c=n.children,p=c===void 0?[]:c;!u.has(t)&&!l.has(t)&&!g(v)&&p.filter(function(b){return!g(b.node)}).forEach(function(b){u.delete(b.key)})})}l=new Set;for(var o=new Set,a=w;a>=0;a-=1){var r=e.get(a)||new Set;r.forEach(function(n){var t=n.parent,v=n.node;if(g(v)||!n.parent||o.has(n.parent.key))return;if(g(n.parent.node)){o.add(t.key);return}var c=!0,p=!1;(t.children||[]).filter(function(b){return!g(b.node)}).forEach(function(b){var y=b.key,d=u.has(y);c&&!d&&(c=!1),!p&&(d||l.has(y))&&(p=!0)}),c||u.delete(t.key),p&&l.add(t.key),o.add(t.key)})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(W(l,u))}}function O(F,B,e,w){var g=[],u;w?u=w:u=R;var l=new Set(F.filter(function(a){var r=!!e[a];return r||g.push(a),r})),s=new Map,i=0;Object.keys(e).forEach(function(a){var r=e[a],n=r.level,t=s.get(n);t||(t=new Set,s.set(n,t)),t.add(r),i=Math.max(i,n)}),Object(ue.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var o;return B===!0?o=N(l,s,i,u):o=S(l,B.halfCheckedKeys,s,i,u),o}},OZM5:function(Ke,ye,j){"use strict";j.d(ye,"b",function(){return w}),j.d(ye,"a",function(){return g}),j.d(ye,"k",function(){return u}),j.d(ye,"h",function(){return l}),j.d(ye,"i",function(){return s}),j.d(ye,"g",function(){return i}),j.d(ye,"c",function(){return o}),j.d(ye,"d",function(){return a}),j.d(ye,"j",function(){return t}),j.d(ye,"e",function(){return v}),j.d(ye,"f",function(){return c});var ue=j("KQm4"),W=j("U8pU"),R=j("Ff2n"),N=j("q1tI"),S=j.n(N),O=j("Kwbf"),F=j("WaYH"),B=.25,e=2;function w(p,b){var y=p.slice(),d=y.indexOf(b);return d>=0&&y.splice(d,1),y}function g(p,b){var y=p.slice();return y.indexOf(b)===-1&&y.push(b),y}function u(p){return p.split("-")}function l(p,b){return"".concat(p,"-").concat(b)}function s(p){return p&&p.type&&p.type.isTreeNode}function i(p,b){var y=[p],d=b[p];function f(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach(function(h){var E=h.key,_=h.children;y.push(E),f(_)})}return f(d.children),y}function o(p,b){var y=p.clientY,d=b.selectHandle.getBoundingClientRect(),f=d.top,m=d.bottom,h=d.height,E=Math.max(h*B,e);return y<=f+E?-1:y>=m-E?1:0}function a(p,b){if(!p)return;var y=b.multiple;return y?p.slice():p.length?[p[0]]:p}var r=function(b){return b};function n(p,b){if(!p)return[];var y=b||{},d=y.processProps,f=d===void 0?r:d,m=Array.isArray(p)?p:[p];return m.map(function(h){var E=h.children,_=Object(R.a)(h,["children"]),T=n(E,b);return S.a.createElement(F.a,Object.assign({},f(_)),T)})}function t(p){if(!p)return null;var b;if(Array.isArray(p))b={checkedKeys:p,halfCheckedKeys:void 0};else if(Object(W.a)(p)==="object")b={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return b}function v(p,b){var y=new Set;function d(f){if(y.has(f))return;var m=b[f];if(!m)return;y.add(f);var h=m.parent,E=m.node;if(E.disabled)return;h&&d(h.key)}return(p||[]).forEach(function(f){d(f)}),Object(ue.a)(y)}function c(p){var b={};return Object.keys(p).forEach(function(y){(y.startsWith("data-")||y.startsWith("aria-"))&&(b[y]=p[y])}),b}},"P/tu":function(Ke,ye,j){"use strict";var ue=j("ozfa"),W=j("MJZm"),R=j("0Owb"),N=j("9og8"),S=j("tJVT"),O=j("PpiC"),F=j("WmNS"),B=j.n(F),e=j("q1tI"),w=j.n(e),g=j("WCUW"),u=j("spXi"),l=j.n(u),s=function(o){var a=o.value,r=o.onChange,n=o.defaultValue,t=o.disabled,v=Object(O.a)(o,["value","onChange","defaultValue","disabled"]),c=Object(e.useState)([]),p=Object(S.a)(c,2),b=p[0],y=p[1],d=Object(e.useState)("1"),f=Object(S.a)(d,2),m=f[0],h=f[1];Object(e.useEffect)(function(){E()},[]);var E=function(){var k=Object(N.a)(B.a.mark(function D(){var x,P;return B.a.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Object(g.A)({});case 2:x=I.sent,x!=null&&x.data&&(P=[{title:w.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:l.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:w.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:_(x.data||[])}],y(P),h("2"));case 4:case"end":return I.stop()}},D)}));return function(){return k.apply(this,arguments)}}(),_=function(D){function x(P){var H=P.children,I=Array.isArray(H)&&H.length>0,V=P==null?void 0:P.group_id;return{title:w.a.createElement("div",{title:P==null?void 0:P.name,className:l.a.name},P==null?void 0:P.name),value:V,key:V,icon:w.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:I?H==null?void 0:H.map(function($){return x($)}):[]}}return D==null?void 0:D.map(function(P){return x(P)})},T=n?{defaultExpandedKeys:[0]}:{selectedKeys:a,defaultExpandedKeys:a};return w.a.createElement("div",{className:l.a.customTree},w.a.createElement(W.a,Object(R.a)({key:m},T,{showIcon:!0,treeData:b,onSelect:r,disabled:t},v)))};ye.a=s},Q0Vu:function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(Ke,ye,j){"use strict";var ue=j("Q9mQ"),W=j("diRs"),R=j("q1tI"),N=j.n(R),S=j("+z73"),O=j.n(S),F=function(e){var w=e.data,g=w===void 0?[]:w,u=e.onClick,l=function(){return g.map(function(o,a){return N.a.createElement("div",{key:a,className:O.a.few},N.a.createElement("b",{title:o.name,style:{color:a===0?"#333333":"#999999"},onClick:function(){return u(o.id)}},o.name),a<g.length-1&&N.a.createElement("span",null,"/"))})},s=function(){var o=!0,a=g.slice(2,-2),r=N.a.createElement("div",{className:O.a.pWrap},a.map(function(n){return N.a.createElement("span",{title:n.name,onClick:function(){return u(n.id)},key:n.id},n.name)}));return g.map(function(n,t){var v=null;return t>1&&t<g.length-2?o&&(v=N.a.createElement(W.a,{key:t,placement:"bottom",content:r},N.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),o=!1):v=N.a.createElement("div",{key:t,className:O.a.few},N.a.createElement("b",{title:n.name,style:{color:t===0?"#333333":"#999999"},onClick:function(){return u(n.id)}},n.name),t<g.length-1&&N.a.createElement("span",null,"/")),v})};return N.a.createElement("aside",{style:{overflowX:"auto"}},(g==null?void 0:g.length)>5?s():l())};ye.a=F},SJMd:function(Ke,ye){/**
|
|
* @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 j,ue,W,R=!1,N,S;window.PR_SHOULD_USE_CONTINUATION=!0;var O,F;(function(){var B=window,e=["break,continue,do,else,for,if,return,while"],w=[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"],g=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],u=[g,"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=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[g,"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"],i="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",o=[g,"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"],n=[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"],v=[u,s,l,o,a,r,n,t],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",b="kwd",y="com",d="typ",f="lit",m="pun",h="pln",E="tag",_="dec",T="src",k="atn",D="atv",x="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(ie){for(var Ee=0,Oe=!1,q=!1,ce=0,Se=ie.length;ce<Se;++ce){var Ce=ie[ce];if(Ce.ignoreCase)q=!0;else if(/[a-z]/i.test(Ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Oe=!0,q=!1;break}}var Pe={b:8,t:9,n:10,v:11,f:12,r:13};function Ne(Ge){var Be=Ge.charCodeAt(0);if(Be!==92)return Be;var Xe=Ge.charAt(1);return Be=Pe[Xe],Be||("0"<=Xe&&Xe<="7"?parseInt(Ge.substring(1),8):Xe==="u"||Xe==="x"?parseInt(Ge.substring(2),16):Ge.charCodeAt(1))}function Ie(Ge){if(Ge<32)return(Ge<16?"\\x0":"\\x")+Ge.toString(16);var Be=String.fromCharCode(Ge);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Me(Ge){var Be=Ge.substring(1,Ge.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")),Xe=[],Ye=Be[0]==="^",ne=["["];Ye&&ne.push("^");for(var z=Ye?1:0,G=Be.length;z<G;++z){var J=Be[z];if(/\\[bdsw]/i.test(J))ne.push(J);else{var re=Ne(J),Y;z+2<G&&Be[z+1]==="-"?(Y=Ne(Be[z+2]),z+=2):Y=re,Xe.push([re,Y]),Y<65||re>122||(Y<65||re>90||Xe.push([Math.max(65,re)|32,Math.min(Y,90)|32]),Y<97||re>122||Xe.push([Math.max(97,re)&~32,Math.min(Y,122)&~32]))}}Xe.sort(function(De,Re){return De[0]-Re[0]||Re[1]-De[1]});for(var Z=[],se=[],z=0;z<Xe.length;++z){var he=Xe[z];he[0]<=se[1]+1?se[1]=Math.max(se[1],he[1]):Z.push(se=he)}for(var z=0;z<Z.length;++z){var he=Z[z];ne.push(Ie(he[0])),he[1]>he[0]&&(he[1]+1>he[0]&&ne.push("-"),ne.push(Ie(he[1])))}return ne.push("]"),ne.join("")}function He(Ge){for(var Be=Ge.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")),Xe=Be.length,Ye=[],ne=0,z=0;ne<Xe;++ne){var G=Be[ne];if(G==="(")++z;else if(G.charAt(0)==="\\"){var J=+G.substring(1);J&&(J<=z?Ye[J]=-1:Be[ne]=Ie(J))}}for(var ne=1;ne<Ye.length;++ne)Ye[ne]===-1&&(Ye[ne]=++Ee);for(var ne=0,z=0;ne<Xe;++ne){var G=Be[ne];if(G==="(")++z,Ye[z]||(Be[ne]="(?:");else if(G.charAt(0)==="\\"){var J=+G.substring(1);J&&J<=z&&(Be[ne]="\\"+Ye[J])}}for(var ne=0;ne<Xe;++ne)Be[ne]==="^"&&Be[ne+1]!=="^"&&(Be[ne]="");if(Ge.ignoreCase&&Oe)for(var ne=0;ne<Xe;++ne){var G=Be[ne],re=G.charAt(0);G.length>=2&&re==="["?Be[ne]=Me(G):re!=="\\"&&(Be[ne]=G.replace(/[a-zA-Z]/g,function(se){var he=se.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Be.join("")}for(var We=[],ce=0,Se=ie.length;ce<Se;++ce){var Ce=ie[ce];if(Ce.global||Ce.multiline)throw new Error(""+Ce);We.push("(?:"+He(Ce)+")")}return new RegExp(We.join("|"),q?"gi":"g")}function I(ie,Ee){var Oe=/(?:^|\s)nocode(?:\s|$)/,q=[],ce=0,Se=[],Ce=0;function Pe(Ne){var Ie=Ne.nodeType;if(Ie==1){if(Oe.test(Ne.className))return;for(var Me=Ne.firstChild;Me;Me=Me.nextSibling)Pe(Me);var He=Ne.nodeName.toLowerCase();(He==="br"||He==="li")&&(q[Ce]=`
|
|
`,Se[Ce<<1]=ce++,Se[Ce++<<1|1]=Ne)}else if(Ie==3||Ie==4){var We=Ne.nodeValue;We.length&&(Ee?We=We.replace(/\r\n?/g,`
|
|
`):We=We.replace(/[ \t\r\n]+/g," "),q[Ce]=We,Se[Ce<<1]=ce,ce+=We.length,Se[Ce++<<1|1]=Ne)}}return Pe(ie),{sourceCode:q.join("").replace(/\n$/,""),spans:Se}}function V(ie,Ee,Oe,q,ce){if(!Oe)return;var Se={sourceNode:ie,pre:1,langExtension:null,numberLines:null,sourceCode:Oe,spans:null,basePos:Ee,decorations:null};q(Se),ce.push.apply(ce,Se.decorations)}var $=/\S/;function ge(ie){for(var Ee=void 0,Oe=ie.firstChild;Oe;Oe=Oe.nextSibling){var q=Oe.nodeType;Ee=q===1?Ee?ie:Oe:q===3&&$.test(Oe.nodeValue)?ie:Ee}return Ee===ie?void 0:Ee}function te(ie,Ee){var Oe={},q;(function(){for(var Ce=ie.concat(Ee),Pe=[],Ne={},Ie=0,Me=Ce.length;Ie<Me;++Ie){var He=Ce[Ie],We=He[3];if(We)for(var Ge=We.length;--Ge>=0;)Oe[We.charAt(Ge)]=He;var Be=He[1],Xe=""+Be;Ne.hasOwnProperty(Xe)||(Pe.push(Be),Ne[Xe]=null)}Pe.push(/[\0-\uffff]/),q=H(Pe)})();var ce=Ee.length,Se=function(Ce){for(var Pe=Ce.sourceCode,Ne=Ce.basePos,Ie=Ce.sourceNode,Me=[Ne,h],He=0,We=Pe.match(q)||[],Ge={},Be=0,Xe=We.length;Be<Xe;++Be){var Ye=We[Be],ne=Ge[Ye],z=void 0,G;if(typeof ne=="string")G=!1;else{var J=Oe[Ye.charAt(0)];if(J)z=Ye.match(J[1]),ne=J[0];else{for(var re=0;re<ce;++re)if(J=Ee[re],z=Ye.match(J[1]),z){ne=J[0];break}z||(ne=h)}G=ne.length>=5&&ne.substring(0,5)==="lang-",G&&!(z&&typeof z[1]=="string")&&(G=!1,ne=T),G||(Ge[Ye]=ne)}var Y=He;if(He+=Ye.length,!G)Me.push(Ne+Y,ne);else{var Z=z[1],se=Ye.indexOf(Z),he=se+Z.length;z[2]&&(he=Ye.length-z[2].length,se=he-Z.length);var De=ne.substring(5);V(Ie,Ne+Y,Ye.substring(0,se),Se,Me),V(Ie,Ne+Y+se,Z,L(De,Z),Me),V(Ie,Ne+Y+he,Ye.substring(he),Se,Me)}}Ce.decorations=Me};return Se}function be(ie){var Ee=[],Oe=[];ie.tripleQuotedStrings?Ee.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ie.multiLineStrings?Ee.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ie.verbatimStrings&&Oe.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var q=ie.hashComments;q&&(ie.cStyleComments?(q>1?Ee.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Oe.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([y,/^#[^\r\n]*/,null,"#"])),ie.cStyleComments&&(Oe.push([y,/^\/\/[^\r\n]*/,null]),Oe.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ce=ie.regexLiterals;if(ce){var Se=ce>1?"":`
|
|
\r`,Ce=Se?".":"[\\S\\s]",Pe="/(?=[^/*"+Se+"])(?:[^/\\x5B\\x5C"+Se+"]|\\x5C"+Ce+"|\\x5B(?:[^\\x5C\\x5D"+Se+"]|\\x5C"+Ce+")*(?:\\x5D|$))+/";Oe.push(["lang-regex",RegExp("^"+P+"("+Pe+")")])}var Ne=ie.types;Ne&&Oe.push([d,Ne]);var Ie=(""+ie.keywords).replace(/^ | $/g,"");Ie.length&&Oe.push([b,new RegExp("^(?:"+Ie.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var Me="^.[^\\s\\w.$@'\"`/\\\\]*";return ie.regexLiterals&&(Me+="(?!s*/)"),Oe.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[d,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[m,new RegExp(Me),null]),te(Ee,Oe)}var ve=be({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function oe(ie,Ee,Oe){for(var q=/(?:^|\s)nocode(?:\s|$)/,ce=/\r\n?|\n/,Se=ie.ownerDocument,Ce=Se.createElement("li");ie.firstChild;)Ce.appendChild(ie.firstChild);var Pe=[Ce];function Ne(Be){var Xe=Be.nodeType;if(Xe==1&&!q.test(Be.className))if(Be.nodeName==="br")Ie(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var Ye=Be.firstChild;Ye;Ye=Ye.nextSibling)Ne(Ye);else if((Xe==3||Xe==4)&&Oe){var ne=Be.nodeValue,z=ne.match(ce);if(z){var G=ne.substring(0,z.index);Be.nodeValue=G;var J=ne.substring(z.index+z[0].length);if(J){var re=Be.parentNode;re.insertBefore(Se.createTextNode(J),Be.nextSibling)}Ie(Be),G||Be.parentNode.removeChild(Be)}}}function Ie(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function Xe(z,G){var J=G?z.cloneNode(!1):z,re=z.parentNode;if(re){var Y=Xe(re,1),Z=z.nextSibling;Y.appendChild(J);for(var se=Z;se;se=Z)Z=se.nextSibling,Y.appendChild(se)}return J}for(var Ye=Xe(Be.nextSibling,0),ne;(ne=Ye.parentNode)&&ne.nodeType===1;)Ye=ne;Pe.push(Ye)}for(var Me=0;Me<Pe.length;++Me)Ne(Pe[Me]);Ee===(Ee|0)&&Pe[0].setAttribute("value",Ee);var He=Se.createElement("ol");He.className="linenums";for(var We=Math.max(0,Ee-1|0)||0,Me=0,Ge=Pe.length;Me<Ge;++Me)Ce=Pe[Me],Ce.className="L"+(Me+We)%10,Ce.firstChild||Ce.appendChild(Se.createTextNode("\xA0")),He.appendChild(Ce);ie.appendChild(He)}function le(ie){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Oe=/\n/g,q=ie.sourceCode,ce=q.length,Se=0,Ce=ie.spans,Pe=Ce.length,Ne=0,Ie=ie.decorations,Me=Ie.length,He=0;Ie[Me]=ce;var We,Ge;for(Ge=We=0;Ge<Me;)Ie[Ge]!==Ie[Ge+2]?(Ie[We++]=Ie[Ge++],Ie[We++]=Ie[Ge++]):Ge+=2;for(Me=We,Ge=We=0;Ge<Me;){for(var Be=Ie[Ge],Xe=Ie[Ge+1],Ye=Ge+2;Ye+2<=Me&&Ie[Ye+1]===Xe;)Ye+=2;Ie[We++]=Be,Ie[We++]=Xe,Ge=Ye}Me=Ie.length=We;var ne=ie.sourceNode,z="";ne&&(z=ne.style.display,ne.style.display="none");try{for(var G=null;Ne<Pe;){var J=Ce[Ne],re=Ce[Ne+2]||ce,Y=Ie[He+2]||ce,Ye=Math.min(re,Y),Z=Ce[Ne+1],se;if(Z.nodeType!==1&&(se=q.substring(Se,Ye))){Ee&&(se=se.replace(Oe,"\r")),Z.nodeValue=se;var he=Z.ownerDocument,De=he.createElement("span");De.className=Ie[He+1];var Re=Z.parentNode;Re.replaceChild(De,Z),De.appendChild(Z),Se<re&&(Ce[Ne+1]=Z=he.createTextNode(q.substring(Ye,re)),Re.insertBefore(Z,De.nextSibling))}Se=Ye,Se>=re&&(Ne+=2),Se>=Y&&(He+=2)}}finally{ne&&(ne.style.display=z)}}var _e={};function ee(ie,Ee){for(var Oe=Ee.length;--Oe>=0;){var q=Ee[Oe];_e.hasOwnProperty(q)?B.console&&console.warn("cannot override language handler %s",q):_e[q]=ie}}function L(ie,Ee){return ie&&_e.hasOwnProperty(ie)||(ie=/^\s*</.test(Ee)?"default-markup":"default-code"),_e[ie]}ee(ve,["default-code"]),ee(te([],[[h,/^[^<?]+/],[_,/^<!\w[^>]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[m,/^(?:<[%?]|[%?]>)/],["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(te([[h,/^[\s]+/,null,` \r
|
|
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[m,/^[=<>\/]+/],["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(te([],[[D,/^[\s\S]+/]]),["uq.val"]),ee(be({keywords:u,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),ee(be({keywords:"null,true,false"}),["json"]),ee(be({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),ee(be({keywords:l,cStyleComments:!0}),["java"]),ee(be({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(be({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(be({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(be({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(be({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(be({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(te([],[[p,/^[\s\S]+/]]),["regex"]);function A(ie){var Ee=ie.langExtension;try{var Oe=I(ie.sourceNode,ie.pre),q=Oe.sourceCode;ie.sourceCode=q,ie.spans=Oe.spans,ie.basePos=0,L(Ee,q)(ie),le(ie)}catch(ce){B.console&&console.log(ce&&ce.stack||ce)}}function C(ie,Ee,Oe){var q=Oe||!1,ce=Ee||null,Se=document.createElement("div");Se.innerHTML="<pre>"+ie+"</pre>",Se=Se.firstChild,q&&oe(Se,q,!0);var Ce={langExtension:ce,numberLines:q,sourceNode:Se,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return A(Ce),Se.innerHTML}function U(ie,Ee){var Oe=Ee||document.body,q=Oe.ownerDocument||document;function ce(J){return Oe.getElementsByTagName(J)}for(var Se=[ce("pre"),ce("code"),ce("xmp")],Ce=[],Pe=0;Pe<Se.length;++Pe)for(var Ne=0,Ie=Se[Pe].length;Ne<Ie;++Ne)Ce.push(Se[Pe][Ne]);Se=null;var Me=Date;Me.now||(Me={now:function(){return+new Date}});var He=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ge=/\bprettyprint\b/,Be=/\bprettyprinted\b/,Xe=/pre|xmp/i,Ye=/^code$/i,ne=/^(?:pre|code|xmp)$/i,z={};function G(){for(var J=B.PR_SHOULD_USE_CONTINUATION?Me.now()+250:Infinity;He<Ce.length&&Me.now()<J;He++){for(var re=Ce[He],Y=z,Z=re;Z=Z.previousSibling;){var se=Z.nodeType,he=(se===7||se===8)&&Z.nodeValue;if(he?!/^\??prettify\b/.test(he):se!==3||/\S/.test(Z.nodeValue))break;if(he){Y={},he.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,ot,jt){Y[ot]=jt});break}}var De=re.className;if((Y!==z||Ge.test(De))&&!Be.test(De)){for(var Re=!1,Ue=re.parentNode;Ue;Ue=Ue.parentNode){var Ve=Ue.tagName;if(ne.test(Ve)&&Ue.className&&Ge.test(Ue.className)){Re=!0;break}}if(!Re){re.className+=" prettyprinted";var Je=Y.lang;if(!Je){Je=De.match(We);var Qe;!Je&&(Qe=ge(re))&&Ye.test(Qe.tagName)&&(Je=Qe.className.match(We)),Je&&(Je=Je[1])}var ht;if(Xe.test(re.tagName))ht=1;else{var st=re.currentStyle,qe=q.defaultView,Ut=st?st.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle(re,null).getPropertyValue("white-space"):0;ht=Ut&&Ut.substring(0,3)==="pre"}var Et=Y.linenums;(Et=Et==="true"||+Et)||(Et=De.match(/\blinenums\b(?::(\d+))?/),Et=Et?Et[1]&&Et[1].length?+Et[1]:!0:!1),Et&&oe(re,Et,ht);var Ft={langExtension:Je,sourceNode:re,numberLines:Et,pre:ht,sourceCode:null,basePos:null,spans:null,decorations:null};A(Ft)}}}He<Ce.length?B.setTimeout(G,250):typeof ie=="function"&&ie()}G()}var K=B.PR={createSimpleLexer:te,registerLangHandler:ee,sourceDecorator:be,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:D,PR_COMMENT:y,PR_DECLARATION:_,PR_KEYWORD:b,PR_LITERAL:f,PR_NOCODE:x,PR_PLAIN:h,PR_PUNCTUATION:m,PR_SOURCE:T,PR_STRING:p,PR_TAG:E,PR_TYPE:d,prettyPrintOne:R?B.prettyPrintOne=C:O=C,prettyPrint:F=R?B.prettyPrint=U:F=U},M=B.define;typeof M=="function"&&M.amd&&M("google-code-prettify",[],function(){return K})})()},STEk:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return ee});/*! *****************************************************************************
|
|
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 ue=function(L,A){return(ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,U){C.__proto__=U}||function(C,U){for(var K in U)Object.prototype.hasOwnProperty.call(U,K)&&(C[K]=U[K])})(L,A)};function W(L,A){function C(){this.constructor=L}ue(L,A),L.prototype=A===null?Object.create(A):(C.prototype=A.prototype,new C)}function R(L,A,C,U){return new(C||(C=Promise))(function(K,M){function ie(q){try{Oe(U.next(q))}catch(ce){M(ce)}}function Ee(q){try{Oe(U.throw(q))}catch(ce){M(ce)}}function Oe(q){var ce;q.done?K(q.value):(ce=q.value,ce instanceof C?ce:new C(function(Se){Se(ce)})).then(ie,Ee)}Oe((U=U.apply(L,A||[])).next())})}function N(L,A){var C,U,K,M,ie={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return M={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function Ee(Oe){return function(q){return function(ce){if(C)throw new TypeError("Generator is already executing.");for(;ie;)try{if(C=1,U&&(K=2&ce[0]?U.return:ce[0]?U.throw||((K=U.return)&&K.call(U),0):U.next)&&!(K=K.call(U,ce[1])).done)return K;switch(U=0,K&&(ce=[2&ce[0],K.value]),ce[0]){case 0:case 1:K=ce;break;case 4:return ie.label++,{value:ce[1],done:!1};case 5:ie.label++,U=ce[1],ce=[0];continue;case 7:ce=ie.ops.pop(),ie.trys.pop();continue;default:if(!(K=ie.trys,(K=K.length>0&&K[K.length-1])||ce[0]!==6&&ce[0]!==2)){ie=0;continue}if(ce[0]===3&&(!K||ce[1]>K[0]&&ce[1]<K[3])){ie.label=ce[1];break}if(ce[0]===6&&ie.label<K[1]){ie.label=K[1],K=ce;break}if(K&&ie.label<K[2]){ie.label=K[2],ie.ops.push(ce);break}K[2]&&ie.ops.pop(),ie.trys.pop();continue}ce=A.call(L,ie)}catch(Se){ce=[6,Se],U=0}finally{C=K=0}if(5&ce[0])throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}([Oe,q])}}}function S(){for(var L=0,A=0,C=arguments.length;A<C;A++)L+=arguments[A].length;var U=Array(L),K=0;for(A=0;A<C;A++)for(var M=arguments[A],ie=0,Ee=M.length;ie<Ee;ie++,K++)U[K]=M[ie];return U}var O=function(){function L(){}return L.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},L.setAttributes=function(A,C){for(var U=0,K=C;U<K.length;U++){var M=K[U],ie=M[0],Ee=M[1];A.setAttribute(ie,Ee)}},L.createRect=function(A,C,U){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",A.toString()),K.setAttribute("height",C.toString()),U&&L.setAttributes(K,U),K},L.createLine=function(A,C,U,K,M){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",A.toString()),ie.setAttribute("y1",C.toString()),ie.setAttribute("x2",U.toString()),ie.setAttribute("y2",K.toString()),M&&L.setAttributes(ie,M),ie},L.createPolygon=function(A,C){var U=document.createElementNS("http://www.w3.org/2000/svg","polygon");return U.setAttribute("points",A),C&&L.setAttributes(U,C),U},L.createCircle=function(A,C){var U=document.createElementNS("http://www.w3.org/2000/svg","circle");return U.setAttribute("cx",(A/2).toString()),U.setAttribute("cy",(A/2).toString()),U.setAttribute("r",A.toString()),C&&L.setAttributes(U,C),U},L.createEllipse=function(A,C,U){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(A/2).toString()),K.setAttribute("cy",(C/2).toString()),K.setAttribute("rx",(A/2).toString()),K.setAttribute("ry",(C/2).toString()),U&&L.setAttributes(K,U),K},L.createGroup=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return A&&L.setAttributes(C,A),C},L.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},L.createMarker=function(A,C,U,K,M,ie,Ee){var Oe=document.createElementNS("http://www.w3.org/2000/svg","marker");return L.setAttributes(Oe,[["id",A],["orient",C],["markerWidth",U.toString()],["markerHeight",K.toString()],["refX",M.toString()],["refY",ie.toString()]]),Oe.appendChild(Ee),Oe},L.createText=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),A&&L.setAttributes(C,A),C},L.createTSpan=function(A,C){var U=document.createElementNS("http://www.w3.org/2000/svg","tspan");return U.textContent=A,C&&L.setAttributes(U,C),U},L.createImage=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return A&&L.setAttributes(C,A),C},L.createPoint=function(A,C){var U=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return U.x=A,U.y=C,U},L.createPath=function(A,C){var U=document.createElementNS("http://www.w3.org/2000/svg","path");return U.setAttribute("d",A),C&&L.setAttributes(U,C),U},L}(),F=function(){function L(){}return L.addKey=function(A){L.key=A},Object.defineProperty(L,"isLicensed",{get:function(){return!!L.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(L.key)},enumerable:!1,configurable:!0}),L}(),B=function(){function L(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return L.prototype.rasterize=function(A,C,U){var K=this;return new Promise(function(M){var ie=U!==void 0?U:document.createElement("canvas");A===null&&(K.markersOnly=!0,K.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",C.width.baseVal.valueAsString),Ee.setAttribute("height",C.height.baseVal.valueAsString),Ee.setAttribute("viewBox","0 0 "+C.viewBox.baseVal.width.toString()+" "+C.viewBox.baseVal.height.toString()),Ee.innerHTML=C.innerHTML,K.naturalSize===!0?(Ee.width.baseVal.value=A.naturalWidth,Ee.height.baseVal.value=A.naturalHeight):K.width!==void 0&&K.height!==void 0&&(Ee.width.baseVal.value=K.width,Ee.height.baseVal.value=K.height),ie.width=Ee.width.baseVal.value,ie.height=Ee.height.baseVal.value;var Oe=Ee.outerHTML,q=ie.getContext("2d");K.markersOnly!==!0&&q.drawImage(A,0,0,ie.width,ie.height);var ce=window.URL,Se=new Image(ie.width,ie.height);Se.setAttribute("crossOrigin","anonymous");var Ce=new Blob([Oe],{type:"image/svg+xml"}),Pe=ce.createObjectURL(Ce);Se.onload=function(){q.drawImage(Se,0,0),ce.revokeObjectURL(Pe);var Ne=ie.toDataURL(K.imageType,K.imageQuality);M(Ne)},Se.src=Pe})},L}(),e=function(){},w=function(){function L(A){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+A+"_"}return Object.defineProperty(L.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(L.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(L.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),L.prototype.addClass=function(A){return this.styleSheet===void 0&&this.addStyleSheet(),A.name=""+this.classNamePrefix+A.localName,this.classes.push(A),this.styleSheet.sheet.insertRule("."+A.name+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length),A},L.prototype.addRule=function(A){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(A),this.styleSheet.sheet.insertRule(A.selector+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length)},L.prototype.addStyleSheet=function(){var A;this.styleSheet=document.createElement("style"),((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new u("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new u("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},L.prototype.removeStyleSheet=function(){var A;this.styleSheet&&(((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},L}(),g=function(L,A){this.selector=L,this.style=A},u=function(L,A){this.localName=L,this.style=A},l=function(){function L(A,C,U,K,M){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=A,this.displayMode=C,this.markerItems=U,this.uiStyleSettings=K,this.styles=M,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return L.prototype.show=function(A){var C=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var U=document.createElement("div");U.className=this.toolbarBlockStyleClass.name,U.style.whiteSpace="nowrap",this.uiContainer.appendChild(U),this.addActionButton(U,'<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(U,'<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(U,'<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(U,'<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(U,'<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(U,'<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(U,'<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(U,'<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(M){var ie=document.createElement("div");ie.className=""+C.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",M.typeName),ie.innerHTML=M.icon,ie.addEventListener("click",function(){C.markerToolbarButtonClicked(ie,M)}),C.buttons.push(ie),C.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 K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",K.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(K),this.addActionButton(K,'<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(K,'<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()},L.prototype.addButtonClickListener=function(A){this.buttonClickListeners.push(A)},L.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},L.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},L.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C<this.markerButtons.length;C++)C<A||C===A&&this.markerButtons.length-1===A?this.markerButtonBlock.appendChild(this.markerButtons[C]):(C===A&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[C]))}},L.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")},L.prototype.resetButtonStyles=function(){var A=this;this.buttons.forEach(function(C){C.className=C.className.replace(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name,"").trim(),C.className=C.className.replace(A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:A.toolbarActiveButtonStyleColorsClass.name,"").trim(),C.className+=" "+(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name)})},L.prototype.addActionButton=function(A,C,U){var K=this,M=document.createElement("div");switch(M.className=""+this.toolbarButtonStyleClass.name,M.innerHTML=C,M.setAttribute("data-action",U),M.addEventListener("click",function(){K.actionToolbarButtonClicked(M,U)}),U){case"select":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":M.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":M.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":M.style.fill=this.uiStyleSettings.closeButtonColor}A.appendChild(M),this.buttons.push(M)},L.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new u("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 u("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new u("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new u("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 u("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new u("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
|
|
padding: `+A+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new u("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new u("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},L.prototype.markerToolbarButtonClicked=function(A,C){this.setActiveButton(A),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(U){return U("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},L.prototype.actionToolbarButtonClicked=function(A,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(U){return U("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},L.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},L.prototype.setActiveMarkerButton=function(A){var C=this.markerButtons.find(function(U){return U.getAttribute("data-type-name")===A});C&&this.setActiveButton(C)},L.prototype.setCurrentMarker=function(A){var C=this;this.currentMarker=A,this.buttons.filter(function(U){return/delete|notes/.test(U.getAttribute("data-action"))}).forEach(function(U){C.currentMarker===void 0?(U.style.fillOpacity="0.4",U.style.pointerEvents="none"):(U.style.fillOpacity="1",U.style.pointerEvents="all")})},L}(),s=function(){function L(A,C,U,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=C,this.uiStyleSettings=U,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return L.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new u("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 u("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new u("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new u("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new u("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 u("toolbox-panel-row_colors",`
|
|
background-color: `+((A=this.uiStyleSettings.toolboxBackgroundColor)!==null&&A!==void 0?A:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new u("toolbox_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.toolboxButtonStyleColorsClass=this.styles.addClass(new u("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new u("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},L.prototype.show=function(A){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},L.prototype.setPanelButtons=function(A){var C,U,K=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((U=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&U!==void 0?U:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(M){var ie;M.uiStyleSettings=K.uiStyleSettings;var Ee=document.createElement("div");Ee.className=K.toolboxButtonStyleClass.name+" "+((ie=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:K.toolboxButtonStyleColorsClass.name),Ee.innerHTML=M.icon,Ee.title=M.title,Ee.addEventListener("click",function(){K.panelButtonClick(M)}),K.panelButtons.push(Ee),K.buttonRow.appendChild(Ee)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},L.prototype.panelButtonClick=function(A){var C=this,U=-1;if(A!==this.activePanel){U=this.panels.indexOf(A),this.panelRow.innerHTML="";var K=A.getUi();K.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(K),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=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(M,ie){var Ee,Oe;M.className=C.toolboxButtonStyleClass.name+" "+(ie===U?""+((Ee=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:C.toolboxActiveButtonStyleColorsClass.name):""+((Oe=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:C.toolboxButtonStyleColorsClass.name))})},L}(),i=function(L,A){this.title=L,this.icon=A},o=function(L){function A(C,U,K,M){var ie=L.call(this,C,M||'<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=U,ie.currentColor=K,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.whiteSpace="nowrap",this.colors.forEach(function(K){var M=C.getColorBox(K);U.appendChild(M),C.colorBoxes.push(M)}),U},A.prototype.getColorBox=function(C){var U=this,K=this.uiStyleSettings.toolbarHeight/4,M=this.uiStyleSettings.toolbarHeight-K,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=M-2+"px",ie.style.height=M-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=(M+2)/2+"px",ie.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){U.setCurrentColor(C,ie)});var Ee=document.createElement("div");return Ee.style.display="inline-block",Ee.style.width=M-2+"px",Ee.style.height=M-2+"px",Ee.style.backgroundColor=C,Ee.style.borderRadius=M/2+"px",C==="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},A.prototype.setCurrentColor=function(C,U){var K=this;this.currentColor=C,this.colorBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},A}(i),a=function(){function L(A,C,U){this._state="new",this._isSelected=!1,this._container=A,this._overlayContainer=C,this.globalSettings=U,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(L.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(A){return!1},Object.defineProperty(L.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},L.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},L.prototype.pointerDown=function(A,C){},L.prototype.dblClick=function(A,C){},L.prototype.manipulate=function(A){},L.prototype.pointerUp=function(A){this.stateChanged()},L.prototype.dispose=function(){},L.prototype.addMarkerVisualToContainer=function(A){this.container.childNodes.length>0?this.container.insertBefore(A,this.container.childNodes[0]):this.container.appendChild(A)},L.prototype.getState=function(){return{typeName:L.typeName,state:this.state,notes:this.notes}},L.prototype.restoreState=function(A){this._state=A.state,this.notes=A.notes},L.prototype.scale=function(A,C){},L.prototype.colorChanged=function(A){this.onColorChanged&&this.onColorChanged(A),this.stateChanged()},L.prototype.fillColorChanged=function(A){this.onFillColorChanged&&this.onFillColorChanged(A),this.stateChanged()},L.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var A=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),A.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(A)&&this.onStateChanged(this)}},L.typeName="MarkerBase",L}(),r=function(){function L(){this.findGripByVisual=this.findGripByVisual.bind(this)}return L.prototype.findGripByVisual=function(A){return this.topLeft.ownsTarget(A)?this.topLeft:this.topCenter.ownsTarget(A)?this.topCenter:this.topRight.ownsTarget(A)?this.topRight:this.centerLeft.ownsTarget(A)?this.centerLeft:this.centerRight.ownsTarget(A)?this.centerRight:this.bottomLeft.ownsTarget(A)?this.bottomLeft:this.bottomCenter.ownsTarget(A)?this.bottomCenter:this.bottomRight.ownsTarget(A)?this.bottomRight:void 0},L}(),n=function(){function L(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return L.prototype.ownsTarget=function(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},L}(),t=function(){function L(){}return L.toITransformMatrix=function(A){return{a:A.a,b:A.b,c:A.c,d:A.d,e:A.e,f:A.f}},L.toSVGMatrix=function(A,C){return A.a=C.a,A.b=C.b,A.c=C.c,A.d=C.d,A.e=C.e,A.f=C.f,A},L}(),v=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.left=0,M.top=0,M.width=0,M.height=0,M.defaultSize={x:50,y:20},M.offsetX=0,M.offsetY=0,M.rotationAngle=0,M.CB_DISTANCE=10,M._suppressMarkerCreateEvent=!1,M.container.transform.baseVal.appendItem(O.createTransform()),M.setupControlBox(),M}return W(A,L),Object.defineProperty(A.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var U=O.createTransform();this._visual.transform.baseVal.appendItem(U)},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(C){return!!L.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(C);if(this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.offsetX=K.x-this.left,this.offsetY=K.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(U),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(U)){this.activeGrip=this.rotatorGrip;var M=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=M.x-this.width/2,this.top=M.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"},A.prototype.pointerUp=function(C){var U=this.state;L.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},A.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},A.prototype.manipulate=function(C){var U=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(U.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(U.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(U):this.state==="rotate"&&this.rotate(C)},A.prototype.resize=function(C){var U=this.manipulationStartLeft,K=this.manipulationStartWidth,M=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:U=this.manipulationStartLeft+C.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-U;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:M=this.manipulationStartTop+C.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-M;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+C.y-this.manipulationStartY}K>=0?(this.left=U,this.width=K):(this.left=U+K,this.width=-K),ie>=0?(this.top=M,this.height=ie):(this.top=M+ie,this.height=-ie),this.setSize()},A.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},A.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var U=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*U,this.applyRotation()}},A.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},A.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM(),K=O.createPoint(C.x,C.y);return{x:(K=K.matrixTransform(U)).x,y:K.y}},A.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM();U=U.inverse();var K=O.createPoint(C.x,C.y);return{x:(K=K.matrixTransform(U)).x,y:K.y}},A.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=O.createGroup();var C=O.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=O.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=O.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 r,this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,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()},A.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()},A.prototype.createGrip=function(){var C=new n;return C.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(C.visual),C},A.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,U=-C/2,K=U,M=(this.width+this.CB_DISTANCE)/2-C/2,ie=(this.height+this.CB_DISTANCE)/2-C/2,Ee=this.height+this.CB_DISTANCE-C/2,Oe=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,U,K),this.positionGrip(this.controlGrips.topCenter.visual,M,K),this.positionGrip(this.controlGrips.topRight.visual,Oe,K),this.positionGrip(this.controlGrips.centerLeft.visual,U,ie),this.positionGrip(this.controlGrips.centerRight.visual,Oe,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,U,Ee),this.positionGrip(this.controlGrips.bottomCenter.visual,M,Ee),this.positionGrip(this.controlGrips.bottomRight.visual,Oe,Ee),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,M,K-3*this.CB_DISTANCE)},A.prototype.positionGrip=function(C,U,K){var M=C.transform.baseVal.getItem(0);M.setTranslate(U,K),C.transform.baseVal.replaceItem(M,0)},A.prototype.hideControlBox=function(){this.controlBox.style.display="none"},A.prototype.showControlBox=function(){this.controlBox.style.display=""},A.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},L.prototype.getState.call(this))},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C);var U=C;this.left=U.left,this.top=U.top,this.width=U.width,this.height=U.height,this.rotationAngle=U.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,U.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,U.containerTransformMatrix))},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U);var K=this.rotatePoint({x:this.left,y:this.top}),M=this.unrotatePoint({x:K.x*C,y:K.y*U});this.left=M.x,this.top=M.y,this.width=this.width*C,this.height=this.height*U,this.adjustControlBox()},A}(a),c=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.createVisual=M.createVisual.bind(M),M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.visual)},A.prototype.createVisual=function(){this.visual=O.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)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.manipulate=function(C){L.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){L.prototype.resize.call(this,C),this.setSize()},A.prototype.setSize=function(){L.prototype.setSize.call(this),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(C){L.prototype.pointerUp.call(this,C),this.setSize()},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},A.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this))},A.prototype.restoreState=function(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),L.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.setSize()},A.title="Rectangle marker",A}(v),p=function(L){function A(C,U,K,M){var ie=L.call(this,C,M||'<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=U,ie.currentWidth=K,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.widths.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.flexGrow="2",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentWidth(K,M)}),U.appendChild(M);var ie=document.createElement("div");ie.innerText=K.toString(),ie.style.marginRight="5px",M.appendChild(ie);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.display="flex",Ee.style.alignItems="center";var Oe=document.createElement("hr");Oe.style.minWidth="20px",Oe.style.border="0px",Oe.style.borderTop=K+"px solid "+C.uiStyleSettings.toolboxColor,Oe.style.flexGrow="2",Ee.appendChild(Oe),M.appendChild(Ee),C.widthBoxes.push(M)}),U},A.prototype.setCurrentWidth=function(C,U){var K=this;this.currentWidth=C,this.widthBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},A}(i),b=function(L){function A(C,U,K,M){var ie=L.call(this,C,M||'<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=U,ie.currentStyle=K,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.styles.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/C.styles.length-5+"%",M.style.borderColor=K===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentStyle(K,M)}),U.appendChild(M);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="`+C.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
|
|
</svg>`;ie.innerHTML=Ee,M.appendChild(ie),C.styleBoxes.push(M)}),U},A.prototype.setCurrentStyle=function(C,U){var K=this;this.currentStyle=C,this.styleBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(i),y=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new o("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,L),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=L.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="FrameMarker",A.title="Frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',A}(c),d=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},f=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.x1=0,M.y1=0,M.x2=0,M.y2=0,M.defaultLength=50,M.manipulationStartX=0,M.manipulationStartY=0,M.manipulationStartX1=0,M.manipulationStartY1=0,M.manipulationStartX2=0,M.manipulationStartY2=0,M.setupControlBox(),M}return W(A,L),A.prototype.ownsTarget=function(C){return!!L.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(U)?this.activeGrip=this.grip1:this.grip2.ownsTarget(U)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(C){var U=this.state;L.prototype.pointerUp.call(this,C),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(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},A.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=O.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var C=new n;return C.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(C.visual),C},A.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},A.prototype.positionGrip=function(C,U,K){var M=C.transform.baseVal.getItem(0);M.setTranslate(U,K),C.transform.baseVal.replaceItem(M,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},L.prototype.getState.call(this))},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C);var U=C;this.x1=U.x1,this.y1=U.y1,this.x2=U.x2,this.y2=U.y2},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.x1=this.x1*C,this.y1=this.y1*U,this.x2=this.x2*C,this.y2=this.y2*U,this.adjustVisual(),this.adjustControlBox()},A}(a),m=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new o("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.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)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.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()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',A}(f),h=function(L){function A(C,U,K,M){var ie=L.call(this,C,M||'<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=U,ie.currentFont=K,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.flexGrow="2",this.fonts.forEach(function(K){var M=document.createElement("div");M.style.display="inline-block",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/C.fonts.length-5+"%",M.style.borderColor=K===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentFont(K,M)}),U.appendChild(M);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=K,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),M.appendChild(ie),C.fontBoxes.push(M)}),U},A.prototype.setCurrentFont=function(C,U){var K=this;this.currentFont=C,this.fontBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(i),E=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.color="transparent",M.padding=5,M.DEFAULT_TEXT="your text here",M.text=M.DEFAULT_TEXT,M.isMoved=!1,M.color=K.defaultColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setColor=M.setColor.bind(M),M.setFont=M.setFont.bind(M),M.renderText=M.renderText.bind(M),M.sizeText=M.sizeText.bind(M),M.textEditDivClicked=M.textEditDivClicked.bind(M),M.showTextEditor=M.showTextEditor.bind(M),M.setSize=M.setSize.bind(M),M.positionTextEditor=M.positionTextEditor.bind(M),M.colorPanel=new o("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.fontFamilyPanel=new h("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M}return W(A,L),A.prototype.ownsTarget=function(C){if(L.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var U=!1;return this.textElement.childNodes.forEach(function(K){K===C&&(U=!0)}),U},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.renderText=function(){var C=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(U){C.textElement.appendChild(O.createTSpan(U.trim()===""?" ":U.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var C=this.textElement.getBBox(),U=1;if(C.width>0&&C.height>0){var K=(1*this.width-this.width*this.padding*2/100)/C.width,M=(1*this.height-this.height*this.padding*2/100)/C.height;U=Math.min(K,M)}return U},A.prototype.getTextPosition=function(C){var U=this.textElement.getBBox(),K=0,M=0;return U.width>0&&U.height>0&&(K=(this.width-U.width*C)/2,M=this.height/2-U.height*C/2),{x:K,y:M}},A.prototype.sizeText=function(){var C=this.textElement.getBBox(),U=this.getTextScale(),K=this.getTextPosition(U);K.y-=C.y*U,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+U+", "+U+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(U,U))},A.prototype.manipulate=function(C){L.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(C){L.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){L.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(C){var U=this.state;U==="creating"&&(this._suppressMarkerCreateEvent=!0),L.prototype.pointerUp.call(this,C),this.setSize(),(U==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var C=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(U){U.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var U=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&U>.9;)U-=.1,C.textEditor.style.fontSize=Math.max(U,.9)+"em"}),this.textEditor.addEventListener("keyup",function(U){U.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(U){if(U.clipboardData){var K=U.clipboardData.getData("text"),M=window.getSelection();if(!M.rangeCount)return!1;M.deleteFromDocument(),M.getRangeAt(0).insertNode(document.createTextNode(K)),U.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),U=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),M={x:K.width*C,y:K.height*C};U.x-=M.x/2,U.y-=M.y/2,this.textEditor.style.top=U.y+"px",this.textEditor.style.left=U.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-U.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){L.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),L.prototype.deselect.call(this)},A.prototype.dblClick=function(C,U){L.prototype.dblClick.call(this,C,U),this.showTextEditor()},A.prototype.setColor=function(C){this.textElement&&O.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},A.prototype.setFont=function(C){this.textElement&&O.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var U=C;this.color=U.color,this.fontFamily=U.fontFamily,this.padding=U.padding,this.text=U.text,this.createVisual(),L.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.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>',A}(v),_=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.color="transparent",M.lineWidth=3,M.drawing=!1,M.pixelRatio=1,M.color=K.defaultColor,M.lineWidth=K.defaultStrokeWidth,M.pixelRatio=K.freehandPixelRatio,M.setColor=M.setColor.bind(M),M.addCanvas=M.addCanvas.bind(M),M.finishCreation=M.finishCreation.bind(M),M.setLineWidth=M.setLineWidth.bind(M),M.colorPanel=new o("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.lineWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.lineWidthPanel.onWidthChanged=M.setLineWidth,M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var C=O.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,U){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(C.x,C.y),this.drawing=!0):L.prototype.pointerDown.call(this,C,U)},A.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):L.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){L.prototype.resize.call(this,C),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):L.prototype.pointerUp.call(this,C)},A.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)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),L.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),L.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),U=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=U[0],M=U[1],ie=U[2],Ee=U[3],Oe=!1,q=0;q<this.canvasElement.height;q++)for(var ce=0;ce<this.canvasElement.width;ce++)C.data[q*this.canvasElement.width*4+4*ce+3]>0&&(Oe=!0,q<M&&(M=q),ce<K&&(K=ce),q>Ee&&(Ee=q),ce>ie&&(ie=ce));if(Oe){this.left=K/this.pixelRatio,this.top=M/this.pixelRatio,this.width=(ie-K)/this.pixelRatio,this.height=(Ee-M)/this.pixelRatio;var Se=document.createElement("canvas");Se.width=ie-K,Se.height=Ee-M,Se.getContext("2d").putImageData(this.canvasContext.getImageData(K,M,ie-K,Ee-M),0,0),this.drawingImgUrl=Se.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},A.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){this.createVisual(),L.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.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>',A}(v),T=function(L){function A(C,U,K){var M=L.call(this,C,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return M.typeBoxes=[],M.currentType=U,M.setCurrentType=M.setCurrentType.bind(M),M}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2";for(var K=function(Ee){var Oe="both";switch(Ee){case 0:Oe="both";break;case 1:Oe="start";break;case 2:Oe="end";break;case 3:Oe="none"}var q=document.createElement("div");if(q.style.display="flex",q.style.flexGrow="2",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=Oe===M.currentType?M.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){C.setCurrentType(Oe,q)}),U.appendChild(q),Oe==="both"||Oe==="start"){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.minHeight="20px",ce.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ce.style.marginLeft="5px",q.appendChild(ce)}var Se=document.createElement("div");Se.style.display="flex",Se.style.alignItems="center",Se.style.minHeight="20px",Se.style.flexGrow="2";var Ce=document.createElement("hr");if(Ce.style.minWidth="20px",Ce.style.border="0px",Ce.style.borderTop="3px solid "+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee"),Ce.style.flexGrow="2",Se.appendChild(Ce),q.appendChild(Se),Oe==="both"||Oe==="end"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Pe.style.marginRight="5px",q.appendChild(Pe)}M.typeBoxes.push(q)},M=this,ie=0;ie<4;ie++)K(ie);return U},A.prototype.setCurrentType=function(C,U){var K=this;this.currentType=C,this.typeBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(i),k=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.arrowType="end",M.arrowBaseHeight=10,M.arrowBaseWidth=10,M.getArrowPoints=M.getArrowPoints.bind(M),M.setArrowType=M.setArrowType.bind(M),M.arrowTypePanel=new T("Arrow type","end"),M.arrowTypePanel.onArrowTypeChanged=M.setArrowType,M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},A.prototype.getArrowPoints=function(C,U){var K=this.arrowBaseWidth+2*this.strokeWidth,M=this.arrowBaseHeight+2*this.strokeWidth;return C-K/2+","+(U+M/2)+" "+C+","+(U-M/2)+" "+(C+K/2)+","+(U+M/2)},A.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(L.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",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.arrow1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(U,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},A.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C);var U=C;this.arrowType=U.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',A}(m),D=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.fillColor=K.defaultFillColor,M.strokeWidth=0,M.fillPanel=new o("Color",K.defaultColorSet,K.defaultFillColor),M.fillPanel.onColorChanged=M.setFillColor,M}return W(A,L),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=L.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="CoverMarker",A.title="Cover marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',A}(c),x=function(L){function A(C,U,K,M){var ie=L.call(this,C,M||'<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=U,ie.currentOpacity=K,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return W(A,L),A.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",U.style.justifyContent="space-between",this.opacities.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="center",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentOpacity(K,M)}),U.appendChild(M);var ie=document.createElement("div");ie.innerText=100*K+"%",M.appendChild(ie),C.opacityBoxes.push(M)}),U},A.prototype.setCurrentOpacity=function(C,U){var K=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(M){M.style.borderColor=M===U?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(i),P=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.setOpacity=M.setOpacity.bind(M),M.fillColor=K.defaultHighlightColor,M.strokeWidth=0,M.opacity=K.defaultHighlightOpacity,M.fillPanel=new o("Color",K.defaultColorSet,M.fillColor),M.fillPanel.onColorChanged=M.setFillColor,M.opacityPanel=new x("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return W(A,L),A.prototype.setOpacity=function(C){this.opacity=C,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=L.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="HighlightMarker",A.title="Highlight marker",A.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>',A}(D),H='<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>',I=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.bgColor="transparent",M.tipPosition={x:0,y:0},M.tipBase1Position={x:0,y:0},M.tipBase2Position={x:0,y:0},M.tipMoving=!1,M.color=K.defaultStrokeColor,M.bgColor=K.defaultFillColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setBgColor=M.setBgColor.bind(M),M.getTipPoints=M.getTipPoints.bind(M),M.positionTip=M.positionTip.bind(M),M.setTipPoints=M.setTipPoints.bind(M),M.colorPanel=new o("Text color",K.defaultColorSet,M.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>'),M.colorPanel.onColorChanged=M.setColor,M.bgColorPanel=new o("Fill color",K.defaultColorSet,M.bgColor,H),M.bgColorPanel.onColorChanged=M.setBgColor,M.fontFamilyPanel=new h("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M.tipGrip=new n,M.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),M.controlBox.appendChild(M.tipGrip.visual),M}return W(A,L),A.prototype.ownsTarget=function(C){return L.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},A.prototype.createTip=function(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(C,U){this.state==="new"&&L.prototype.pointerDown.call(this,C,U),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(U)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):L.prototype.pointerDown.call(this,C,U)},A.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,L.prototype.pointerUp.call(this,C);else{var U=this.state==="creating";L.prototype.pointerUp.call(this,C),this.setTipPoints(U),this.positionTip()}},A.prototype.manipulate=function(C){if(this.tipMoving){var U=this.unrotatePoint(C);this.tipPosition={x:U.x-this.manipulationStartLeft,y:U.y-this.manipulationStartTop},this.positionTip()}else L.prototype.manipulate.call(this,C)},A.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(O.setAttributes(this.bgRectangle,[["fill",C]]),O.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},A.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},A.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var U=Math.min(this.height/2,15),K=this.height/5;C&&(this.tipPosition={x:U+K/2,y:this.height+20});var M=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,U=Math.min(this.width/2,15),this.tipBase1Position={x:U,y:0},this.tipBase2Position={x:U+K,y:0}):(this.tipBase1Position={x:0,y:U},this.tipBase2Position={x:0,y:U+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,U=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-U-K,y:0},this.tipBase2Position={x:this.width-U,y:0}):(this.tipBase1Position={x:this.width,y:U},this.tipBase2Position={x:this.width,y:U+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?M<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,U=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-U-K,y:this.height},this.tipBase2Position={x:this.width-U,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-U-K},this.tipBase2Position={x:this.width,y:this.height-U}):M<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,U=Math.min(this.width/2,15),this.tipBase1Position={x:U,y:this.height},this.tipBase2Position={x:U+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-U},this.tipBase2Position={x:0,y:this.height-U-K})},A.prototype.resize=function(C){L.prototype.resize.call(this,C),this.positionTip()},A.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var C=this.tipGrip.visual.transform.baseVal.getItem(0);C.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(C,0)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.select=function(){this.positionTip(),L.prototype.select.call(this)},A.prototype.getState=function(){var C=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var U=C;this.bgColor=U.bgColor,this.tipPosition=U.tipPosition,L.prototype.restoreState.call(this,C),this.createTip(),this.setTipPoints()},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.tipPosition={x:this.tipPosition.x*C,y:this.tipPosition.y*U},this.positionTip()},A.typeName="CalloutMarker",A.title="Callout marker",A.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>',A}(E),V=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.fillColor=K.defaultFillColor,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.setOpacity=M.setOpacity.bind(M),M.createVisual=M.createVisual.bind(M),M.strokePanel=new o("Line color",S(K.defaultColorSet,["transparent"]),K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.fillPanel=new o("Fill color",S(K.defaultColorSet,["transparent"]),M.fillColor,H),M.fillPanel.onColorChanged=M.setFillColor,M.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M.opacityPanel=new x("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.visual)},A.prototype.createVisual=function(){this.visual=O.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)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.manipulate=function(C){L.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){L.prototype.resize.call(this,C),this.setSize()},A.prototype.setSize=function(){L.prototype.setSize.call(this),O.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},A.prototype.pointerUp=function(C){L.prototype.pointerUp.call(this,C),this.setSize()},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},A.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.setOpacity=function(C){this.opacity=C,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),L.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,U){L.prototype.scale.call(this,C,U),this.setSize()},A.typeName="EllipseMarker",A.title="Ellipse marker",A.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>',A}(v),$=function(L){function A(C,U,K){return L.call(this,C,U,K)||this}return W(A,L),Object.defineProperty(A.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},A.prototype.createTips=function(){this.tip1=O.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(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.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(O.createTransform()),this.visual.appendChild(this.tip2)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(L.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.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()]]),O.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 C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.tip1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(U,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=L.prototype.getState.call(this);return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.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>',A}(m),ge=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.strokePanel.colors=K.defaultColorSet,M.fillColor="transparent",M}return W(A,L),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=L.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.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>',A}(V),te=function(){function L(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),L.prototype.addUndoStep=function(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},L.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},L.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},L.prototype.undo=function(){if(this.undoStack.length>1){var A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},L.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},L}(),be=function(L){function A(C,U,K){var M=L.call(this,C,U,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.curveX=0,M.curveY=0,M.manipulationStartCurveX=0,M.manipulationStartCurveY=0,M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.positionGrips=M.positionGrips.bind(M),M.addControlGrips=M.addControlGrips.bind(M),M.adjustVisual=M.adjustVisual.bind(M),M.setupControlBox=M.setupControlBox.bind(M),M.resize=M.resize.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new o("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,L),A.prototype.ownsTarget=function(C){return!(!L.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.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)},A.prototype.pointerDown=function(C,U){L.prototype.pointerDown.call(this,C,U),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(U)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){L.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.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)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,L.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){L.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/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()))},A.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),L.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),L.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},A.prototype.scale=function(C,U){this.curveX=this.curveX*C,this.curveY=this.curveY*U,L.prototype.scale.call(this,C,U)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},L.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){L.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.curveX=U.curveX,this.curveY=U.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.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>',A}(f),ve=function(){function L(A,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=C}return Object.defineProperty(L.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),L.prototype.preventDefault=function(){this._defaultPrevented=!0},L}(),oe=function(L){function A(C,U,K){var M=L.call(this,C,!1)||this;return M.dataUrl=U,M.state=K,M}return W(A,L),A}(ve),le=function(L){function A(C,U,K){K===void 0&&(K=!1);var M=L.call(this,C,K)||this;return M.marker=U,M}return W(A,L),A}(ve),_e=function(){function L(){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 L.prototype.addEventListener=function(A,C){this[A].push(C)},L.prototype.removeEventListener=function(A,C){var U=this[A].indexOf(C);U>-1&&this[A].splice(U,1)},L}(),ee=function(){function L(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new d,this._isOpen=!1,this.undoRedoManager=new te,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 _e,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=L.instanceCounter++,this.styles=new w(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.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(L.prototype,"ALL_MARKER_TYPES",{get:function(){return[y,_,k,E,ge,V,P,I,$,D,m,be]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[y,_,k,E,V,P,I]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"BASIC_MARKER_TYPES",{get:function(){return[y,_,k,E,P]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var C=this;this._availableMarkerTypes.splice(0),A.forEach(function(U){if(typeof U=="string"){var K=C.ALL_MARKER_TYPES.find(function(M){return M.typeName===U});K!==void 0&&C._availableMarkerTypes.push(K)}else C._availableMarkerTypes.push(U)})},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(A){this._zoomLevel=A,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(L.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),L.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),F.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},L.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new ve(A))})},L.prototype.render=function(){return R(this,void 0,void 0,function(){var A;return N(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(A=new B).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},L.prototype.close=function(A){var C=this;if(A===void 0&&(A=!1),this.isOpen){var U=!1;A||this.eventListeners.beforeclose.forEach(function(K){var M=new ve(C,!0);K(M),M.defaultPrevented&&(U=!0)}),U||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(K){return K(new ve(C))}),this.detachEvents(),this._isOpen=!1)}},L.prototype.addMarkersToToolbar=function(){for(var A,C=[],U=0;U<arguments.length;U++)C[U]=arguments[U];(A=this._availableMarkerTypes).push.apply(A,C)},L.prototype.addRenderEventListener=function(A){this.addEventListener("render",function(C){A(C.dataUrl,C.state)})},L.prototype.removeRenderEventListener=function(A){},L.prototype.addCloseEventListener=function(A){this.addEventListener("close",function(){A()})},L.prototype.removeCloseEventListener=function(A){},L.prototype.setupResizeObserver=function(){var A=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){A.resize(A.target.clientWidth,A.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return A.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},L.prototype.onPopupTargetResize=function(){var A=1*this.target.clientWidth/this.target.clientHeight,C=this.editorCanvas.clientWidth/A>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,U=C<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/A;this.resize(C,U)},L.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},L.prototype.resize=function(A,C){this._isResizing=!0;var U=A/this.imageWidth,K=C/this.imageHeight;this.imageWidth=Math.round(A),this.imageHeight=Math.round(C),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(U,K),this._isResizing=!1},L.prototype.scaleMarkers=function(A,C){var U,K=this;this._currentMarker&&this._currentMarker instanceof E?this._currentMarker.scale(A,C):(U=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(M){M!==K._currentMarker&&M.scale(A,C)}),U!==void 0&&this.setCurrentMarker(U)},L.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"},L.prototype.setTopLeft=function(){var A=this.editingTarget.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=A.left-C.left,this.top=A.top-C.top},L.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)},L.prototype.addDefs=function(){for(var A,C=[],U=0;U<arguments.length;U++)C[U]=arguments[U];this.defs=O.createDefs(),this.addDefsToImage(),(A=this.defs).append.apply(A,C)},L.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},L.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)},L.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},L.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},L.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)},L.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},L.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)},L.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 A=document.createElement("a");A.href="https://markerjs.com/",A.target="_blank",A.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>',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},L.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")},L.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"},L.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},L.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 A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"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 l(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 s(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},L.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},L.prototype.removeMarker=function(A){this.markerImage.removeChild(A.container),this.markers.indexOf(A)>-1&&this.markers.splice(this.markers.indexOf(A),1),A.dispose()},L.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())},L.prototype.toolbarButtonClicked=function(A,C){if(A==="marker"&&C!==void 0)this.createNewMarker(C);else if(A==="action")switch(C){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()}},L.prototype.deleteSelectedMarker=function(){var A=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var M=new le(A,A._currentMarker,!0);K(M),M.defaultPrevented&&(C=!0)}),!C){var U=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(K){return K(new le(A,U))})}}},L.prototype.clear=function(){var A=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Ee=new le(A,void 0,!0);ie(Ee),Ee.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var U=function(ie){var Ee=K.markers[ie];K.setCurrentMarker(K.markers[ie]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(Oe){return Oe(new le(A,Ee))})},K=this,M=this.markers.length-1;M>=0;M--)U(M);this.addUndoStep()}},Object.defineProperty(L.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),L.prototype.showNotesEditor=function(){var A;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=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",this.overlayContainer.appendChild(this.notesArea))},L.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)},L.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},L.prototype.addUndoStep=function(){var A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),U=this.undoRedoManager.getLastUndoStep();if(!U||U.width===C.width&&U.height===C.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(M){return M(new ve(A))})}else this.undoRedoManager.replaceLastUndoStep(C),this.eventListeners.statechange.forEach(function(M){return M(new ve(A))})}},L.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},L.prototype.undoStep=function(){var A=this,C=this.undoRedoManager.undo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(U){return U(new ve(A))}))},L.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},L.prototype.redoStep=function(){var A=this,C=this.undoRedoManager.redo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(U){return U(new ve(A))}))},L.prototype.stepZoom=function(){var A=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=A<this.zoomSteps.length-1?this.zoomSteps[A+1]:this.zoomSteps[0]},L.prototype.panTo=function(A){this.contentDiv.scrollBy({left:this.prevPanPoint.x-A.x,top:this.prevPanPoint.y-A.y}),this.prevPanPoint=A},L.prototype.startRenderAndClose=function(){return R(this,void 0,void 0,function(){var A,C,U=this;return N(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return A=K.sent(),C=this.getState(),this.eventListeners.render.forEach(function(M){return M(new oe(U,A,C))}),this.close(!0),[2]}})})},L.prototype.getState=function(A){A===!0&&this.setCurrentMarker();var C={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(U){return C.markers.push(U.getState())}),C},L.prototype.restoreState=function(A){var C=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);A.markers.forEach(function(U){var K=C._availableMarkerTypes.find(function(ie){return ie.typeName===U.typeName});if(K!==void 0){var M=C.addNewMarker(K);M.restoreState(U),C.markers.push(M)}}),A.width&&A.height&&(A.width!==this.imageWidth||A.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/A.width,this.imageHeight/A.height),this.eventListeners.restorestate.forEach(function(U){return U(new ve(C))})},L.prototype.addNewMarker=function(A){var C=O.createGroup();return this.markerImage.appendChild(C),new A(C,this.overlayContainer,this.settings)},L.prototype.createNewMarker=function(A){var C,U=this;(C=typeof A=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===A}):A)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(C),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(C.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new le(U,U._currentMarker))}))},L.prototype.markerCreated=function(A){var C=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(A),this.setCurrentMarker(A),A instanceof _&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(_):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(U){return U(new le(C,C._currentMarker))})},L.prototype.colorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=A,this.settings.defaultStrokeColor=A)},L.prototype.fillColorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=A)},L.prototype.markerStateChanged=function(A){var C=this;this.eventListeners.markerchange.forEach(function(U){return U(new le(C,A))})},L.prototype.setCurrentMarker=function(A){var C=this;this._currentMarker!==A&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(U){return U(new le(C,C._currentMarker))})),this._currentMarker=A,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(U){return U(new le(C,C._currentMarker))}))},L.prototype.onPointerDown=function(A){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||A.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var C=this.markers.find(function(U){return U.ownsTarget(A.target)});C!==void 0?(this.setCurrentMarker(C),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:A.clientX,y:A.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY))},L.prototype.onDblClick=function(A){if(this._isFocused||this.focus(),this.mode==="select"){var C=this.markers.find(function(U){return U.ownsTarget(A.target)});C!==void 0&&C!==this._currentMarker&&this.setCurrentMarker(C),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target):this.setCurrentMarker()}},L.prototype.onPointerMove=function(A){this.touchPoints!==1&&A.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||A.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(A.clientX,A.clientY)):this.zoomLevel>1&&this.panTo({x:A.clientX,y:A.clientY}))},L.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},L.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},L.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},L.prototype.clientToLocalCoordinates=function(A,C){var U=this.markerImage.getBoundingClientRect();return{x:(A-U.left)/this.zoomLevel,y:(C-U.top)/this.zoomLevel}},L.prototype.onWindowResize=function(){this.positionUI()},L.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"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()},L.prototype.addLicenseKey=function(A){F.addKey(A)},L.prototype.addEventListener=function(A,C){this.eventListeners.addEventListener(A,C)},L.prototype.removeEventListener=function(A,C){this.eventListeners.removeEventListener(A,C)},L.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(L.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),L.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new ve(A))}))},L.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new ve(A))}))},L.instanceCounter=0,L}()},T8No:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return F}),j.d(ye,"e",function(){return B}),j.d(ye,"c",function(){return m}),j.d(ye,"b",function(){return h}),j.d(ye,"d",function(){return E}),j.d(ye,"f",function(){return k});var ue=j("MNsG"),W=j("N0LK"),R=j("Cg/j");let N=ue.k||"";const S=new Map;S.set("false",!1),S.set("true",!0),S.set("isMac",ue.f),S.set("isLinux",ue.d),S.set("isWindows",ue.i),S.set("isWeb",ue.h),S.set("isMacNative",ue.f&&!ue.h),S.set("isEdge",N.indexOf("Edg/")>=0),S.set("isFirefox",N.indexOf("Firefox")>=0),S.set("isChrome",N.indexOf("Chrome")>=0),S.set("isSafari",N.indexOf("Safari")>=0);const O=Object.prototype.hasOwnProperty;class F{static has(x){return u.create(x)}static equals(x,P){return l.create(x,P)}static regex(x,P){return p.create(x,P)}static not(x){return a.create(x)}static and(...x){return d.create(x,null)}static or(...x){return f.create(x,null,!0)}static deserialize(x,P=!1){return x?this._deserializeOrExpression(x,P):void 0}static _deserializeOrExpression(x,P){let H=x.split("||");return f.create(H.map(I=>this._deserializeAndExpression(I,P)),null,!0)}static _deserializeAndExpression(x,P){let H=x.split("&&");return d.create(H.map(I=>this._deserializeOne(I,P)),null)}static _deserializeOne(x,P){if(x=x.trim(),x.indexOf("!=")>=0){let H=x.split("!=");return o.create(H[0].trim(),this._deserializeValue(H[1],P))}if(x.indexOf("==")>=0){let H=x.split("==");return l.create(H[0].trim(),this._deserializeValue(H[1],P))}if(x.indexOf("=~")>=0){let H=x.split("=~");return p.create(H[0].trim(),this._deserializeRegexValue(H[1],P))}if(x.indexOf(" in ")>=0){let H=x.split(" in ");return s.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const H=x.split(">=");return t.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const H=x.split(">");return n.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const H=x.split("<=");return c.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const H=x.split("<");return v.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(x)?a.create(x.substr(1).trim()):u.create(x)}static _deserializeValue(x,P){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let H=/^'([^']*)'$/.exec(x);return H?H[1].trim():x}static _deserializeRegexValue(x,P){if(Object(W.C)(x)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let H=x.indexOf("/"),I=x.lastIndexOf("/");if(H===I||H<0){if(P)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let V=x.slice(H+1,I),$=x[I+1]==="i"?"i":"";try{return new RegExp(V,$)}catch(ge){if(P)throw new Error(`bad regexp-value '${x}', parse error: ${ge}`);return console.warn(`bad regexp-value '${x}', parse error: ${ge}`),null}}}function B(x,P){const H=x?x.substituteConstants():void 0,I=P?P.substituteConstants():void 0;return!H&&!I?!0:!H||!I?!1:H.equals(I)}function e(x,P){return x.cmp(P)}class w{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}w.INSTANCE=new w;class g{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return w.INSTANCE}}g.INSTANCE=new g;class u{constructor(x,P){this.key=x,this.negated=P,this.type=2}static create(x,P=null){const H=S.get(x);return typeof H=="boolean"?H?g.INSTANCE:w.INSTANCE:new u(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?g.INSTANCE:w.INSTANCE:this}evaluate(x){return!!x.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(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=4}static create(x,P,H=null){if(typeof P=="boolean")return P?u.create(x,H):a.create(x,H);const I=S.get(x);if(typeof I=="boolean"){const V=I?"true":"false";return P===V?g.INSTANCE:w.INSTANCE}return new l(x,P,H)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const P=x?"true":"false";return this.value===P?g.INSTANCE:w.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class s{constructor(x,P){this.key=x,this.valueKey=P,this.type=10,this.negated=null}static create(x,P){return new s(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const P=x.getValue(this.valueKey),H=x.getValue(this.key);return Array.isArray(P)?P.indexOf(H)>=0:typeof H=="string"&&typeof P=="object"&&P!==null?O.call(P,H):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(x){this._actual=x,this.type=11}static create(x){return new i(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class o{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=5}static create(x,P,H=null){if(typeof P=="boolean")return P?a.create(x,H):u.create(x,H);const I=S.get(x);if(typeof I=="boolean"){const V=I?"true":"false";return P===V?w.INSTANCE:g.INSTANCE}return new o(x,P,H)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const P=x?"true":"false";return this.value===P?w.INSTANCE:g.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class a{constructor(x,P){this.key=x,this.negated=P,this.type=3}static create(x,P=null){const H=S.get(x);return typeof H=="boolean"?H?w.INSTANCE:g.INSTANCE:new a(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?w.INSTANCE:g.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}function r(x,P){if(typeof x=="string"){const H=parseFloat(x);isNaN(H)||(x=H)}return typeof x=="string"||typeof x=="number"?P(x):w.INSTANCE}class n{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=12}static create(x,P,H=null){return r(P,I=>new n(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this.value,this)),this.negated}}class t{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=13}static create(x,P,H=null){return r(P,I=>new t(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class v{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=14}static create(x,P,H=null){return r(P,I=>new v(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class c{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=15}static create(x,P,H=null){return r(P,I=>new c(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class p{constructor(x,P){this.key=x,this.regexp=P,this.type=7,this.negated=null}static create(x,P){return new p(x,P)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const P=this.regexp?this.regexp.source:"",H=x.regexp?x.regexp.source:"";return P<H?-1:P>H?1:0}equals(x){if(x.type===this.type){const P=this.regexp?this.regexp.source:"",H=x.regexp?x.regexp.source:"";return this.key===x.key&&P===H}return!1}substituteConstants(){return this}evaluate(x){let P=x.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this)),this.negated}}class b{constructor(x){this._actual=x,this.type=8}static create(x){return new b(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function y(x){let P=null;for(let H=0,I=x.length;H<I;H++){const V=x[H].substituteConstants();if(x[H]!==V&&P===null){P=[];for(let $=0;$<H;$++)P[$]=x[$]}P!==null&&(P[H]=V)}return P===null?x:P}class d{constructor(x,P){this.expr=x,this.negated=P,this.type=6}static create(x,P){return d._normalizeArr(x,P)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const I=e(this.expr[P],x.expr[P]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(x.expr[P]))return!1;return!0}return!1}substituteConstants(){const x=y(this.expr);return x===this.expr?this:d.create(x,this.negated)}evaluate(x){for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].evaluate(x))return!1;return!0}static _normalizeArr(x,P){const H=[];let I=!1;for(const V of x){if(!V)continue;if(V.type===1){I=!0;continue}if(V.type===0)return w.INSTANCE;if(V.type===6){H.push(...V.expr);continue}H.push(V)}if(H.length===0&&I)return g.INSTANCE;if(H.length===0)return;if(H.length===1)return H[0];H.sort(e);for(let V=1;V<H.length;V++)H[V-1].equals(H[V])&&(H.splice(V,1),V--);if(H.length===1)return H[0];for(;H.length>1;){const V=H[H.length-1];if(V.type!==9)break;H.pop();const $=H.pop(),ge=H.length===0,te=f.create(V.expr.map(be=>d.create([be,$],null)),null,ge);te&&(H.push(te),H.sort(e))}return H.length===1?H[0]:new d(H,P)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let P of this.expr)x.push(...P.keys());return x}negate(){if(!this.negated){const x=[];for(let P of this.expr)x.push(P.negate());this.negated=f.create(x,this,!0)}return this.negated}}class f{constructor(x,P){this.expr=x,this.negated=P,this.type=9}static create(x,P,H){return f._normalizeArr(x,P,H)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const I=e(this.expr[P],x.expr[P]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(x.expr[P]))return!1;return!0}return!1}substituteConstants(){const x=y(this.expr);return x===this.expr?this:f.create(x,this.negated,!1)}evaluate(x){for(let P=0,H=this.expr.length;P<H;P++)if(this.expr[P].evaluate(x))return!0;return!1}static _normalizeArr(x,P,H){let I=[],V=!1;if(x){for(let $=0,ge=x.length;$<ge;$++){const te=x[$];if(!te)continue;if(te.type===0){V=!0;continue}if(te.type===1)return g.INSTANCE;if(te.type===9){I=I.concat(te.expr);continue}I.push(te)}if(I.length===0&&V)return w.INSTANCE;I.sort(e)}if(I.length===0)return;if(I.length===1)return I[0];for(let $=1;$<I.length;$++)I[$-1].equals(I[$])&&(I.splice($,1),$--);if(I.length===1)return I[0];if(H){for(let $=0;$<I.length;$++)for(let ge=$+1;ge<I.length;ge++)k(I[$],I[ge])&&(I.splice(ge,1),ge--);if(I.length===1)return I[0]}return new f(I,P)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let P of this.expr)x.push(...P.keys());return x}negate(){if(!this.negated){let x=[];for(let P of this.expr)x.push(P.negate());for(;x.length>1;){const P=x.shift(),H=x.shift(),I=[];for(const $ of D(P))for(const ge of D(H))I.push(d.create([$,ge],null));const V=x.length===0;x.unshift(f.create(I,null,V))}this.negated=x[0]}return this.negated}}class m extends u{constructor(x,P,H){super(x,null);this._defaultValue=P,typeof H=="object"?m._info.push(Object.assign(Object.assign({},H),{key:x})):H!==!0&&m._info.push({key:x,description:H,type:P!=null?typeof P:void 0})}static all(){return m._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return l.create(this.key,x)}}m._info=[];const h=Object(R.c)("contextKeyService"),E="setContext";function _(x,P){return x<P?-1:x>P?1:0}function T(x,P,H,I){return x<H?-1:x>H?1:P<I?-1:P>I?1:0}function k(x,P){if(P.type===6&&x.type!==9&&x.type!==6){for(const V of P.expr)if(x.equals(V))return!0}const H=x.negate(),I=D(H).concat(D(P));I.sort(e);for(let V=0;V<I.length;V++){const $=I[V],ge=$.negate();for(let te=V+1;te<I.length;te++){const be=I[te];if(ge.equals(be))return!0}}return!1}function D(x){return x.type===9?x.expr:[x]}},TXwP:function(Ke,ye,j){var ue,W;(function(){var R;(function(){"use strict";var S=[,,function(e){function w(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=[]}w.prototype.clone_empty=function(){var l=new w(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},w.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},w.prototype.has_match=function(l){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(l))return!0;return!1},w.prototype.set_indent=function(l,s){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.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)},w.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},w.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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(l){this.__items.push(l);var s=l.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=l.length-s:this.__character_count+=l.length},w.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.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 g(l,s){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)),s=s||"",l.indent_level>0&&(s=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}g.prototype.get_indent_size=function(l,s){var i=this.__base_string_length;return s=s||0,l<0&&(i=0),i+=l*this.__indent_size,i+=s,i},g.prototype.get_indent_string=function(l,s){var i=this.__base_string;return s=s||0,l<0&&(l=0,i=""),s+=l*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},g.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var l=this.__cache.length,s=0,i="";this.__indent_size&&l>=this.__indent_size&&(s=Math.floor(l/this.__indent_size),l-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),l&&(i+=new Array(l+1).join(" ")),this.__cache.push(i)};function u(l,s){this.__indent_cache=new g(l,s),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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(l,s){return this.__indent_cache.get_indent_string(l,s)},u.prototype.get_indent_size=function(l,s){return this.__indent_cache.get_indent_size(l,s)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(l){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return l!==`
|
|
`&&(i=i.replace(/[\n]/g,l)),i},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(l,s){return l=l||0,s=s||0,this.next_line.set_indent(l,s),this.__lines.length>1?(this.current_line.set_indent(l,s),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(l){for(var s=0;s<l.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(l){for(var s=this.__lines.length;l<s;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(l,s){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(l)!==0&&o.item(-1)!==s){this.__lines.splice(i+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=u},,,,function(e){function w(l,s){this.raw_options=g(l,s),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"])}w.prototype._get_array=function(l,s){var i=this.raw_options[l],o=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},w.prototype._get_boolean=function(l,s){var i=this.raw_options[l],o=i===void 0?!!s:!!i;return o},w.prototype._get_characters=function(l,s){var i=this.raw_options[l],o=s||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},w.prototype._get_number=function(l,s){var i=this.raw_options[l];s=parseInt(s,10),isNaN(s)&&(s=0);var o=parseInt(i,10);return isNaN(o)&&(o=s),o},w.prototype._get_selection=function(l,s,i){var o=this._get_selection_list(l,s,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[l]+"'");return o[0]},w.prototype._get_selection_list=function(l,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var o=this._get_array(l,i);if(!this._is_valid_selection(o,s))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[l]+"'");return o},w.prototype._is_valid_selection=function(l,s){return l.length&&s.length&&!l.some(function(i){return s.indexOf(i)===-1})};function g(l,s){var i={};l=u(l);var o;for(o in l)o!==s&&(i[o]=l[o]);if(s&&l[s])for(o in l[s])i[o]=l[s][o];return i}function u(l){var s={},i;for(i in l){var o=i.replace(/-/g,"_");s[o]=l[i]}return s}e.exports.Options=w,e.exports.normalizeOpts=u,e.exports.mergeOpts=g},,function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},g.prototype.peek=function(u){var l=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(l=this.__input.charAt(u)),l},g.prototype.__match=function(u,l){u.lastIndex=l;var s=u.exec(this.__input);return s&&!(w&&u.sticky)&&(s.index!==l&&(s=null)),s},g.prototype.test=function(u,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(u,l):!1},g.prototype.testChar=function(u,l){var s=this.peek(l);return u.lastIndex=0,s!==null&&u.test(s)},g.prototype.match=function(u){var l=this.__match(u,this.__position);return l?this.__position+=l[0].length:l=null,l},g.prototype.read=function(u,l,s){var i="",o;return u&&(o=this.match(u),o&&(i+=o[0])),l&&(o||!u)&&(i+=this.readUntil(l,s)),i},g.prototype.readUntil=function(u,l){var s="",i=this.__position;u.lastIndex=this.__position;var o=u.exec(this.__input);return o?(i=o.index,l&&(i+=o[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},g.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},g.prototype.get_regexp=function(u,l){var s=null,i="g";return l&&w&&(i="y"),typeof u=="string"&&u!==""?s=new RegExp(u,i):u&&(s=new RegExp(u.source,i)),s},g.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(u){var l=this.__position,s=this.readUntilAfter(u);return this.__position=l,s},g.prototype.lookBack=function(u){var l=this.__position-1;return l>=u.length&&this.__input.substring(l-u.length,l).toLowerCase()===u},e.exports.InputScanner=g},,,,,function(e){function w(g,u){g=typeof g=="string"?g:g.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+u,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(g);l;)u[l[1]]=l[2],l=this.__directive_pattern.exec(g);return u},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},,function(e,w,g){var u=g(16).Beautifier,l=g(17).Options;function s(i,o){var a=new u(i,o);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new l}},function(e,w,g){var u=g(17).Options,l=g(2).Output,s=g(8).InputScanner,i=g(13).Directives,o=new i(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,t=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,c=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function p(b,y){this._source_text=b||"",this._options=new u(y),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"]}p.prototype.eatString=function(b){var y="";for(this._ch=this._input.next();this._ch;){if(y+=this._ch,this._ch==="\\")y+=this._input.next();else if(b.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return y},p.prototype.eatWhitespace=function(b){for(var y=n.test(this._input.peek()),d=0;n.test(this._input.peek());)this._ch=this._input.next(),b&&this._ch===`
|
|
`&&((d===0||d<this._options.max_preserve_newlines)&&(d++,this._output.add_new_line(!0)));return y},p.prototype.foundNestedPseudoClass=function(){for(var b=0,y=1,d=this._input.peek(y);d;){if(d==="{")return!0;if(d==="(")b+=1;else if(d===")"){if(b===0)return!1;b-=1}else if(d===";"||d==="}")return!1;y++,d=this._input.peek(y)}return!1},p.prototype.print_string=function(b){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(b)},p.prototype.preserveSingleSpace=function(b){b&&(this._output.space_before_token=!0)},p.prototype.indent=function(){this._indentLevel++},p.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b=this._source_text,y=this._options.eol;y==="auto"&&(y=`
|
|
`,b&&a.test(b||"")&&(y=b.match(a)[0])),b=b.replace(r,`
|
|
`);var d=b.match(/^[\t ]*/)[0];this._output=new l(this._options,d),this._input=new s(b),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f=0,m=!1,h=!1,E=!1,_=!1,T=!1,k=!1,D=this._ch,x=!1,P,H,I;P=this._input.read(t),H=P!=="",I=D,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),D=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(v),$=o.get_directives(V);$&&$.ignore==="start"&&(V+=o.readIgnored(this._input)),this.print_string(V),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(c)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ge=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ge.match(/[ :]$/)&&(ge=this.eatString(": ").replace(/\s$/,""),this.print_string(ge),this._output.space_before_token=!0),ge=ge.replace(/\s$/,""),ge==="extend"?_=!0:ge==="import"&&(T=!0),ge in this.NESTED_AT_RULE?(this._nestedLevel+=1,ge in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!m&&f===0&&ge.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),E?(E=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&(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)):(I==="("?this._output.space_before_token=!1:I!==","&&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(),I==="{"&&this._output.trim(!0),T=!1,_=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),m=!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 te=0;te<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;te++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[te])){x=!0;break}(m||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!_&&f===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 be=I==='"'||I==="'";this.preserveSingleSpace(be||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,f===0?(h&&(this.outdent(),h=!1),_=!1,T=!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(),f++,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(")")),f&&(f--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(H||ve),this.print_string(this._ch),h&&I==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),k=!0):(this.eatWhitespace(),f++,this.indent())}else if(this._ch===")")f&&(f--,this.outdent()),k&&this._input.peek()===";"&&this._options.selector_separator_newline&&(k=!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||k)&&f===0&&!T&&!_?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&f===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&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.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 oe=I==='"'||I==="'";this.preserveSingleSpace(oe||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&x&&this._output.add_new_line()}var le=this._output.get_code(y);return le},e.exports.Beautifier=p},function(e,w,g){var u=g(6).Options;function l(s){u.call(this,s,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<o.length;a++)o[a]!=="expand"?this.brace_style="collapse":this.brace_style=o[a]}l.prototype=new u,e.exports.Options=l}],O={};function F(e){var w=O[e];if(w!==void 0)return w.exports;var g=O[e]={exports:{}};return S[e](g,g.exports,F),g.exports}var B=F(15);R=B})();var N=R;!(ue=[],W=function(){return{css_beautify:N}}.apply(ye,ue),W!==void 0&&(Ke.exports=W))})()},Vhoy:function(Ke,ye,j){"use strict";j.d(ye,"d",function(){return N}),j.d(ye,"e",function(){return S}),j.d(ye,"c",function(){return O}),j.d(ye,"b",function(){return F}),j.d(ye,"a",function(){return B});var ue=j("MI8n");class W{constructor(){this._icons=new Map,this._onDidRegister=new ue.b}add(e){const w=this._icons.get(e.id);w?e.description?w.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 R=new W,N=R;function S(e,w){return new F(e,w)}function O(e){return e?e.replace(/\$\((.*?)\)/g,(w,g)=>` ${g} `).trim():""}class F{constructor(e,w,g){this.id=e,this.definition=w,this.description=g,R.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var B;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const w=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(s){if(s instanceof F)return["codicon","codicon-"+s.id];const i=w.exec(s.id);if(!i)return g(F.error);let[,o,a]=i;const r=["codicon","codicon-"+o];return a&&r.push("codicon-modifier-"+a.substr(1)),r}e.asClassNameArray=g;function u(s){return g(s).join(" ")}e.asClassName=u;function l(s){return"."+g(s).join(".")}e.asCSSSelector=l})(B||(B={})),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"})}(F||(F={}))},WaYH:function(Ke,ye,j){"use strict";var ue=j("rePB"),W=j("Ff2n"),R=j("VTBJ"),N=j("1OyB"),S=j("vuIU"),O=j("JX7q"),F=j("Ji7U"),B=j("LK+K"),e=j("q1tI"),w=j("TSYQ"),g=j.n(w),u=j("sboe"),l=j("OZM5"),s=function(b){var y=b.prefixCls,d=b.level,f=b.isStart,m=b.isEnd;if(!d)return null;for(var h="".concat(y,"-indent-unit"),E=[],_=0;_<d;_+=1){var T;E.push(e.createElement("span",{key:_,className:g()(h,(T={},Object(ue.a)(T,"".concat(h,"-start"),f[_+1]),Object(ue.a)(T,"".concat(h,"-end"),m[_+1]),Object(ue.a)(T,"".concat(h,"-end-first-level"),!_&&m[0]),T))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(y,"-indent")},E)},i=s,o=j("815F"),a="open",r="close",n="---",t=function(p){Object(F.a)(y,p);var b=Object(B.a)(y);function y(){var d;return Object(N.a)(this,y),d=b.apply(this,arguments),d.state={dragNodeHighlight:!1},d.onSelectorClick=function(f){var m=d.props.context.onNodeClick;m(f,Object(o.b)(d.props)),d.isSelectable()?d.onSelect(f):d.onCheck(f)},d.onSelectorDoubleClick=function(f){var m=d.props.context.onNodeDoubleClick;m(f,Object(o.b)(d.props))},d.onSelect=function(f){if(d.isDisabled())return;var m=d.props.context.onNodeSelect;f.preventDefault(),m(f,Object(o.b)(d.props))},d.onCheck=function(f){if(d.isDisabled())return;var m=d.props,h=m.disableCheckbox,E=m.checked,_=d.props.context.onNodeCheck;if(!d.isCheckable()||h)return;f.preventDefault();var T=!E;_(f,Object(o.b)(d.props),T)},d.onMouseEnter=function(f){var m=d.props.context.onNodeMouseEnter;m(f,Object(o.b)(d.props))},d.onMouseLeave=function(f){var m=d.props.context.onNodeMouseLeave;m(f,Object(o.b)(d.props))},d.onContextMenu=function(f){var m=d.props.context.onNodeContextMenu;m(f,Object(o.b)(d.props))},d.onDragStart=function(f){var m=d.props.context.onNodeDragStart;f.stopPropagation(),d.setState({dragNodeHighlight:!0}),m(f,Object(O.a)(d));try{f.dataTransfer.setData("text/plain","")}catch(h){}},d.onDragEnter=function(f){var m=d.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),m(f,Object(O.a)(d))},d.onDragOver=function(f){var m=d.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),m(f,Object(O.a)(d))},d.onDragLeave=function(f){var m=d.props.context.onNodeDragLeave;f.stopPropagation(),m(f,Object(O.a)(d))},d.onDragEnd=function(f){var m=d.props.context.onNodeDragEnd;f.stopPropagation(),d.setState({dragNodeHighlight:!1}),m(f,Object(O.a)(d))},d.onDrop=function(f){var m=d.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),d.setState({dragNodeHighlight:!1}),m(f,Object(O.a)(d))},d.onExpand=function(f){var m=d.props.context.onNodeExpand;m(f,Object(o.b)(d.props))},d.setSelectHandle=function(f){d.selectHandle=f},d.getNodeState=function(){var f=d.props.expanded;return d.isLeaf()?null:f?a:r},d.hasChildren=function(){var f=d.props.eventKey,m=d.props.context.keyEntities,h=m[f]||{},E=h.children;return!!(E||[]).length},d.isLeaf=function(){var f=d.props,m=f.isLeaf,h=f.loaded,E=d.props.context.loadData,_=d.hasChildren();return m===!1?!1:m||!E&&!_||E&&h&&!_},d.isDisabled=function(){var f=d.props.disabled,m=d.props.context.disabled;return!!(m||f)},d.isCheckable=function(){var f=d.props.checkable,m=d.props.context.checkable;return!m||f===!1?!1:m},d.syncLoadData=function(f){var m=f.expanded,h=f.loading,E=f.loaded,_=d.props.context,T=_.loadData,k=_.onNodeLoad;if(h)return;T&&m&&!d.isLeaf()&&(!d.hasChildren()&&!E&&k(Object(o.b)(d.props)))},d.renderSwitcher=function(){var f=d.props,m=f.expanded,h=f.switcherIcon,E=d.props.context,_=E.prefixCls,T=E.switcherIcon,k=h||T;if(d.isLeaf())return e.createElement("span",{className:g()("".concat(_,"-switcher"),"".concat(_,"-switcher-noop"))},typeof k=="function"?k(Object(R.a)(Object(R.a)({},d.props),{},{isLeaf:!0})):k);var D=g()("".concat(_,"-switcher"),"".concat(_,"-switcher_").concat(m?a:r));return e.createElement("span",{onClick:d.onExpand,className:D},typeof k=="function"?k(Object(R.a)(Object(R.a)({},d.props),{},{isLeaf:!1})):k)},d.renderCheckbox=function(){var f=d.props,m=f.checked,h=f.halfChecked,E=f.disableCheckbox,_=d.props.context.prefixCls,T=d.isDisabled(),k=d.isCheckable();if(!k)return null;var D=typeof k!="boolean"?k:null;return e.createElement("span",{className:g()("".concat(_,"-checkbox"),m&&"".concat(_,"-checkbox-checked"),!m&&h&&"".concat(_,"-checkbox-indeterminate"),(T||E)&&"".concat(_,"-checkbox-disabled")),onClick:d.onCheck},D)},d.renderIcon=function(){var f=d.props.loading,m=d.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(m,"-iconEle"),"".concat(m,"-icon__").concat(d.getNodeState()||"docu"),f&&"".concat(m,"-icon_loading"))})},d.renderSelector=function(){var f=d.state.dragNodeHighlight,m=d.props,h=m.title,E=m.selected,_=m.icon,T=m.loading,k=m.data,D=d.props.context,x=D.prefixCls,P=D.showIcon,H=D.icon,I=D.draggable,V=D.loadData,$=D.titleRender,ge=d.isDisabled(),te="".concat(x,"-node-content-wrapper"),be;if(P){var ve=_||H;be=ve?e.createElement("span",{className:g()("".concat(x,"-iconEle"),"".concat(x,"-icon__customize"))},typeof ve=="function"?ve(d.props):ve):d.renderIcon()}else V&&T&&(be=d.renderIcon());var oe;typeof h=="function"?oe=h(k):$?oe=$(k):oe=h;var le=e.createElement("span",{className:"".concat(x,"-title")},oe);return e.createElement("span",{ref:d.setSelectHandle,title:typeof h=="string"?h:"",className:g()("".concat(te),"".concat(te,"-").concat(d.getNodeState()||"normal"),!ge&&(E||f)&&"".concat(x,"-node-selected"),!ge&&I&&"draggable"),draggable:!ge&&I||void 0,"aria-grabbed":!ge&&I||void 0,onMouseEnter:d.onMouseEnter,onMouseLeave:d.onMouseLeave,onContextMenu:d.onContextMenu,onClick:d.onSelectorClick,onDoubleClick:d.onSelectorDoubleClick,onDragStart:I?d.onDragStart:void 0},be,le)},d}return Object(S.a)(y,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var f=this.props.selectable,m=this.props.context.selectable;return typeof f=="boolean"?f:m}},{key:"render",value:function(){var f,m=this.props,h=m.eventKey,E=m.className,_=m.style,T=m.dragOver,k=m.dragOverGapTop,D=m.dragOverGapBottom,x=m.isLeaf,P=m.isStart,H=m.isEnd,I=m.expanded,V=m.selected,$=m.checked,ge=m.halfChecked,te=m.loading,be=m.domRef,ve=m.active,oe=m.onMouseMove,le=Object(W.a)(m,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,ee=_e.prefixCls,L=_e.filterTreeNode,A=_e.draggable,C=_e.keyEntities,U=this.isDisabled(),K=Object(l.f)(le),M=C[h]||{},ie=M.level,Ee=H[H.length-1];return e.createElement("div",Object.assign({ref:be,className:g()(E,"".concat(ee,"-treenode"),(f={},Object(ue.a)(f,"".concat(ee,"-treenode-disabled"),U),Object(ue.a)(f,"".concat(ee,"-treenode-switcher-").concat(I?"open":"close"),!x),Object(ue.a)(f,"".concat(ee,"-treenode-checkbox-checked"),$),Object(ue.a)(f,"".concat(ee,"-treenode-checkbox-indeterminate"),ge),Object(ue.a)(f,"".concat(ee,"-treenode-selected"),V),Object(ue.a)(f,"".concat(ee,"-treenode-loading"),te),Object(ue.a)(f,"".concat(ee,"-treenode-active"),ve),Object(ue.a)(f,"".concat(ee,"-treenode-leaf-last"),Ee),Object(ue.a)(f,"drag-over",!U&&T),Object(ue.a)(f,"drag-over-gap-top",!U&&k),Object(ue.a)(f,"drag-over-gap-bottom",!U&&D),Object(ue.a)(f,"filter-node",L&&L(Object(o.b)(this.props))),f)),style:_,onDragEnter:A?this.onDragEnter:void 0,onDragOver:A?this.onDragOver:void 0,onDragLeave:A?this.onDragLeave:void 0,onDrop:A?this.onDrop:void 0,onDragEnd:A?this.onDragEnd:void 0,onMouseMove:oe},K),e.createElement(i,{prefixCls:ee,level:ie,isStart:P,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),y}(e.Component),v=function(b){return e.createElement(u.a.Consumer,null,function(y){return e.createElement(t,Object.assign({},b,{context:y}))})};v.displayName="TreeNode",v.defaultProps={title:n},v.isTreeNode=1;var c=ye.a=v},Y1PL:function(Ke,ye,j){"use strict";j.r(ye),j.d(ye,"ResizableTextArea",function(){return ge});var ue=j("wx14"),W=j("1OyB"),R=j("vuIU"),N=j("Ji7U"),S=j("LK+K"),O=j("q1tI"),F=j("VTBJ"),B=j("rePB"),e=j("Zm9Q"),w=j("Kwbf"),g=j("c+Xe"),u=j("m+aA"),l=j("bdgK"),s=new Map;function i(ve){ve.forEach(function(oe){var le,_e=oe.target;(le=s.get(_e))===null||le===void 0||le.forEach(function(ee){return ee(_e)})})}var o=new l.default(i),a=null,r=null;function n(ve,oe){s.has(ve)||(s.set(ve,new Set),o.observe(ve)),s.get(ve).add(oe)}function t(ve,oe){s.has(ve)&&(s.get(ve).delete(oe),s.get(ve).size||(o.unobserve(ve),s.delete(ve)))}var v=function(ve){Object(N.a)(le,ve);var oe=Object(S.a)(le);function le(){return Object(W.a)(this,le),oe.apply(this,arguments)}return Object(R.a)(le,[{key:"render",value:function(){return this.props.children}}]),le}(O.Component),c=O.createContext(null);function p(ve){var oe=ve.children,le=ve.onBatchResize,_e=O.useRef(0),ee=O.useRef([]),L=O.useContext(c),A=O.useCallback(function(C,U,K){_e.current+=1;var M=_e.current;ee.current.push({size:C,element:U,data:K}),Promise.resolve().then(function(){M===_e.current&&(le==null||le(ee.current),ee.current=[])}),L==null||L(C,U,K)},[le,L]);return O.createElement(c.Provider,{value:A},oe)}function b(ve){var oe=ve.children,le=ve.disabled,_e=O.useRef(null),ee=O.useRef(null),L=O.useContext(c),A=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),C=O.isValidElement(oe)&&Object(g.c)(oe),U=C?oe.ref:null,K=O.useMemo(function(){return Object(g.a)(U,_e)},[U,_e]),M=O.useRef(ve);M.current=ve;var ie=O.useCallback(function(Ee){var Oe=M.current,q=Oe.onResize,ce=Oe.data,Se=Ee.getBoundingClientRect(),Ce=Se.width,Pe=Se.height,Ne=Ee.offsetWidth,Ie=Ee.offsetHeight,Me=Math.floor(Ce),He=Math.floor(Pe);if(A.current.width!==Me||A.current.height!==He||A.current.offsetWidth!==Ne||A.current.offsetHeight!==Ie){var We={width:Me,height:He,offsetWidth:Ne,offsetHeight:Ie};A.current=We;var Ge=Ne===Math.round(Ce)?Ce:Ne,Be=Ie===Math.round(Pe)?Pe:Ie,Xe=Object(F.a)(Object(F.a)({},We),{},{offsetWidth:Ge,offsetHeight:Be});L==null||L(Xe,Ee,ce),q&&Promise.resolve().then(function(){q(Xe,Ee)})}},[]);return O.useEffect(function(){var Ee=Object(u.a)(_e.current)||Object(u.a)(ee.current);return Ee&&!le&&n(Ee,ie),function(){return t(Ee,ie)}},[_e.current,le]),O.createElement(v,{ref:ee},C?O.cloneElement(oe,{ref:K}):oe)}var y="rc-observer-key";function d(ve){var oe=ve.children,le=Object(e.a)(oe);return le.map(function(_e,ee){var L=(_e==null?void 0:_e.key)||"".concat(y,"-").concat(ee);return O.createElement(b,Object(ue.a)({},ve,{key:L}),_e)})}d.Collection=p;var f=d,m=j("bT9E"),h=j("TSYQ"),E=j.n(h),_=`
|
|
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
|
|
`,T=["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"],k={},D;function x(ve){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(oe&&k[le])return k[le];var _e=window.getComputedStyle(ve),ee=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),L=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),A=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),C=T.map(function(K){return"".concat(K,":").concat(_e.getPropertyValue(K))}).join(";"),U={sizingStyle:C,paddingSize:L,borderSize:A,boxSizing:ee};return oe&&le&&(k[le]=U),U}function P(ve){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;D||(D=document.createElement("textarea"),D.setAttribute("tab-index","-1"),D.setAttribute("aria-hidden","true"),document.body.appendChild(D)),ve.getAttribute("wrap")?D.setAttribute("wrap",ve.getAttribute("wrap")):D.removeAttribute("wrap");var ee=x(ve,oe),L=ee.paddingSize,A=ee.borderSize,C=ee.boxSizing,U=ee.sizingStyle;D.setAttribute("style","".concat(U,";").concat(_)),D.value=ve.value||ve.placeholder||"";var K=Number.MIN_SAFE_INTEGER,M=Number.MAX_SAFE_INTEGER,ie=D.scrollHeight,Ee;if(C==="border-box"?ie+=A:C==="content-box"&&(ie-=L),le!==null||_e!==null){D.value=" ";var Oe=D.scrollHeight-L;le!==null&&(K=Oe*le,C==="border-box"&&(K=K+L+A),ie=Math.max(K,ie)),_e!==null&&(M=Oe*_e,C==="border-box"&&(M=M+L+A),Ee=ie>M?"":"hidden",ie=Math.min(M,ie))}return{height:ie,minHeight:K,maxHeight:M,overflowY:Ee,resize:"none"}}var H=j("Gytx"),I=j.n(H),V;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(V||(V={}));var $=function(ve){Object(N.a)(le,ve);var oe=Object(S.a)(le);function le(_e){var ee;return Object(W.a)(this,le),ee=oe.call(this,_e),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(L){ee.textArea=L},ee.handleResize=function(L){var A=ee.state.resizeStatus,C=ee.props,U=C.autoSize,K=C.onResize;if(A!==V.NONE)return;typeof K=="function"&&K(L),U&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var L=ee.props.autoSize;if(!L||!ee.textArea)return;var A=L.minRows,C=L.maxRows,U=P(ee.textArea,!1,A,C);ee.setState({textareaStyles:U,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:V.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:V.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var L=ee.props,A=L.prefixCls,C=A===void 0?"rc-textarea":A,U=L.autoSize,K=L.onResize,M=L.className,ie=L.disabled,Ee=ee.state,Oe=Ee.textareaStyles,q=Ee.resizeStatus,ce=Object(m.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Se=E()(C,M,Object(B.a)({},"".concat(C,"-disabled"),ie));"value"in ce&&(ce.value=ce.value||"");var Ce=Object(F.a)(Object(F.a)(Object(F.a)({},ee.props.style),Oe),q===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(f,{onResize:ee.handleResize,disabled:!(U||K)},O.createElement("textarea",Object(ue.a)({},ce,{className:Se,style:Ce,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:V.NONE},ee}return Object(R.a)(le,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!I()(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,L=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,L)}}catch(A){}}},{key:"render",value:function(){return this.renderTextArea()}}]),le}(O.Component),ge=$,te=function(ve){Object(N.a)(le,ve);var oe=Object(S.a)(le);function le(_e){var ee;Object(W.a)(this,le),ee=oe.call(this,_e),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(A){ee.resizableTextArea=A},ee.handleChange=function(A){var C=ee.props.onChange;ee.setValue(A.target.value,function(){ee.resizableTextArea.resizeTextarea()}),C&&C(A)},ee.handleKeyDown=function(A){var C=ee.props,U=C.onPressEnter,K=C.onKeyDown;A.keyCode===13&&U&&U(A),K&&K(A)};var L=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return ee.state={value:L},ee}return Object(R.a)(le,[{key:"setValue",value:function(ee,L){"value"in this.props||this.setState({value:ee},L)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(ge,Object(ue.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}}]),le}(O.Component),be=ye.default=te},ZW9T:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return H});var ue=j("k1fw"),W=j("oBTY"),R=j("miYZ"),N=j("tsqr"),S=j("rAM+"),O=j("tJVT"),F=j("PpiC"),B=j("q1tI"),e=j.n(B),w=j("bdgK"),g=j("9og8"),u=j("WmNS"),l=j.n(u),s={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"]},i={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"]},o={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=j("5VLF"),n=j.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"]}},v=function(V,$){return $.map(function(ge){return{label:ge,kind:V.languages.CompletionItemKind.Keyword,insertText:ge}})},c=function(V){return Object.keys(t.tables).map(function($){return{label:$,kind:V.languages.CompletionItemKind.Variable,insertText:$}})},p=function(V,$){var ge=t.tables[V];return ge?ge.map(function(te){return{label:te,kind:$.languages.CompletionItemKind.Field,insertText:te}}):[]};function b(I,V,$,ge,te){var be=V.getWordUntilPosition($),ve={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:be.startColumn,endColumn:be.endColumn},oe=ge.map(function(le){return{label:le,kind:I.languages.CompletionItemKind.Keyword,insertText:le,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return te.map(function(le){oe.push(Object(ue.a)(Object(ue.a)({},le),{},{range:ve}))}),oe}var y=function(I){t.languages.map(function(te){return I.languages.registerDocumentFormattingEditProvider(te,{provideDocumentFormattingEdits:function(ve,oe,le){return Object(g.a)(l.a.mark(function _e(){var ee;return l.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return ee=n()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),A.abrupt("return",[{range:ve.getFullModelRange(),text:ee}]);case 2:case"end":return A.stop()}},_e)}))()}}),te});var V=o.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=a.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ge=i.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}});I.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(be,ve){var oe=be.getWordUntilPosition(ve),le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:oe.startColumn,endColumn:oe.endColumn},_e=be.getLineContent(ve.lineNumber).substring(oe.startColumn-2,oe.endColumn);return{suggestions:[].concat(Object(W.a)(o.keywords.map(function(ee){return{label:ee,kind:I.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})),Object(W.a)(o.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Function,documentation:ee.content,insertText:_e.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})))}}}),I.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(be,ve){var oe=be.getWordUntilPosition(ve),le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:oe.startColumn,endColumn:oe.endColumn};return{suggestions:Object(W.a)(s.keywords.map(function(_e){return{label:_e,kind:I.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}}))}}}),I.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(be,ve){var oe=be.getWordUntilPosition(ve),le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:oe.startColumn,endColumn:oe.endColumn},_e=be.getLineContent(ve.lineNumber).substring(oe.startColumn-2,oe.endColumn);return{suggestions:[].concat(Object(W.a)(i.keywords.map(function(ee){return{label:ee,kind:I.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})),Object(W.a)(i.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Function,documentation:ee.content,insertText:_e.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})))}}}),I.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(be,ve){var oe=be.getWordUntilPosition(ve),le={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:oe.startColumn,endColumn:oe.endColumn},_e=be.getLineContent(ve.lineNumber).substring(oe.startColumn-2,oe.endColumn);return{suggestions:[].concat(Object(W.a)(a.keywords.map(function(ee){return{label:ee,kind:I.languages.CompletionItemKind.Function,documentation:ee,insertText:ee,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})),Object(W.a)(a.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Function,documentation:ee.content,insertText:_e.startsWith("#")?ee.content.replace(/#/,""):ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}})))}}})},d="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",f=j("fjLI"),m=j("LvDl"),h=j("+ua5");function E(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}function _(){}var T=!1,k={"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 D(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=I;if(Array.isArray(I)){for(var $=0;$<I.length;$++){var ge=k[I[$]];if(ge)return ge}return V[0]}return k[V]||V}var x=null,P=ye.b=function(I){var V=I.width,$=V===void 0?"100%":V,ge=I.height,te=ge===void 0?"100%":ge,be=I.value,ve=I.language,oe=ve===void 0?"javascript":ve,le=I.style,_e=le===void 0?{}:le,ee=I.options,L=ee===void 0?{}:ee,A=I.overrideServices,C=A===void 0?{}:A,U=I.theme,K=U===void 0?"vs-dark":U,M=I.onEditBlur,ie=I.onSave,Ee=I.autoHeight,Oe=Ee===void 0?!1:Ee,q=I.forbidCopy,ce=q===void 0?!1:q,Se=I.onChange,Ce=Se===void 0?_:Se,Pe=I.editorDidMount,Ne=Pe===void 0?_:Pe,Ie=I.onFocus,Me=Ie===void 0?_:Ie,He=I.filename,We=He===void 0?"educoder.txt":He,Ge=I.errorLine,Be=I.errorContent,Xe=Be===void 0?"":Be,Ye=Object(F.a)(I,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ne=Object(B.useRef)(),z=Object(B.useRef)({}),G=Object(B.useRef)(),J=Object(B.useRef)(),re=Object(B.useRef)(!1),Y=Object(B.useRef)(),Z=Object(B.useState)(!1),se=Object(O.a)(Z,2),he=se[0],De=se[1];function Re(){var Ze;return ne.current&&(Ze=new w.default(function(it){var ft=Object(S.a)(it),It;try{for(ft.s();!(It=ft.n()).done;){var $t=It.value;($t.target.offsetHeight>0||$t.target.offsetWidth>0)&&z.current.instance.layout()}}catch(ln){ft.e(ln)}finally{ft.f()}}),Ze.observe(ne.current)),Ze}function Ue(){N.b.warn(decodeURIComponent(d))}var Ve=function(){var it=z.current.instance;if(be!=null&&it&&he){var ft=it.getModel();ft&&be!==ft.getValue()&&(T=!0,ft.setValue(be),it.layout(),T=!1)}};Object(B.useEffect)(function(){J.current&&clearTimeout(J.current),J.current=setTimeout(function(){Ve()},500)},[be,he,z.current]),Object(B.useEffect)(function(){if(Ge&&z.current&&z.current.instance){var Ze=z.current.instance;Ze.changeViewZones(function(ft){var It=document.createElement("div");It.style.padding="10px 20px",It.style.width="calc(100% - 20px)",It.className="my-error-line-wrp",It.innerHTML=Xe,ft.addZone({afterLineNumber:Ge||11,heightInLines:3,domNode:It})});var it={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}};Ze.addOverlayWidget(it),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[Ge,z.current,he]);function Je(){var Ze=z.current.instance;if(Ze){var it=Ze.getSelection(),ft=z.current.pastePos||{},It=new x.Range(ft.startLineNumber||it.endLineNumber,ft.startColumn||it.endColumn,ft.endLineNumber||it.endLineNumber,ft.endColumn||it.endColumn);setTimeout(function(){Ze.executeEdits("",[{range:It,text:""}])},300)}}function Qe(Ze){(window.navigator.platform.match("Mac")?Ze.metaKey:Ze.ctrlKey)&&Ze.keyCode==83&&(Ze.preventDefault(),ie())}var ht=function(){if(Oe&&z.current.instance){var it=z.current.instance.getContentHeight();Vt(it<te?te:it)}else Vt(te)};function st(Ze){var it=document.createEvent("MouseEvents");it.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ze.dispatchEvent(it)}function qe(Ze,it){var ft=window.URL||window.webkitURL||window,It=new Blob([it]),$t=document.createElementNS("http://www.w3.org/1999/xhtml","a");$t.href=ft.createObjectURL(It),$t.download=Ze,st($t)}Object(B.useEffect)(function(){ht()},[ht]),Object(B.useEffect)(function(){ne.current&&!he&&Promise.all([j.e(17),j.e(29)]).then(j.t.bind(null,"M/lh",7)).then(function(Ze){try{x=Ze,z.current.instance=x.editor.create(ne.current,{value:be,language:D(oe),theme:K,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},C);var it=z.current.instance,ft=f.d._menuItems,It=Object(W.a)(ft).find(function(yt){return yt[0]._debugName=="EditorContext"}),$t=It[1],ln=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Nt=function(ut,Qt){var Rt=ut._first;do{var dn,Kt,gn=Qt.includes((dn=Rt.element)===null||dn===void 0||((Kt=dn.command)===null||Kt===void 0)?void 0:Kt.id);gn&&ut._remove(Rt)}while(Rt=Rt.next)};if(Ne(it,x),setTimeout(function(){ht(),z.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){qe(We||"educoder.txt",it.getValue())}}),it.getDomNode().addEventListener("input",function(){G.current.autoFormat&&it.getAction("editor.action.formatDocument").run()})},500),z.current.subscription=it.onDidChangeModelContent(function(yt){re.current?clearTimeout(Y.current):(ht(),Ce(it.getValue(),yt)),Y.current=setTimeout(function(){re.current=!1},500)}),window.Monaco||y(x,D(oe)),ce&&(Nt($t,ln),ne.current.classList.add("noCopyPaste"),it.onKeyDown(function(yt){var ut=yt.keyCode,Qt=yt.ctrlKey,Rt=yt.metaKey;(ut===33||ut===52)&&(Rt||Qt)&&(Ue(),yt.preventDefault())})),window.Monaco=x,M&&it.onDidBlurEditorWidget(function(){M(it.getValue())}),Me&&it.onDidFocusEditorText(function(){Me(it.getValue())}),ce){it.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return Ue(),null}),it.onDidPaste(function(yt){z.current.pastePos=yt});try{window.addEventListener("paste",Je)}catch(yt){}}var pt=Re();return De(!0),function(){var yt=z.current.instance;yt.dispose();var ut=yt.getModel();ut&&ut.dispose(),z.current.subscription&&z.current.subscription.dispose(),ce&&window.removeEventListener("paste",Je),pt.unobserve(ne.current)}}catch(yt){}})},[]),Object(B.useEffect)(function(){var Ze=z.current.instance;if(Ze&&he)return document.addEventListener("keydown",Qe,!1),function(){document.removeEventListener("keydown",Qe)}},[ie,he]),Object(B.useEffect)(function(){var Ze=z.current.instance;if(Ze&&he){var it=D(oe);x.editor.setModelLanguage(Ze.getModel(),it),console.log("language:",oe,Ze.getModel(),it)}},[oe,he]),Object(B.useEffect)(function(){var Ze=z.current.instance;Ze&&he&&x.editor.setTheme(K)},[K,he]),Object(B.useEffect)(function(){var Ze=z.current.instance;G.current=L,Ze&&he&&(Ze.updateOptions(Object(ue.a)({},L)),setTimeout(function(){Ze.getModel().updateOptions(Object(ue.a)({},L))},200))},[JSON.stringify(L),he]),Object(B.useEffect)(function(){var Ze=z.current.instance;Ze&&he&&Ze.layout()},[$,te,he]);var Ut=Object(B.useState)(E($)),Et=Object(O.a)(Ut,2),Ft=Et[0],kt=Et[1],ot=Object(B.useState)(E(te)),jt=Object(O.a)(ot,2),Jt=jt[0],Vt=jt[1],rn=Object(ue.a)(Object(ue.a)({},_e),{},{width:Ft,height:Jt});return e.a.createElement("div",{className:"my-monaco-editor",ref:ne,style:rn})};function H(I){var V=I.width,$=V===void 0?"100%":V,ge=I.height,te=ge===void 0?"100%":ge,be=I.original,ve=I.modified,oe=I.language,le=I.options,_e=le===void 0?{}:le,ee=Object(B.useRef)(),L=Object(B.useState)(null),A=Object(O.a)(L,2),C=A[0],U=A[1];function K(Oe){var q;return ee.current&&(q=new w.default(function(ce){var Se=Object(S.a)(ce),Ce;try{for(Se.s();!(Ce=Se.n()).done;){var Pe=Ce.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&Oe.layout()}}catch(Ne){Se.e(Ne)}finally{Se.f()}}),q.observe(ee.current)),q}Object(B.useEffect)(function(){ee.current&&Promise.all([j.e(17),j.e(29)]).then(j.t.bind(null,"M/lh",7)).then(function(Oe){x=Oe;var q=x.editor.createDiffEditor(ee.current,Object(ue.a)(Object(ue.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},_e),{},{wordWrap:!0}));U(q);var ce=K(q);return function(){q.dispose();var Se=q.getModel();Se&&Se.dispose(),ce.unobserve(ee.current)}})},[]),Object(B.useEffect)(function(){C&&C.setModel({original:x.editor.createModel(be,oe),modified:x.editor.createModel(ve,oe)})},[be,ve,oe,C]);var M=E($),ie=E(te),Ee={width:M,height:ie};return e.a.createElement("div",{className:"my-diff-editor",ref:ee,style:Ee})}},bT9E:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return W});var ue=j("VTBJ");function W(R,N){var S=Object(ue.a)({},R);return Array.isArray(N)&&N.forEach(function(O){delete S[O]}),S}},d5o6:function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},fAei:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return t.a});var ue=j("rePB"),W=j("VTBJ"),R=j("KQm4"),N=j("1OyB"),S=j("vuIU"),O=j("Ji7U"),F=j("LK+K"),B=j("q1tI"),e=j("4IlW"),w=j("Kwbf"),g=j("TSYQ"),u=j.n(g),l=j("sboe"),s=j("OZM5"),i=j("815F"),o=j("ODXe"),a=j("Ff2n"),r=j("+nKL"),n=j("8XRh"),t=j("WaYH"),v=function(be,ve){var oe=be.className,le=be.style,_e=be.motion,ee=be.motionNodes,L=be.motionType,A=be.onMotionStart,C=be.onMotionEnd,U=be.active,K=be.treeNodeRequiredProps,M=Object(a.a)(be,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ie=B.useState(!0),Ee=Object(o.a)(ie,2),Oe=Ee[0],q=Ee[1],ce=B.useContext(l.a),Se=ce.prefixCls,Ce=B.useRef(!1),Pe=function(){Ce.current||C(),Ce.current=!0};return Object(B.useEffect)(function(){ee&&L==="hide"&&Oe&&q(!1)},[ee]),Object(B.useEffect)(function(){return ee&&A(),function(){ee&&Pe()}},[]),ee?B.createElement(n.default,Object.assign({ref:ve,visible:Oe},_e,{motionAppear:L==="show",onAppearEnd:Pe,onLeaveEnd:Pe}),function(Ne,Ie){var Me=Ne.className,He=Ne.style;return B.createElement("div",{ref:Ie,className:u()("".concat(Se,"-treenode-motion"),Me),style:He},ee.map(function(We){var Ge=We.data,Be=Ge.key,Xe=Object(a.a)(Ge,["key"]),Ye=We.isStart,ne=We.isEnd;delete Xe.children;var z=Object(i.f)(Be,K);return B.createElement(t.a,Object.assign({},Xe,z,{active:U,data:We.data,key:Be,isStart:Ye,isEnd:ne}))}))}):B.createElement(t.a,Object.assign({domRef:ve,className:oe,style:le},M,{active:U}))};v.displayName="MotionTreeNode";var c=B.forwardRef(v),p=c;function b(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ve=te.length,oe=be.length;if(Math.abs(ve-oe)!==1)return{add:!1,key:null};function le(_e,ee){var L=new Map;_e.forEach(function(C){L.set(C,!0)});var A=ee.filter(function(C){return!L.has(C)});return A.length===1?A[0]:null}return ve<oe?{add:!0,key:le(te,be)}:{add:!1,key:le(be,te)}}function y(te,be,ve){var oe=te.findIndex(function(L){var A=L.data;return A.key===ve}),le=te[oe+1],_e=be.findIndex(function(L){var A=L.data;return A.key===ve});if(le){var ee=be.findIndex(function(L){var A=L.data;return A.key===le.data.key});return be.slice(_e+1,ee)}return be.slice(_e+1)}var d={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},f=function(){},m="RC_TREE_MOTION_".concat(Math.random()),h={key:m},E={key:m,level:0,index:0,pos:"0",node:h},_={parent:null,children:[],pos:E.pos,data:h,isStart:[],isEnd:[]};function T(te,be,ve,oe){return be===!1||!ve?te:te.slice(0,Math.ceil(ve/oe)+1)}function k(te){var be=te.data.key,ve=te.pos;return Object(i.e)(be,ve)}function D(te){for(var be=String(te.data.key),ve=te;ve.parent;)ve=ve.parent,be="".concat(ve.data.key," > ").concat(be);return be}var x=function(be,ve){var oe=be.prefixCls,le=be.data,_e=be.selectable,ee=be.checkable,L=be.expandedKeys,A=be.selectedKeys,C=be.checkedKeys,U=be.loadedKeys,K=be.loadingKeys,M=be.halfCheckedKeys,ie=be.keyEntities,Ee=be.disabled,Oe=be.dragging,q=be.dragOverNodeKey,ce=be.dropPosition,Se=be.motion,Ce=be.height,Pe=be.itemHeight,Ne=be.virtual,Ie=be.focusable,Me=be.activeItem,He=be.focused,We=be.tabIndex,Ge=be.onKeyDown,Be=be.onFocus,Xe=be.onBlur,Ye=be.onActiveChange,ne=be.onListChangeStart,z=be.onListChangeEnd,G=Object(a.a)(be,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),J=B.useRef(null);B.useImperativeHandle(ve,function(){return{scrollTo:function(it){J.current.scrollTo(it)}}});var re=B.useState(L),Y=Object(o.a)(re,2),Z=Y[0],se=Y[1],he=B.useState(le),De=Object(o.a)(he,2),Re=De[0],Ue=De[1],Ve=B.useState(le),Je=Object(o.a)(Ve,2),Qe=Je[0],ht=Je[1],st=B.useState([]),qe=Object(o.a)(st,2),Ut=qe[0],Et=qe[1],Ft=B.useState(null),kt=Object(o.a)(Ft,2),ot=kt[0],jt=kt[1];function Jt(){Ue(le),ht(le),Et([]),jt(null),z()}B.useEffect(function(){se(L);var Ze=b(Z,L);if(Ze.key!==null)if(Ze.add){var it=Re.findIndex(function(pt){var yt=pt.data.key;return yt===Ze.key}),ft=T(y(Re,le,Ze.key),Ne,Ce,Pe),It=Re.slice();It.splice(it+1,0,_),ht(It),Et(ft),jt("show")}else{var $t=le.findIndex(function(pt){var yt=pt.data.key;return yt===Ze.key}),ln=T(y(le,Re,Ze.key),Ne,Ce,Pe),Nt=le.slice();Nt.splice($t+1,0,_),ht(Nt),Et(ln),jt("hide")}else Re!==le&&(Ue(le),ht(le))},[L,le]),B.useEffect(function(){Oe||Jt()},[Oe]);var Vt=Se?Qe:le,rn={expandedKeys:L,selectedKeys:A,loadedKeys:U,loadingKeys:K,checkedKeys:C,halfCheckedKeys:M,dragOverNodeKey:q,dropPosition:ce,keyEntities:ie};return B.createElement(B.Fragment,null,He&&Me&&B.createElement("span",{style:d,"aria-live":"assertive"},D(Me)),B.createElement("div",{role:"tree"},B.createElement("input",{style:d,disabled:Ie===!1||Ee,tabIndex:Ie!==!1?We:null,onKeyDown:Ge,onFocus:Be,onBlur:Xe,value:"",onChange:f})),B.createElement(r.a,Object.assign({},G,{data:Vt,itemKey:k,height:Ce,fullHeight:!1,virtual:Ne,itemHeight:Pe,prefixCls:"".concat(oe,"-list"),ref:J}),function(Ze){var it=Ze.pos,ft=Ze.data,It=ft.key,$t=Object(a.a)(ft,["key"]),ln=Ze.isStart,Nt=Ze.isEnd,pt=Object(i.e)(It,it);delete $t.children;var yt=Object(i.f)(pt,rn);return B.createElement(p,Object.assign({},$t,yt,{active:Me&&It===Me.data.key,pos:it,data:Ze.data,isStart:ln,isEnd:Nt,motion:Se,motionNodes:It===m?Ut:null,motionType:ot,onMotionStart:ne,onMotionEnd:Jt,treeNodeRequiredProps:rn,onMouseMove:function(){Ye(null)}}))}))},P=B.forwardRef(x);P.displayName="NodeList";var H=P,I=j("NvD2"),V=function(te){Object(O.a)(ve,te);var be=Object(F.a)(ve);function ve(){var oe;return Object(N.a)(this,ve),oe=be.apply(this,arguments),oe.destroyed=!1,oe.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},oe.listRef=B.createRef(),oe.onNodeDragStart=function(le,_e){var ee=oe.state,L=ee.expandedKeys,A=ee.keyEntities,C=oe.props.onDragStart,U=_e.props.eventKey;oe.dragNode=_e;var K=Object(s.b)(L,U);oe.setState({dragging:!0,dragNodesKeys:Object(s.g)(U,A)}),oe.setExpandedKeys(K),C&&C({event:le,node:Object(i.b)(_e.props)})},oe.onNodeDragEnter=function(le,_e){var ee=oe.state,L=ee.expandedKeys,A=ee.keyEntities,C=ee.dragNodesKeys,U=oe.props.onDragEnter,K=_e.props,M=K.pos,ie=K.eventKey;if(!oe.dragNode||C.indexOf(ie)!==-1)return;var Ee=Object(s.c)(le,_e);if(oe.dragNode.props.eventKey===ie&&Ee===0){oe.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){oe.setState({dragOverNodeKey:ie,dropPosition:Ee}),oe.delayedDragEnterLogic||(oe.delayedDragEnterLogic={}),Object.keys(oe.delayedDragEnterLogic).forEach(function(Oe){clearTimeout(oe.delayedDragEnterLogic[Oe])}),oe.delayedDragEnterLogic[M]=window.setTimeout(function(){if(!oe.state.dragging)return;var Oe=Object(R.a)(L),q=A[ie];q&&(q.children||[]).length&&(Oe=Object(s.a)(L,ie)),"expandedKeys"in oe.props||oe.setExpandedKeys(Oe),U&&U({event:le,node:Object(i.b)(_e.props),expandedKeys:Oe})},400)},0)},oe.onNodeDragOver=function(le,_e){var ee=oe.state.dragNodesKeys,L=oe.props.onDragOver,A=_e.props.eventKey;if(ee.indexOf(A)!==-1)return;if(oe.dragNode&&A===oe.state.dragOverNodeKey){var C=Object(s.c)(le,_e);if(C===oe.state.dropPosition)return;oe.setState({dropPosition:C})}L&&L({event:le,node:Object(i.b)(_e.props)})},oe.onNodeDragLeave=function(le,_e){var ee=oe.props.onDragLeave;oe.setState({dragOverNodeKey:""}),ee&&ee({event:le,node:Object(i.b)(_e.props)})},oe.onNodeDragEnd=function(le,_e){var ee=oe.props.onDragEnd;oe.setState({dragOverNodeKey:""}),oe.cleanDragState(),ee&&ee({event:le,node:Object(i.b)(_e.props)}),oe.dragNode=null},oe.onNodeDrop=function(le,_e){var ee=oe.state,L=ee.dragNodesKeys,A=L===void 0?[]:L,C=ee.dropPosition,U=oe.props.onDrop,K=_e.props,M=K.eventKey,ie=K.pos;if(oe.setState({dragOverNodeKey:""}),oe.cleanDragState(),A.indexOf(M)!==-1){Object(w.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ee=Object(s.k)(ie),Oe={event:le,node:Object(i.b)(_e.props),dragNode:oe.dragNode?Object(i.b)(oe.dragNode.props):null,dragNodesKeys:A.slice(),dropPosition:C+Number(Ee[Ee.length-1]),dropToGap:!1};C!==0&&(Oe.dropToGap=!0),U&&U(Oe),oe.dragNode=null},oe.cleanDragState=function(){var le=oe.state.dragging;le&&oe.setState({dragging:!1})},oe.onNodeClick=function(le,_e){var ee=oe.props.onClick;ee&&ee(le,_e)},oe.onNodeDoubleClick=function(le,_e){var ee=oe.props.onDoubleClick;ee&&ee(le,_e)},oe.onNodeSelect=function(le,_e){var ee=oe.state.selectedKeys,L=oe.state.keyEntities,A=oe.props,C=A.onSelect,U=A.multiple,K=_e.selected,M=_e.key,ie=!K;ie?U?ee=Object(s.a)(ee,M):ee=[M]:ee=Object(s.b)(ee,M);var Ee=ee.map(function(Oe){var q=L[Oe];return q?q.node:null}).filter(function(Oe){return Oe});oe.setUncontrolledState({selectedKeys:ee}),C&&C(ee,{event:"select",selected:ie,node:_e,selectedNodes:Ee,nativeEvent:le.nativeEvent})},oe.onNodeCheck=function(le,_e,ee){var L=oe.state,A=L.keyEntities,C=L.checkedKeys,U=L.halfCheckedKeys,K=oe.props,M=K.checkStrictly,ie=K.onCheck,Ee=_e.key,Oe,q={event:"check",node:_e,checked:ee,nativeEvent:le.nativeEvent};if(M){var ce=ee?Object(s.a)(C,Ee):Object(s.b)(C,Ee),Se=Object(s.b)(U,Ee);Oe={checked:ce,halfChecked:Se},q.checkedNodes=ce.map(function(He){return A[He]}).filter(function(He){return He}).map(function(He){return He.node}),oe.setUncontrolledState({checkedKeys:ce})}else{var Ce=Object(I.a)([].concat(Object(R.a)(C),[Ee]),!0,A),Pe=Ce.checkedKeys,Ne=Ce.halfCheckedKeys;if(!ee){var Ie=new Set(Pe);Ie.delete(Ee);var Me=Object(I.a)(Array.from(Ie),{checked:!1,halfCheckedKeys:Ne},A);Pe=Me.checkedKeys,Ne=Me.halfCheckedKeys}Oe=Pe,q.checkedNodes=[],q.checkedNodesPositions=[],q.halfCheckedKeys=Ne,Pe.forEach(function(He){var We=A[He];if(!We)return;var Ge=We.node,Be=We.pos;q.checkedNodes.push(Ge),q.checkedNodesPositions.push({node:Ge,pos:Be})}),oe.setUncontrolledState({checkedKeys:Pe},!1,{halfCheckedKeys:Ne})}ie&&ie(Oe,q)},oe.onNodeLoad=function(le){return new Promise(function(_e){oe.setState(function(ee){var L=ee.loadedKeys,A=L===void 0?[]:L,C=ee.loadingKeys,U=C===void 0?[]:C,K=oe.props,M=K.loadData,ie=K.onLoad,Ee=le.key;if(!M||A.indexOf(Ee)!==-1||U.indexOf(Ee)!==-1)return{};var Oe=M(le);return Oe.then(function(){var q=oe.state,ce=q.loadedKeys,Se=q.loadingKeys,Ce=Object(s.a)(ce,Ee),Pe=Object(s.b)(Se,Ee);ie&&ie(Ce,{event:"load",node:le}),oe.setUncontrolledState({loadedKeys:Ce}),oe.setState({loadingKeys:Pe}),_e()}),{loadingKeys:Object(s.a)(U,Ee)}})})},oe.onNodeMouseEnter=function(le,_e){var ee=oe.props.onMouseEnter;ee&&ee({event:le,node:_e})},oe.onNodeMouseLeave=function(le,_e){var ee=oe.props.onMouseLeave;ee&&ee({event:le,node:_e})},oe.onNodeContextMenu=function(le,_e){var ee=oe.props.onRightClick;ee&&(le.preventDefault(),ee({event:le,node:_e}))},oe.onFocus=function(){var le=oe.props.onFocus;oe.setState({focused:!0}),le&&le.apply(void 0,arguments)},oe.onBlur=function(){var le=oe.props.onBlur;oe.setState({focused:!1}),oe.onActiveChange(null),le&&le.apply(void 0,arguments)},oe.getTreeNodeRequiredProps=function(){var le=oe.state,_e=le.expandedKeys,ee=le.selectedKeys,L=le.loadedKeys,A=le.loadingKeys,C=le.checkedKeys,U=le.halfCheckedKeys,K=le.dragOverNodeKey,M=le.dropPosition,ie=le.keyEntities;return{expandedKeys:_e||[],selectedKeys:ee||[],loadedKeys:L||[],loadingKeys:A||[],checkedKeys:C||[],halfCheckedKeys:U||[],dragOverNodeKey:K,dropPosition:M,keyEntities:ie}},oe.setExpandedKeys=function(le){var _e=oe.state.treeData,ee=Object(i.d)(_e,le);oe.setUncontrolledState({expandedKeys:le,flattenNodes:ee},!0)},oe.onNodeExpand=function(le,_e){var ee=oe.state.expandedKeys,L=oe.state.listChanging,A=oe.props,C=A.onExpand,U=A.loadData,K=_e.key,M=_e.expanded;if(L)return;var ie=ee.indexOf(K),Ee=!M;if(Object(w.a)(M&&ie!==-1||!M&&ie===-1,"Expand state not sync with index check"),Ee?ee=Object(s.a)(ee,K):ee=Object(s.b)(ee,K),oe.setExpandedKeys(ee),C&&C(ee,{node:_e,expanded:Ee,nativeEvent:le.nativeEvent}),Ee&&U){var Oe=oe.onNodeLoad(_e);Oe&&Oe.then(function(){var q=Object(i.d)(oe.state.treeData,ee);oe.setUncontrolledState({flattenNodes:q})})}},oe.onListChangeStart=function(){oe.setUncontrolledState({listChanging:!0})},oe.onListChangeEnd=function(){setTimeout(function(){oe.setUncontrolledState({listChanging:!1})})},oe.onActiveChange=function(le){var _e=oe.state.activeKey,ee=oe.props.onActiveChange;if(_e===le)return;oe.setState({activeKey:le}),le!==null&&oe.scrollTo({key:le}),ee&&ee(le)},oe.getActiveItem=function(){var le=oe.state,_e=le.activeKey,ee=le.flattenNodes;return _e===null?null:ee.find(function(L){var A=L.data.key;return A===_e})||null},oe.offsetActiveKey=function(le){var _e=oe.state,ee=_e.flattenNodes,L=_e.activeKey,A=ee.findIndex(function(K){var M=K.data.key;return M===L});A===-1&&le<0&&(A=ee.length),A=(A+le+ee.length)%ee.length;var C=ee[A];if(C){var U=C.data.key;oe.onActiveChange(U)}else oe.onActiveChange(null)},oe.onKeyDown=function(le){var _e=oe.state,ee=_e.activeKey,L=_e.expandedKeys,A=_e.checkedKeys,C=oe.props,U=C.onKeyDown,K=C.checkable,M=C.selectable;switch(le.which){case e.a.UP:{oe.offsetActiveKey(-1),le.preventDefault();break}case e.a.DOWN:{oe.offsetActiveKey(1),le.preventDefault();break}}var ie=oe.getActiveItem();if(ie&&ie.data){var Ee=oe.getTreeNodeRequiredProps(),Oe=ie.data.isLeaf===!1||!!(ie.data.children||[]).length,q=Object(i.b)(Object(W.a)(Object(W.a)({},Object(i.f)(ee,Ee)),{},{data:ie.data,active:!0}));switch(le.which){case e.a.LEFT:{Oe&&L.includes(ee)?oe.onNodeExpand({},q):ie.parent&&oe.onActiveChange(ie.parent.data.key),le.preventDefault();break}case e.a.RIGHT:{Oe&&!L.includes(ee)?oe.onNodeExpand({},q):ie.children&&ie.children.length&&oe.onActiveChange(ie.children[0].data.key),le.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{K&&!q.disabled&&q.checkable!==!1&&!q.disableCheckbox?oe.onNodeCheck({},q,!A.includes(ee)):!K&&M&&!q.disabled&&q.selectable!==!1&&oe.onNodeSelect({},q);break}}}U&&U(le)},oe.setUncontrolledState=function(le){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(oe.destroyed)return;var L=!1,A=!0,C={};Object.keys(le).forEach(function(U){if(U in oe.props){A=!1;return}L=!0,C[U]=le[U]}),L&&(!_e||A)&&oe.setState(Object(W.a)(Object(W.a)({},C),ee))},oe.scrollTo=function(le){oe.listRef.current.scrollTo(le)},oe}return Object(S.a)(ve,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var le,_e=this.state,ee=_e.focused,L=_e.flattenNodes,A=_e.keyEntities,C=_e.dragging,U=_e.activeKey,K=this.props,M=K.prefixCls,ie=K.className,Ee=K.style,Oe=K.showLine,q=K.focusable,ce=K.tabIndex,Se=ce===void 0?0:ce,Ce=K.selectable,Pe=K.showIcon,Ne=K.icon,Ie=K.switcherIcon,Me=K.draggable,He=K.checkable,We=K.checkStrictly,Ge=K.disabled,Be=K.motion,Xe=K.loadData,Ye=K.filterTreeNode,ne=K.height,z=K.itemHeight,G=K.virtual,J=K.titleRender,re=K.onContextMenu,Y=Object(s.f)(this.props);return B.createElement(l.a.Provider,{value:{prefixCls:M,selectable:Ce,showIcon:Pe,icon:Ne,switcherIcon:Ie,draggable:Me,checkable:He,checkStrictly:We,disabled:Ge,keyEntities:A,loadData:Xe,filterTreeNode:Ye,titleRender:J,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},B.createElement("div",{className:u()(M,ie,(le={},Object(ue.a)(le,"".concat(M,"-show-line"),Oe),Object(ue.a)(le,"".concat(M,"-focused"),ee),Object(ue.a)(le,"".concat(M,"-active-focused"),U!==null),le))},B.createElement(H,Object.assign({ref:this.listRef,prefixCls:M,style:Ee,data:L,disabled:Ge,selectable:Ce,checkable:!!He,motion:Be,dragging:C,height:ne,itemHeight:z,virtual:G,focusable:q,focused:ee,tabIndex:Se,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:re},this.getTreeNodeRequiredProps(),Y))))}}],[{key:"getDerivedStateFromProps",value:function(le,_e){var ee=_e.prevProps,L={prevProps:le};function A(Ne){return!ee&&Ne in le||ee&&ee[Ne]!==le[Ne]}var C;if(A("treeData")?C=le.treeData:A("children")&&(Object(w.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),C=Object(i.c)(le.children)),C){L.treeData=C;var U=Object(i.a)(C);L.keyEntities=Object(W.a)(Object(ue.a)({},m,E),U.keyEntities)}var K=L.keyEntities||_e.keyEntities;if(A("expandedKeys")||ee&&A("autoExpandParent"))L.expandedKeys=le.autoExpandParent||!ee&&le.defaultExpandParent?Object(s.e)(le.expandedKeys,K):le.expandedKeys;else if(!ee&&le.defaultExpandAll){var M=Object(W.a)({},K);delete M[m],L.expandedKeys=Object.keys(M).map(function(Ne){return M[Ne].key})}else!ee&&le.defaultExpandedKeys&&(L.expandedKeys=le.autoExpandParent||le.defaultExpandParent?Object(s.e)(le.defaultExpandedKeys,K):le.defaultExpandedKeys);if(L.expandedKeys||delete L.expandedKeys,C||L.expandedKeys){var ie=Object(i.d)(C||_e.treeData,L.expandedKeys||_e.expandedKeys);L.flattenNodes=ie}if(le.selectable&&(A("selectedKeys")?L.selectedKeys=Object(s.d)(le.selectedKeys,le):!ee&&le.defaultSelectedKeys&&(L.selectedKeys=Object(s.d)(le.defaultSelectedKeys,le))),le.checkable){var Ee;if(A("checkedKeys")?Ee=Object(s.j)(le.checkedKeys)||{}:!ee&&le.defaultCheckedKeys?Ee=Object(s.j)(le.defaultCheckedKeys)||{}:C&&(Ee=Object(s.j)(le.checkedKeys)||{checkedKeys:_e.checkedKeys,halfCheckedKeys:_e.halfCheckedKeys}),Ee){var Oe=Ee,q=Oe.checkedKeys,ce=q===void 0?[]:q,Se=Oe.halfCheckedKeys,Ce=Se===void 0?[]:Se;if(!le.checkStrictly){var Pe=Object(I.a)(ce,!0,K);ce=Pe.checkedKeys,Ce=Pe.halfCheckedKeys}L.checkedKeys=ce,L.halfCheckedKeys=Ce}}return A("loadedKeys")&&(L.loadedKeys=le.loadedKeys),L}}]),ve}(B.Component);V.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},V.TreeNode=t.a;var $=V,ge=ye.b=$},fjLI:function(Ke,ye,j){"use strict";j.d(ye,"f",function(){return l}),j.d(ye,"b",function(){return s}),j.d(ye,"a",function(){return i}),j.d(ye,"d",function(){return o}),j.d(ye,"e",function(){return a}),j.d(ye,"c",function(){return r});var ue=j("8HAY"),W=j("Vhoy"),R=j("MI8n"),N=j("JYp7"),S=j("pmY6"),O=j("24hK"),F=j("nnTU"),B=j("T8No"),e=j("Cg/j"),w=j("t9D7"),g=function(n,t,v,c){var p=arguments.length,b=p<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,v):c,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,t,v,c);else for(var d=n.length-1;d>=0;d--)(y=n[d])&&(b=(p<3?y(b):p>3?y(t,v,b):y(t,v))||b);return p>3&&b&&Object.defineProperty(t,v,b),b},u=function(n,t){return function(v,c){t(v,c,n)}};function l(n){return n.command!==void 0}class s{constructor(n){this.id=s._idPool++,this._debugName=n}}s._idPool=0,s.CommandPalette=new s("CommandPalette"),s.EditorContext=new s("EditorContext"),s.SimpleEditorContext=new s("SimpleEditorContext"),s.EditorContextCopy=new s("EditorContextCopy"),s.EditorContextPeek=new s("EditorContextPeek"),s.MenubarEditMenu=new s("MenubarEditMenu"),s.MenubarCopy=new s("MenubarCopy"),s.MenubarGoMenu=new s("MenubarGoMenu"),s.MenubarSelectionMenu=new s("MenubarSelectionMenu"),s.InlineCompletionsActions=new s("InlineCompletionsActions");const i=Object(e.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new R.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:n=>n===s.CommandPalette}}addCommand(n){return this.addCommands(N.a.single(n))}addCommands(n){for(const t of n)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(S.i)(()=>{let t=!1;for(const v of n)t=this._commands.delete(v.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((t,v)=>n.set(v,t)),n}appendMenuItem(n,t){return this.appendMenuItems(N.a.single({id:n,item:t}))}appendMenuItems(n){const t=new Set,v=new O.a;for(const{id:c,item:p}of n){let b=this._menuItems.get(c);b||(b=new O.a,this._menuItems.set(c,b)),v.push(b.push(p)),t.add(c)}return this._onDidChangeMenu.fire(t),Object(S.i)(()=>{if(v.size>0){for(let c of v)c();this._onDidChangeMenu.fire(t),v.clear()}})}getMenuItems(n){let t;return this._menuItems.has(n)?t=[...this._menuItems.get(n)]:t=[],n===s.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(n){const t=new Set;for(const v of n)l(v)&&(t.add(v.command.id),v.alt&&t.add(v.alt.id));this._commands.forEach((v,c)=>{t.has(c)||n.push({command:v})})}};class a extends ue.e{constructor(n,t,v,c){super(`submenuitem.${n.submenu.id}`,typeof n.title=="string"?n.title:n.title.value,[],"submenu");this.item=n,this._menuService=t,this._contextKeyService=v,this._options=c}get actions(){const n=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=t.getActions(this._options);t.dispose();for(const[,c]of v)c.length>0&&(n.push(...c),n.push(new ue.d));return n.length&&n.pop(),n}}let r=class n{constructor(t,v,c,p,b){var y,d;if(this._commandService=b,this.id=t.id,this.label=(c==null?void 0:c.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(d=typeof t.tooltip=="string"?t.tooltip:(y=t.tooltip)===null||y===void 0?void 0:y.value)!==null&&d!==void 0?d:"",this.enabled=!t.precondition||p.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const f=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=p.contextMatchesRules(f.condition),this.checked&&f.tooltip&&(this.tooltip=typeof f.tooltip=="string"?f.tooltip:f.tooltip.value),f.title&&(this.label=typeof f.title=="string"?f.title:f.title.value)}this.item=t,this.alt=v?new n(v,void 0,c,p,b):void 0,this._options=c,w.d.isThemeIcon(t.icon)&&(this.class=W.a.asClassName(t.icon))}dispose(){}run(...t){var v,c;let p=[];return((v=this._options)===null||v===void 0?void 0:v.arg)&&(p=[...p,this._options.arg]),((c=this._options)===null||c===void 0?void 0:c.shouldForwardArgs)&&(p=[...p,...t]),this._commandService.executeCommand(this.id,...p)}};r=g([u(3,B.b),u(4,F.b)],r)},ic2d:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return N});var ue=j("FWmy"),W=j("746U");class R{constructor(){this.data=new Map}add(S,O){ue.a(W.l(S)),ue.a(W.k(O)),ue.a(!this.data.has(S),"There is already an extension with this id"),this.data.set(S,O)}as(S){return this.data.get(S)||null}}const N=new R},iris:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return l});var ue=j("qVdP"),W=j("jsC+"),R=j("lUTK"),N=j("BvKs"),S=j("tJVT"),O=j("q1tI"),F=j.n(O),B=j("Q0Vu"),e=j.n(B),w=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],g=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],u=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],l=function(i){var o=i.showSelectAll,a=o===void 0?!1:o,r=i.disciplinesData,n=r===void 0?[]:r,t=i.knowledgeData,v=t===void 0?[]:t,c=i.directionValue,p=i.subDisciplineValue,b=i.typeValue,y=i.knowledgeValue,d=i.showKnowledge,f=d===void 0?!1:d,m=i.showRandomType,h=m===void 0?!1:m,E=i.difficultyValue,_=i.randomValue,T=i.selectAll,k=i.languagesvalue,D=i.className,x=i.languages,P=x===void 0?[]:x,H=i.isprogram_homework,I=i.showShixun,V=I===void 0?!1:I,$=i.showItemType,ge=$===void 0?!0:$,te=i.onShixunChange,be=te===void 0?function(){}:te,ve=i.onDirectionChange,oe=ve===void 0?function(){}:ve,le=i.onTypeChange,_e=le===void 0?function(){}:le,ee=i.onDifficultyChange,L=ee===void 0?function(){}:ee,A=i.handlelanguagesChange,C=A===void 0?function(){}:A,U=i.onKnowledgeChange,K=U===void 0?function(){}:U,M=i.onRandomChange,ie=M===void 0?function(){}:M,Ee=i.showTeachGroup,Oe=Ee===void 0?!1:Ee,q=i.teachGroupData,ce=q===void 0?[]:q,Se=i.onTeachGroupChange,Ce=Se===void 0?function(){}:Se,Pe=i.teachGroupValue,Ne=Object(O.useState)(0),Ie=Object(S.a)(Ne,2),Me=Ie[0],He=Ie[1],We=Object(O.useRef)(null),Ge=Object(O.useState)(0),Be=Object(S.a)(Ge,2),Xe=Be[0],Ye=Be[1],ne=Object(O.useRef)(null);Object(O.useEffect)(function(){if(n.length!==0){var G;(We==null||((G=We.current)===null||G===void 0)?void 0:G.clientHeight)>108?He(1):He(0)}n.length===0&&He(0)},[n]),Object(O.useEffect)(function(){if(console.log(v.length===0,"\u6570\u91CF"),v.length!==0){var G,J;console.log(ne==null||((G=ne.current)===null||G===void 0)?void 0:G.clientHeight,"\u9AD8\u5EA6"),(ne==null||((J=ne.current)===null||J===void 0)?void 0:J.clientHeight)>108?Ye(1):Ye(0)}v.length===0&&Ye(0)},[v]);var z=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],re=arguments.length>1?arguments[1]:void 0;return F.a.createElement(N.a,{className:e.a.subMenu},J.map(function(Y){return F.a.createElement(N.a.Item,{key:Y.id},F.a.createElement("a",{className:"".concat(e.a.subItem," ").concat(p===Y.id?e.a.subActive:""),onClick:function(){return oe(re,Y.id)}},Y.name))}))};return F.a.createElement("aside",{className:D?"".concat(e.a.main," ").concat(D):e.a.main},F.a.createElement("div",{className:e.a.wrap},H&&F.a.createElement("div",{className:e.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Oe&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u56E2\u961F"),F.a.createElement("div",{className:e.a.directionContentWrap},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(Pe?"":e.a.active," "),onClick:function(){return Ce(null)}},"\u5168\u90E8"),ce==null?void 0:ce.map(function(G){return F.a.createElement("li",{key:G.group_id,className:"".concat(e.a.directionItem," ").concat(Pe===G.group_id?e.a.active:""," "),onClick:function(){return Ce(G.group_id)}},G.name)}))),F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u65B9\u5411"),F.a.createElement("span",null),F.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Me===1?88:"auto"}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(c?"":e.a.active," "),onClick:function(){return oe(null)}},"\u5168\u90E8"),n.map(function(G){var J;return F.a.createElement(F.a.Fragment,{key:G.id},((J=G.sub_disciplines)===null||J===void 0?void 0:J.length)>0?F.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(Y){return Y.parentNode},overlay:function(){return z(G.sub_disciplines,G.id)}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(c===G.id?e.a.active:""," "),onClick:function(){return oe(G.id)}},G.name)):F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(c===G.id?e.a.active:""," "),onClick:function(){return oe(G.id)}},G.name))})),F.a.createElement("div",{className:e.a.directionContentWrap,ref:We,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},n.map(function(G){var J;return F.a.createElement(F.a.Fragment,{key:G.id},((J=G.sub_disciplines)===null||J===void 0?void 0:J.length)>0?F.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(Y){return Y.parentNode},overlay:function(){return z(G.sub_disciplines,G.id)}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(c===G.id?e.a.active:""," "),onClick:function(){return oe(G.id)}},G.name)):F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(c===G.id?e.a.active:""," "),onClick:function(){return oe(G.id)}},G.name))})),!!Me&&F.a.createElement("div",{className:e.a.action},Me===1&&F.a.createElement("span",{onClick:function(){return He(2)}},"\u5C55\u5F00",F.a.createElement("i",{className:"iconfont icon-xiala"})),Me===2&&F.a.createElement("span",{onClick:function(){return He(1)}},"\u6536\u8D77",F.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),f&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u77E5\u8BC6\u70B9"),F.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Xe===1?106:"auto"}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(y===-1?e.a.active:""," "),onClick:function(){return K(-1)}},"\u5168\u90E8"),v.map(function(G){return F.a.createElement("li",{key:G.id,className:"".concat(e.a.directionItem," ").concat(y===G.id?e.a.active:""," "),onClick:function(){return K(G.id)}},G.name)})),F.a.createElement("div",{ref:ne,className:e.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},v.map(function(G){return F.a.createElement("li",{key:G.id,className:"".concat(e.a.directionItem," ").concat(y===G.id?e.a.active:""," "),onClick:function(){return K(G.id)}},G.name)})),!!Xe&&F.a.createElement("div",{className:e.a.action},Xe===1&&F.a.createElement("span",{onClick:function(){return Ye(2)}},"\u5C55\u5F00",F.a.createElement("i",{className:"iconfont icon-xiala"})),Xe===2&&F.a.createElement("span",{onClick:function(){return Ye(1)}},"\u6536\u8D77",F.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),ge&&!H&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u9898\u578B"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(b?"":e.a.active," "),onClick:function(){return _e(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},w.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(b===G.value?e.a.active:""," "),onClick:function(){return _e(G.value)}},G.name)}),V&&F.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:e.a.directionItem,onClick:function(){return be()}},"\u5B9E\u8BAD\u9898"))),F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u96BE\u5EA6"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(E?"":e.a.active," "),onClick:function(){return L(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},g.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(E===G.value?e.a.active:""," "),onClick:function(){return L(G.value)}},G.name)}))),h&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u7C7B\u578B"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(_?"":e.a.active," "),onClick:function(){return ie(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},u.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(_===G.value?e.a.active:""," "),onClick:function(){return ie(G.value)}},G.name)})))))}},jcZT:function(Ke,ye,j){"use strict";var ue=j("2qtc"),W=j("kLXV"),R=j("5NDa"),N=j("5rEg"),S=j("miYZ"),O=j("tsqr"),F=j("9og8"),B=j("tJVT"),e=j("WmNS"),w=j.n(e),g=j("q1tI"),u=j.n(g),l=j("d5o6"),s=j.n(l),i=j("P/tu"),o=j("WCUW"),a=j("9kvl"),r=function(t){var v=t.problemset,c=t.dispatch,p=t.onOk,b=Object(g.useState)(""),y=Object(B.a)(b,2),d=y[0],f=y[1],m=Object(g.useState)([0]),h=Object(B.a)(m,2),E=h[0],_=h[1],T=function(){c({type:"problemset/setActionTabs",payload:{}})};Object(g.useEffect)(function(){if(v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var D,x;_([(D=v.actionTabs)===null||D===void 0||((x=D.params)===null||x===void 0)?void 0:x.group_id]),f("")}},[v.actionTabs.key]);var k=function(){var D=Object(F.a)(w.a.mark(function x(){var P,H,I;return w.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(P=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],d.trim()){$.next=4;break}return O.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),$.abrupt("return");case 4:if(!(d.charAt(0)===" ")){$.next=7;break}return O.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),$.abrupt("return");case 7:H=0;case 8:if(!(H<d.length)){$.next=15;break}if(!P.includes(d.charAt(H))){$.next=12;break}return O.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),$.abrupt("return",!1);case 12:H++,$.next=8;break;case 15:return $.next=17,Object(o.p)({parent_id:E.length>0?E[0]:0,name:d});case 17:I=$.sent,I.status===0&&(T(),p(I==null?void 0:I.id));case 19:case"end":return $.stop()}},x)}));return function(){return D.apply(this,arguments)}}();return u.a.createElement(W.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:T,onOk:k,destroyOnClose:!0},u.a.createElement("div",{className:s.a.addModal},u.a.createElement("div",{className:s.a.row},u.a.createElement("span",{className:s.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),u.a.createElement(N.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:d,onChange:function(x){return f(x.target.value)}})),u.a.createElement("div",{className:s.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},u.a.createElement("span",{className:s.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),u.a.createElement(i.a,{value:E,onChange:function(x){return _(x)}}))))};ye.a=Object(a.a)(function(n){var t=n.problemset;return{problemset:t}})(r)},k3GJ:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return Hi});var ue=j("rePB"),W=j("ODXe"),R=j("Ff2n"),N=j("VTBJ"),S=j("q1tI"),O=j("TSYQ"),F=j.n(O),B=j("Zm9Q"),e=j("6cGi"),w=j("KQm4"),g=j("xEkU"),u=j.n(g),l=j("t23M");function s(de){var Te=Object(S.useRef)(),Ae=Object(S.useRef)(!1);function pe(){for(var X=arguments.length,ae=new Array(X),Q=0;Q<X;Q++)ae[Q]=arguments[Q];Ae.current||(u.a.cancel(Te.current),Te.current=u()(function(){de.apply(void 0,ae)}))}return Object(S.useEffect)(function(){return function(){Ae.current=!0,u.a.cancel(Te.current)}},[]),pe}function i(de){var Te=Object(S.useRef)([]),Ae=Object(S.useState)({}),pe=Object(W.a)(Ae,2),X=pe[1],ae=Object(S.useRef)(typeof de=="function"?de():de),Q=s(function(){var me=ae.current;Te.current.forEach(function(we){me=we(me)}),Te.current=[],ae.current=me,X({})});function fe(me){Te.current.push(me),Q()}return[ae.current,fe]}var o=j("4IlW");function a(de,Te){var Ae,pe=de.prefixCls,X=de.id,ae=de.active,Q=de.rtl,fe=de.tab,me=fe.key,we=fe.tab,xe=fe.disabled,Le=fe.closeIcon,ke=de.tabBarGutter,je=de.tabPosition,Fe=de.closable,ze=de.renderWrapper,at=de.removeAriaLabel,gt=de.editable,lt=de.onClick,_t=de.onRemove,vt=de.onFocus,dt="".concat(pe,"-tab");S.useEffect(function(){return _t},[]);var ct={};je==="top"||je==="bottom"?ct[Q?"marginLeft":"marginRight"]=ke:ct.marginBottom=ke;var At=gt&&Fe!==!1&&!xe;function bt(rt){if(xe)return;lt(rt)}function zt(rt){rt.preventDefault(),rt.stopPropagation(),gt.onEdit("remove",{key:me,event:rt})}var Lt=S.createElement("div",{key:me,ref:Te,className:F()(dt,(Ae={},Object(ue.a)(Ae,"".concat(dt,"-with-remove"),At),Object(ue.a)(Ae,"".concat(dt,"-active"),ae),Object(ue.a)(Ae,"".concat(dt,"-disabled"),xe),Ae)),style:ct,onClick:bt},S.createElement("div",{role:"tab","aria-selected":ae,id:X&&"".concat(X,"-tab-").concat(me),className:"".concat(dt,"-btn"),"aria-controls":X&&"".concat(X,"-panel-").concat(me),"aria-disabled":xe,tabIndex:xe?null:0,onClick:function(nt){nt.stopPropagation(),bt(nt)},onKeyDown:function(nt){[o.a.SPACE,o.a.ENTER].includes(nt.which)&&(nt.preventDefault(),bt(nt))},onFocus:vt},we),At&&S.createElement("button",{type:"button","aria-label":at||"remove",tabIndex:0,className:"".concat(dt,"-remove"),onClick:function(nt){nt.stopPropagation(),zt(nt)}},Le||gt.removeIcon||"\xD7"));return ze&&(Lt=ze(Lt)),Lt}var r=S.forwardRef(a),n={width:0,height:0,left:0,top:0};function t(de,Te,Ae){return Object(S.useMemo)(function(){for(var pe,X=new Map,ae=Te.get((pe=de[0])===null||pe===void 0?void 0:pe.key)||n,Q=ae.left+ae.width,fe=0;fe<de.length;fe+=1){var me=de[fe].key,we=Te.get(me);if(!we){var xe;we=Te.get((xe=de[fe-1])===null||xe===void 0?void 0:xe.key)||n}var Le=X.get(me)||Object(N.a)({},we);Le.right=Q-Le.left-Le.width,X.set(me,Le)}return X},[de.map(function(pe){return pe.key}).join("_"),Te,Ae])}var v={width:0,height:0,left:0,top:0,right:0};function c(de,Te,Ae,pe,X){var ae=X.tabs,Q=X.tabPosition,fe=X.rtl,me,we,xe;["top","bottom"].includes(Q)?(me="width",we=fe?"right":"left",xe=Math.abs(Te.left)):(me="height",we="top",xe=-Te.top);var Le=Te[me],ke=Ae[me],je=pe[me],Fe=Le;return ke+je>Le&&(Fe=Le-je),Object(S.useMemo)(function(){if(!ae.length)return[0,0];for(var ze=ae.length,at=ze,gt=0;gt<ze;gt+=1){var lt=de.get(ae[gt].key)||v;if(lt[we]+lt[me]>xe+Fe){at=gt-1;break}}for(var _t=0,vt=ze-1;vt>=0;vt-=1){var dt=de.get(ae[vt].key)||v;if(dt[we]<xe){_t=vt+1;break}}return[_t,at]},[de,xe,Fe,Q,ae.map(function(ze){return ze.key}).join("_"),fe])}var p=j("wx14"),b=j("1OyB"),y=j("vuIU"),d=j("JX7q"),f=j("Ji7U"),m=j("LK+K"),h=j("I8Z2"),E=j("bT9E"),_=j("2GS6"),T=j("Gytx"),k=j.n(T),D=j("U8pU"),x=/iPhone/i,P=/iPod/i,H=/iPad/i,I=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,$=/\bAndroid(?:.+)SD4930UR\b/i,ge=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,te=/Windows Phone/i,be=/\bWindows(?:.+)ARM\b/i,ve=/BlackBerry/i,oe=/BB10/i,le=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,ee=/Mobile(?:.+)Firefox\b/i;function L(de,Te){return de.test(Te)}function A(de){var Te=de||(typeof navigator!="undefined"?navigator.userAgent:""),Ae=(Te||"").split("[FBAN");if(typeof Ae[1]!="undefined"){var pe=Ae,X=Object(W.a)(pe,1);Te=X[0]}if(Ae=Te.split("Twitter"),typeof Ae[1]!="undefined"){var ae=Ae,Q=Object(W.a)(ae,1);Te=Q[0]}var fe={apple:{phone:L(x,Te)&&!L(te,Te),ipod:L(P,Te),tablet:!L(x,Te)&&L(H,Te)&&!L(te,Te),device:(L(x,Te)||L(P,Te)||L(H,Te))&&!L(te,Te)},amazon:{phone:L($,Te),tablet:!L($,Te)&&L(ge,Te),device:L($,Te)||L(ge,Te)},android:{phone:!L(te,Te)&&L($,Te)||!L(te,Te)&&L(I,Te),tablet:!L(te,Te)&&!L($,Te)&&!L(I,Te)&&(L(ge,Te)||L(V,Te)),device:!L(te,Te)&&(L($,Te)||L(ge,Te)||L(I,Te)||L(V,Te))||L(/\bokhttp\b/i,Te)},windows:{phone:L(te,Te),tablet:L(be,Te),device:L(te,Te)||L(be,Te)},other:{blackberry:L(ve,Te),blackberry10:L(oe,Te),opera:L(le,Te),firefox:L(ee,Te),chrome:L(_e,Te),device:L(ve,Te)||L(oe,Te)||L(le,Te)||L(ee,Te)||L(_e,Te)},any:null,phone:null,tablet:null};return fe.any=fe.apple.device||fe.android.device||fe.windows.device||fe.other.device,fe.phone=fe.apple.phone||fe.android.phone||fe.windows.phone,fe.tablet=fe.apple.tablet||fe.android.tablet||fe.windows.tablet,fe}var C=Object(N.a)(Object(N.a)({},A()),{},{isMobile:A}),U=C;function K(){}function M(de,Te,Ae){var pe=Te||"";return de.key||"".concat(pe,"item_").concat(Ae)}function ie(de){return"".concat(de,"-menu-")}function Ee(de,Te){var Ae=-1;S.Children.forEach(de,function(pe){Ae+=1,pe&&pe.type&&pe.type.isMenuItemGroup?S.Children.forEach(pe.props.children,function(X){Ae+=1,Te(X,Ae)}):Te(pe,Ae)})}function Oe(de,Te,Ae){if(!de||Ae.find)return;S.Children.forEach(de,function(pe){if(pe){var X=pe.type;if(!X||!(X.isSubMenu||X.isMenuItem||X.isMenuItemGroup))return;Te.indexOf(pe.key)!==-1?Ae.find=!0:pe.props.children&&Oe(pe.props.children,Te,Ae)}})}var q=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ce=function(Te){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=Te&&typeof Te.getBoundingClientRect=="function"&&Te.getBoundingClientRect().width;if(pe){if(Ae){var X=getComputedStyle(Te),ae=X.marginLeft,Q=X.marginRight;pe+=+ae.replace("px","")+ +Q.replace("px","")}pe=+pe.toFixed(6)}return pe||0},Se=function(Te,Ae,pe){Te&&Object(D.a)(Te.style)==="object"&&(Te.style[Ae]=pe)},Ce=function(){return U.any},Pe=j("bdgK"),Ne=j("i8i4"),Ie=j.n(Ne),Me=j("wgJM"),He=j("l4aY"),We=j("m+aA"),Ge=j("c+Xe"),Be=j("zT1h"),Xe=j("QC+M");function Ye(de,Te,Ae){return Ae?de[0]===Te[0]:de[0]===Te[0]&&de[1]===Te[1]}function ne(de,Te,Ae){var pe=de[Te]||{};return Object(N.a)(Object(N.a)({},pe),Ae)}function z(de,Te,Ae,pe){for(var X=Ae.points,ae=Object.keys(de),Q=0;Q<ae.length;Q+=1){var fe=ae[Q];if(Ye(de[fe].points,X,pe))return"".concat(Te,"-placement-").concat(fe)}return""}var G=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var de=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(de)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(de==null?void 0:de.substr(0,4)))},J=j("MNnm");function re(de,Te){var Ae={};return Ae[de.toLowerCase()]=Te.toLowerCase(),Ae["Webkit".concat(de)]="webkit".concat(Te),Ae["Moz".concat(de)]="moz".concat(Te),Ae["ms".concat(de)]="MS".concat(Te),Ae["O".concat(de)]="o".concat(Te.toLowerCase()),Ae}function Y(de,Te){var Ae={animationend:re("Animation","AnimationEnd"),transitionend:re("Transition","TransitionEnd")};return de&&("AnimationEvent"in Te||delete Ae.animationend.animation,"TransitionEvent"in Te||delete Ae.transitionend.transition),Ae}var Z=Y(Object(J.a)(),typeof window!="undefined"?window:{}),se={};if(Object(J.a)()){var he=document.createElement("div");se=he.style}var De={};function Re(de){if(De[de])return De[de];var Te=Z[de];if(Te)for(var Ae=Object.keys(Te),pe=Ae.length,X=0;X<pe;X+=1){var ae=Ae[X];if(Object.prototype.hasOwnProperty.call(Te,ae)&&ae in se)return De[de]=Te[ae],De[de]}return""}var Ue=Re("animationend"),Ve=Re("transitionend"),Je=!!(Ue&&Ve),Qe=Ue||"animationend",ht=Ve||"transitionend";function st(de,Te){if(!de)return null;if(Object(D.a)(de)==="object"){var Ae=Te.replace(/-\w/g,function(pe){return pe[1].toUpperCase()});return de[Ae]}return"".concat(de,"-").concat(Te)}var qe="none",Ut="appear",Et="enter",Ft="leave",kt="none",ot="prepare",jt="start",Jt="active",Vt="end";function rn(de){var Te=Object(S.useRef)(!1),Ae=Object(S.useState)(de),pe=Object(W.a)(Ae,2),X=pe[0],ae=pe[1];function Q(fe){Te.current||ae(fe)}return Object(S.useEffect)(function(){return function(){Te.current=!0}},[]),[X,Q]}var Ze=Object(J.a)()?S.useLayoutEffect:S.useEffect,it=Ze,ft=function(){var de=S.useRef(null);function Te(){Me.a.cancel(de.current)}function Ae(pe){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Te();var ae=Object(Me.a)(function(){X<=1?pe({isCanceled:function(){return ae!==de.current}}):Ae(pe,X-1)});de.current=ae}return S.useEffect(function(){return function(){Te()}},[]),[Ae,Te]},It=[ot,jt,Jt,Vt],$t=!1,ln=!0;function Nt(de){return de===Jt||de===Vt}var pt=function(de,Te){var Ae=S.useState(kt),pe=Object(W.a)(Ae,2),X=pe[0],ae=pe[1],Q=ft(),fe=Object(W.a)(Q,2),me=fe[0],we=fe[1];function xe(){ae(ot)}return it(function(){if(X!==kt&&X!==Vt){var Le=It.indexOf(X),ke=It[Le+1],je=Te(X);je===$t?ae(ke):me(function(Fe){function ze(){if(Fe.isCanceled())return;ae(ke)}je===!0?ze():Promise.resolve(je).then(ze)})}},[de,X]),S.useEffect(function(){return function(){we()}},[]),[xe,X]},yt=function(de){var Te=Object(S.useRef)(),Ae=Object(S.useRef)(de);Ae.current=de;var pe=S.useCallback(function(Q){Ae.current(Q)},[]);function X(Q){Q&&(Q.removeEventListener(ht,pe),Q.removeEventListener(Qe,pe))}function ae(Q){Te.current&&Te.current!==Q&&X(Te.current),Q&&Q!==Te.current&&(Q.addEventListener(ht,pe),Q.addEventListener(Qe,pe),Te.current=Q)}return S.useEffect(function(){return function(){X(Te.current)}},[]),[ae,X]};function ut(de,Te,Ae,pe){var X=pe.motionEnter,ae=X===void 0?!0:X,Q=pe.motionAppear,fe=Q===void 0?!0:Q,me=pe.motionLeave,we=me===void 0?!0:me,xe=pe.motionDeadline,Le=pe.motionLeaveImmediately,ke=pe.onAppearPrepare,je=pe.onEnterPrepare,Fe=pe.onLeavePrepare,ze=pe.onAppearStart,at=pe.onEnterStart,gt=pe.onLeaveStart,lt=pe.onAppearActive,_t=pe.onEnterActive,vt=pe.onLeaveActive,dt=pe.onAppearEnd,ct=pe.onEnterEnd,At=pe.onLeaveEnd,bt=pe.onVisibleChanged,zt=rn(),Lt=Object(W.a)(zt,2),rt=Lt[0],nt=Lt[1],Tt=rn(qe),St=Object(W.a)(Tt,2),$e=St[0],wt=St[1],Wt=rn(null),Ct=Object(W.a)(Wt,2),Mt=Ct[0],Gt=Ct[1],an=Object(S.useRef)(!1),cn=Object(S.useRef)(null),Yt=Object(S.useRef)(!1),hn=Object(S.useRef)(null);function vn(){var Ht=Ae();return Ht||hn.current}var fn=Object(S.useRef)(!1);function pn(Ht){var Dt=vn();if(Ht&&!Ht.deadline&&Ht.target!==Dt)return;var on;$e===Ut&&fn.current?on=dt==null?void 0:dt(Dt,Ht):$e===Et&&fn.current?on=ct==null?void 0:ct(Dt,Ht):$e===Ft&&fn.current&&(on=At==null?void 0:At(Dt,Ht)),on!==!1&&!Yt.current&&(wt(qe),Gt(null))}var Zt=yt(pn),un=Object(W.a)(Zt,1),sn=un[0],tn=S.useMemo(function(){var Ht,Dt,on;switch($e){case"appear":return Ht={},Object(ue.a)(Ht,ot,ke),Object(ue.a)(Ht,jt,ze),Object(ue.a)(Ht,Jt,lt),Ht;case"enter":return Dt={},Object(ue.a)(Dt,ot,je),Object(ue.a)(Dt,jt,at),Object(ue.a)(Dt,Jt,_t),Dt;case"leave":return on={},Object(ue.a)(on,ot,Fe),Object(ue.a)(on,jt,gt),Object(ue.a)(on,Jt,vt),on;default:return{}}},[$e]),bn=pt($e,function(Ht){if(Ht===ot){var Dt=tn[ot];return Dt?Dt(vn()):$t}if(Bt in tn){var on;Gt(((on=tn[Bt])===null||on===void 0?void 0:on.call(tn,vn(),null))||null)}return Bt===Jt&&(sn(vn()),xe>0&&(clearTimeout(cn.current),cn.current=setTimeout(function(){pn({deadline:!0})},xe))),ln}),En=Object(W.a)(bn,2),An=En[0],Bt=En[1],yn=Nt(Bt);fn.current=yn,it(function(){nt(Te);var Ht=an.current;if(an.current=!0,!de)return;var Dt;!Ht&&Te&&fe&&(Dt=Ut),Ht&&Te&&ae&&(Dt=Et),(Ht&&!Te&&we||!Ht&&Le&&!Te&&we)&&(Dt=Ft),Dt&&(wt(Dt),An())},[Te]),Object(S.useEffect)(function(){($e===Ut&&!fe||$e===Et&&!ae||$e===Ft&&!we)&&wt(qe)},[fe,ae,we]),Object(S.useEffect)(function(){return function(){clearTimeout(cn.current),Yt.current=!0}},[]),Object(S.useEffect)(function(){rt!==void 0&&$e===qe&&(bt==null||bt(rt))},[rt,$e]);var wn=Mt;return tn[ot]&&Bt===jt&&(wn=Object(N.a)({transition:"none"},wn)),[$e,Bt,wn,rt!=null?rt:Te]}var Qt=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(){return Object(b.a)(this,Ae),Te.apply(this,arguments)}return Object(y.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(S.Component),Rt=Qt;function dn(de){var Te=de;Object(D.a)(de)==="object"&&(Te=de.transitionSupport);function Ae(X){return!!(X.motionName&&Te)}var pe=S.forwardRef(function(X,ae){var Q=X.visible,fe=Q===void 0?!0:Q,me=X.removeOnLeave,we=me===void 0?!0:me,xe=X.forceRender,Le=X.children,ke=X.motionName,je=X.leavedClassName,Fe=X.eventProps,ze=Ae(X),at=Object(S.useRef)(),gt=Object(S.useRef)();function lt(){try{return Object(We.a)(at.current||gt.current)}catch(wt){return null}}var _t=ut(ze,fe,lt,X),vt=Object(W.a)(_t,4),dt=vt[0],ct=vt[1],At=vt[2],bt=vt[3],zt=S.useRef(bt);bt&&(zt.current=!0);var Lt=Object(S.useRef)(ae);Lt.current=ae;var rt=S.useCallback(function(wt){at.current=wt,Object(Ge.b)(Lt.current,wt)},[]),nt,Tt=Object(N.a)(Object(N.a)({},Fe),{},{visible:fe});if(!Le)nt=null;else if(dt===qe||!Ae(X))bt?nt=Le(Object(N.a)({},Tt),rt):!we&&zt.current?nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{className:je}),rt):xe?nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{style:{display:"none"}}),rt):nt=null;else{var St,$e;ct===ot?$e="prepare":Nt(ct)?$e="active":ct===jt&&($e="start"),nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{className:F()(st(ke,dt),(St={},Object(ue.a)(St,st(ke,"".concat(dt,"-").concat($e)),$e),Object(ue.a)(St,ke,typeof ke=="string"),St)),style:At}),rt)}return S.createElement(Rt,{ref:gt},nt)});return pe.displayName="CSSMotion",pe}var Kt=dn(Je),gn="add",xn="keep",Sn="remove",Cn="removed";function ti(de){var Te;return de&&Object(D.a)(de)==="object"&&"key"in de?Te=de:Te={key:de},Object(N.a)(Object(N.a)({},Te),{},{key:String(Te.key)})}function en(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return de.map(ti)}function ni(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=[],pe=0,X=Te.length,ae=en(de),Q=en(Te);ae.forEach(function(we){for(var xe=!1,Le=pe;Le<X;Le+=1){var ke=Q[Le];if(ke.key===we.key){pe<Le&&(Ae=Ae.concat(Q.slice(pe,Le).map(function(je){return Object(N.a)(Object(N.a)({},je),{},{status:gn})})),pe=Le),Ae.push(Object(N.a)(Object(N.a)({},ke),{},{status:xn})),pe+=1,xe=!0;break}}xe||Ae.push(Object(N.a)(Object(N.a)({},we),{},{status:Sn}))}),pe<X&&(Ae=Ae.concat(Q.slice(pe).map(function(we){return Object(N.a)(Object(N.a)({},we),{},{status:gn})})));var fe={};Ae.forEach(function(we){var xe=we.key;fe[xe]=(fe[xe]||0)+1});var me=Object.keys(fe).filter(function(we){return fe[we]>1});return me.forEach(function(we){Ae=Ae.filter(function(xe){var Le=xe.key,ke=xe.status;return Le!==we||ke!==Sn}),Ae.forEach(function(xe){xe.key===we&&(xe.status=xn)})}),Ae}var ii=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ri(de){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kt,Ae=function(pe){Object(f.a)(ae,pe);var X=Object(m.a)(ae);function ae(){var Q;return Object(b.a)(this,ae),Q=X.apply(this,arguments),Q.state={keyEntities:[]},Q.removeKey=function(fe){Q.setState(function(me){var we=me.keyEntities;return{keyEntities:we.map(function(xe){return xe.key!==fe?xe:Object(N.a)(Object(N.a)({},xe),{},{status:Cn})})}})},Q}return Object(y.a)(ae,[{key:"render",value:function(){var fe=this,me=this.state.keyEntities,we=this.props,xe=we.component,Le=we.children,ke=we.onVisibleChanged,je=Object(R.a)(we,["component","children","onVisibleChanged"]),Fe=xe||S.Fragment,ze={};return ii.forEach(function(at){ze[at]=je[at],delete je[at]}),delete je.keys,S.createElement(Fe,je,me.map(function(at){var gt=at.status,lt=Object(R.a)(at,["status"]),_t=gt===gn||gt===xn;return S.createElement(Te,Object(p.a)({},ze,{key:lt.key,visible:_t,eventProps:lt,onVisibleChanged:function(dt){ke==null||ke(dt,{key:lt.key}),dt||fe.removeKey(lt.key)}}),Le)}))}}],[{key:"getDerivedStateFromProps",value:function(fe,me){var we=fe.keys,xe=me.keyEntities,Le=en(we),ke=ni(xe,Le);return{keyEntities:ke.filter(function(je){var Fe=xe.find(function(ze){var at=ze.key;return je.key===at});return!(Fe&&Fe.status===Cn&&je.status===Sn)})}}}]),ae}(S.Component);return Ae.defaultProps={component:"div"},Ae}var Ai=ri(Je),On=Kt;function Hn(de){var Te=de.prefixCls,Ae=de.motion,pe=de.animation,X=de.transitionName;return Ae||(pe?{motionName:"".concat(Te,"-").concat(pe)}:X?{motionName:X}:null)}function Kn(de){var Te=de.prefixCls,Ae=de.visible,pe=de.zIndex,X=de.mask,ae=de.maskMotion,Q=de.maskAnimation,fe=de.maskTransitionName;if(!X)return null;var me={};return(ae||fe||Q)&&(me=Object(N.a)({motionAppear:!0},Hn({motion:ae,prefixCls:Te,transitionName:fe,animation:Q}))),S.createElement(On,Object(p.a)({},me,{visible:Ae,removeOnLeave:!0}),function(we){var xe=we.className;return S.createElement("div",{style:{zIndex:pe},className:F()("".concat(Te,"-mask"),xe)})})}var ai=j("9mu1"),Gn=j("o0o1"),zn=j.n(Gn),si=j("HaE+"),Ln=["measure","align",null,"motion"],oi=function(de,Te){var Ae=Object(S.useState)(null),pe=Object(W.a)(Ae,2),X=pe[0],ae=pe[1],Q=Object(S.useRef)(),fe=Object(S.useRef)(!1);function me(Le){fe.current||ae(Le)}function we(){Me.a.cancel(Q.current)}function xe(Le){we(),Q.current=Object(Me.a)(function(){me(function(ke){switch(X){case"align":return"motion";case"motion":return"stable";default:}return ke}),Le==null||Le()})}return Object(S.useEffect)(function(){me("measure")},[de]),Object(S.useEffect)(function(){switch(X){case"measure":Te();break;default:}X&&(Q.current=Object(Me.a)(Object(si.a)(zn.a.mark(function Le(){var ke,je;return zn.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:ke=Ln.indexOf(X),je=Ln[ke+1],je&&ke!==-1&&me(je);case 3:case"end":return ze.stop()}},Le)}))))},[X]),Object(S.useEffect)(function(){return function(){fe.current=!0,we()}},[]),[X,xe]},Vn=function(de){var Te=S.useState({width:0,height:0}),Ae=Object(W.a)(Te,2),pe=Ae[0],X=Ae[1];function ae(fe){X({width:fe.offsetWidth,height:fe.offsetHeight})}var Q=S.useMemo(function(){var fe={};if(de){var me=pe.width,we=pe.height;de.indexOf("height")!==-1&&we?fe.height=we:de.indexOf("minHeight")!==-1&&we&&(fe.minHeight=we),de.indexOf("width")!==-1&&me?fe.width=me:de.indexOf("minWidth")!==-1&&me&&(fe.minWidth=me)}return fe},[de,pe]);return[Q,ae]},Xn=S.forwardRef(function(de,Te){var Ae=de.visible,pe=de.prefixCls,X=de.className,ae=de.style,Q=de.children,fe=de.zIndex,me=de.stretch,we=de.destroyPopupOnHide,xe=de.forceRender,Le=de.align,ke=de.point,je=de.getRootDomNode,Fe=de.getClassNameFromAlign,ze=de.onAlign,at=de.onMouseEnter,gt=de.onMouseLeave,lt=de.onMouseDown,_t=de.onTouchStart,vt=Object(S.useRef)(),dt=Object(S.useRef)(),ct=Object(S.useState)(),At=Object(W.a)(ct,2),bt=At[0],zt=At[1],Lt=Vn(me),rt=Object(W.a)(Lt,2),nt=rt[0],Tt=rt[1];function St(){me&&Tt(je())}var $e=oi(Ae,St),wt=Object(W.a)($e,2),Wt=wt[0],Ct=wt[1],Mt=Object(S.useRef)();function Gt(){return ke||je}function an(){var Zt;(Zt=vt.current)===null||Zt===void 0||Zt.forceAlign()}function cn(Zt,un){var sn=Fe(un);bt!==sn&&zt(sn),Wt==="align"&&(bt!==sn?Promise.resolve().then(function(){an()}):Ct(function(){var tn;(tn=Mt.current)===null||tn===void 0||tn.call(Mt)}),ze==null||ze(Zt,un))}var Yt=Object(N.a)({},Hn(de));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Zt){var un=Yt[Zt];Yt[Zt]=function(sn,tn){return Ct(),un==null?void 0:un(sn,tn)}});function hn(){return new Promise(function(Zt){Mt.current=Zt})}S.useEffect(function(){!Yt.motionName&&Wt==="motion"&&Ct()},[Yt.motionName,Wt]),S.useImperativeHandle(Te,function(){return{forceAlign:an,getElement:function(){return dt.current}}});var vn=Object(N.a)(Object(N.a)({},nt),{},{zIndex:fe,opacity:Wt==="motion"||Wt==="stable"||!Ae?void 0:0,pointerEvents:Wt==="stable"?void 0:"none"},ae),fn=!0;(Le==null?void 0:Le.points)&&(Wt==="align"||Wt==="stable")&&(fn=!1);var pn=Q;return S.Children.count(Q)>1&&(pn=S.createElement("div",{className:"".concat(pe,"-content")},Q)),S.createElement(On,Object(p.a)({visible:Ae,ref:dt,leavedClassName:"".concat(pe,"-hidden")},Yt,{onAppearPrepare:hn,onEnterPrepare:hn,removeOnLeave:we,forceRender:xe}),function(Zt,un){var sn=Zt.className,tn=Zt.style,bn=F()(pe,X,bt,sn);return S.createElement(ai.a,{target:Gt(),key:"popup",ref:vt,monitorWindowResize:!0,disabled:fn,align:Le,onAlign:cn},S.createElement("div",{ref:un,className:bn,onMouseEnter:at,onMouseLeave:gt,onMouseDownCapture:lt,onTouchStartCapture:_t,style:Object(N.a)(Object(N.a)({},tn),vn)},pn))})});Xn.displayName="PopupInner";var li=Xn,Yn=S.forwardRef(function(de,Te){var Ae=de.prefixCls,pe=de.visible,X=de.zIndex,ae=de.children,Q=de.mobile;Q=Q===void 0?{}:Q;var fe=Q.popupClassName,me=Q.popupStyle,we=Q.popupMotion,xe=we===void 0?{}:we,Le=Q.popupRender,ke=S.useRef();S.useImperativeHandle(Te,function(){return{forceAlign:function(){},getElement:function(){return ke.current}}});var je=Object(N.a)({zIndex:X},me),Fe=ae;return S.Children.count(ae)>1&&(Fe=S.createElement("div",{className:"".concat(Ae,"-content")},ae)),Le&&(Fe=Le(Fe)),S.createElement(On,Object(p.a)({visible:pe,ref:ke,removeOnLeave:!0},xe),function(ze,at){var gt=ze.className,lt=ze.style,_t=F()(Ae,fe,gt);return S.createElement("div",{ref:at,className:_t,style:Object(N.a)(Object(N.a)({},lt),je)},Fe)})});Yn.displayName="MobilePopupInner";var ui=Yn,di=["visible","mobile"],$n=S.forwardRef(function(de,Te){var Ae=de.visible,pe=de.mobile,X=Object(R.a)(de,di),ae=Object(S.useState)(Ae),Q=Object(W.a)(ae,2),fe=Q[0],me=Q[1],we=Object(S.useState)(!1),xe=Object(W.a)(we,2),Le=xe[0],ke=xe[1],je=Object(N.a)(Object(N.a)({},X),{},{visible:fe});Object(S.useEffect)(function(){me(Ae),Ae&&pe&&ke(G())},[Ae,pe]);var Fe=Le?S.createElement(ui,Object(p.a)({},je,{mobile:pe,ref:Te})):S.createElement(li,Object(p.a)({},je,{ref:Te}));return S.createElement("div",null,S.createElement(Kn,je),Fe)});$n.displayName="Popup";var ci=$n,hi=S.createContext(null),Qn=hi;function tt(){}function et(){return""}function mt(de){return de?de.ownerDocument:window.document}var Ot=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function qt(de){var Te=function(Ae){Object(f.a)(X,Ae);var pe=Object(m.a)(X);function X(ae){var Q;Object(b.a)(this,X),Q=pe.call(this,ae),Q.popupRef=S.createRef(),Q.triggerRef=S.createRef(),Q.attachId=void 0,Q.clickOutsideHandler=void 0,Q.touchOutsideHandler=void 0,Q.contextMenuOutsideHandler1=void 0,Q.contextMenuOutsideHandler2=void 0,Q.mouseDownTimeout=void 0,Q.focusTime=void 0,Q.preClickTime=void 0,Q.preTouchTime=void 0,Q.delayTimer=void 0,Q.hasPopupMouseDown=void 0,Q.onMouseEnter=function(me){var we=Q.props.mouseEnterDelay;Q.fireEvents("onMouseEnter",me),Q.delaySetPopupVisible(!0,we,we?null:me)},Q.onMouseMove=function(me){Q.fireEvents("onMouseMove",me),Q.setPoint(me)},Q.onMouseLeave=function(me){Q.fireEvents("onMouseLeave",me),Q.delaySetPopupVisible(!1,Q.props.mouseLeaveDelay)},Q.onPopupMouseEnter=function(){Q.clearDelayTimer()},Q.onPopupMouseLeave=function(me){var we;if(me.relatedTarget&&!me.relatedTarget.setTimeout&&Object(He.a)((we=Q.popupRef.current)===null||we===void 0?void 0:we.getElement(),me.relatedTarget))return;Q.delaySetPopupVisible(!1,Q.props.mouseLeaveDelay)},Q.onFocus=function(me){Q.fireEvents("onFocus",me),Q.clearDelayTimer(),Q.isFocusToShow()&&(Q.focusTime=Date.now(),Q.delaySetPopupVisible(!0,Q.props.focusDelay))},Q.onMouseDown=function(me){Q.fireEvents("onMouseDown",me),Q.preClickTime=Date.now()},Q.onTouchStart=function(me){Q.fireEvents("onTouchStart",me),Q.preTouchTime=Date.now()},Q.onBlur=function(me){Q.fireEvents("onBlur",me),Q.clearDelayTimer(),Q.isBlurToHide()&&Q.delaySetPopupVisible(!1,Q.props.blurDelay)},Q.onContextMenu=function(me){me.preventDefault(),Q.fireEvents("onContextMenu",me),Q.setPopupVisible(!0,me)},Q.onContextMenuClose=function(){Q.isContextMenuToShow()&&Q.close()},Q.onClick=function(me){if(Q.fireEvents("onClick",me),Q.focusTime){var we;if(Q.preClickTime&&Q.preTouchTime?we=Math.min(Q.preClickTime,Q.preTouchTime):Q.preClickTime?we=Q.preClickTime:Q.preTouchTime&&(we=Q.preTouchTime),Math.abs(we-Q.focusTime)<20)return;Q.focusTime=0}Q.preClickTime=0,Q.preTouchTime=0,Q.isClickToShow()&&(Q.isClickToHide()||Q.isBlurToHide())&&me&&me.preventDefault&&me.preventDefault();var xe=!Q.state.popupVisible;(Q.isClickToHide()&&!xe||xe&&Q.isClickToShow())&&Q.setPopupVisible(!Q.state.popupVisible,me)},Q.onPopupMouseDown=function(){if(Q.hasPopupMouseDown=!0,clearTimeout(Q.mouseDownTimeout),Q.mouseDownTimeout=window.setTimeout(function(){Q.hasPopupMouseDown=!1},0),Q.context){var me;(me=Q.context).onPopupMouseDown.apply(me,arguments)}},Q.onDocumentClick=function(me){if(Q.props.mask&&!Q.props.maskClosable)return;var we=me.target,xe=Q.getRootDomNode(),Le=Q.getPopupDomNode();(!Object(He.a)(xe,we)||Q.isContextMenuOnly())&&!Object(He.a)(Le,we)&&!Q.hasPopupMouseDown&&Q.close()},Q.getRootDomNode=function(){var me=Q.props.getTriggerDOMNode;if(me)return me(Q.triggerRef.current);try{var we=Object(We.a)(Q.triggerRef.current);if(we)return we}catch(xe){}return Ie.a.findDOMNode(Object(d.a)(Q))},Q.getPopupClassNameFromAlign=function(me){var we=[],xe=Q.props,Le=xe.popupPlacement,ke=xe.builtinPlacements,je=xe.prefixCls,Fe=xe.alignPoint,ze=xe.getPopupClassNameFromAlign;return Le&&ke&&we.push(z(ke,je,me,Fe)),ze&&we.push(ze(me)),we.join(" ")},Q.getComponent=function(){var me=Q.props,we=me.prefixCls,xe=me.destroyPopupOnHide,Le=me.popupClassName,ke=me.onPopupAlign,je=me.popupMotion,Fe=me.popupAnimation,ze=me.popupTransitionName,at=me.popupStyle,gt=me.mask,lt=me.maskAnimation,_t=me.maskTransitionName,vt=me.maskMotion,dt=me.zIndex,ct=me.popup,At=me.stretch,bt=me.alignPoint,zt=me.mobile,Lt=me.forceRender,rt=Q.state,nt=rt.popupVisible,Tt=rt.point,St=Q.getPopupAlign(),$e={};return Q.isMouseEnterToShow()&&($e.onMouseEnter=Q.onPopupMouseEnter),Q.isMouseLeaveToHide()&&($e.onMouseLeave=Q.onPopupMouseLeave),$e.onMouseDown=Q.onPopupMouseDown,$e.onTouchStart=Q.onPopupMouseDown,S.createElement(ci,Object(p.a)({prefixCls:we,destroyPopupOnHide:xe,visible:nt,point:bt&&Tt,className:Le,align:St,onAlign:ke,animation:Fe,getClassNameFromAlign:Q.getPopupClassNameFromAlign},$e,{stretch:At,getRootDomNode:Q.getRootDomNode,style:at,mask:gt,zIndex:dt,transitionName:ze,maskAnimation:lt,maskTransitionName:_t,maskMotion:vt,ref:Q.popupRef,motion:je,mobile:zt,forceRender:Lt}),typeof ct=="function"?ct():ct)},Q.attachParent=function(me){Me.a.cancel(Q.attachId);var we=Q.props,xe=we.getPopupContainer,Le=we.getDocument,ke=Q.getRootDomNode(),je;xe?(ke||xe.length===0)&&(je=xe(ke)):je=Le(Q.getRootDomNode()).body,je?je.appendChild(me):Q.attachId=Object(Me.a)(function(){Q.attachParent(me)})},Q.getContainer=function(){var me=Q.props.getDocument,we=me(Q.getRootDomNode()).createElement("div");return we.style.position="absolute",we.style.top="0",we.style.left="0",we.style.width="100%",Q.attachParent(we),we},Q.setPoint=function(me){var we=Q.props.alignPoint;if(!we||!me)return;Q.setState({point:{pageX:me.pageX,pageY:me.pageY}})},Q.handlePortalUpdate=function(){Q.state.prevPopupVisible!==Q.state.popupVisible&&Q.props.afterPopupVisibleChange(Q.state.popupVisible)},Q.triggerContextValue={onPopupMouseDown:Q.onPopupMouseDown};var fe;return"popupVisible"in ae?fe=!!ae.popupVisible:fe=!!ae.defaultPopupVisible,Q.state={prevPopupVisible:fe,popupVisible:fe},Ot.forEach(function(me){Q["fire".concat(me)]=function(we){Q.fireEvents(me,we)}}),Q}return Object(y.a)(X,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Q=this.props,fe=this.state;if(fe.popupVisible){var me;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(me=Q.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Be.a)(me,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(me=me||Q.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Be.a)(me,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(me=me||Q.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Be.a)(me,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Be.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Me.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var Q;return((Q=this.popupRef.current)===null||Q===void 0?void 0:Q.getElement())||null}},{key:"getPopupAlign",value:function(){var Q=this.props,fe=Q.popupPlacement,me=Q.popupAlign,we=Q.builtinPlacements;return fe&&we?ne(we,fe,me):me}},{key:"setPopupVisible",value:function(Q,fe){var me=this.props.alignPoint,we=this.state.popupVisible;this.clearDelayTimer(),we!==Q&&("popupVisible"in this.props||this.setState({popupVisible:Q,prevPopupVisible:we}),this.props.onPopupVisibleChange(Q)),me&&fe&&Q&&this.setPoint(fe)}},{key:"delaySetPopupVisible",value:function(Q,fe,me){var we=this,xe=fe*1e3;if(this.clearDelayTimer(),xe){var Le=me?{pageX:me.pageX,pageY:me.pageY}:null;this.delayTimer=window.setTimeout(function(){we.setPopupVisible(Q,Le),we.clearDelayTimer()},xe)}else this.setPopupVisible(Q,me)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(Q){var fe=this.props.children.props,me=this.props;return fe[Q]&&me[Q]?this["fire".concat(Q)]:fe[Q]||me[Q]}},{key:"isClickToShow",value:function(){var Q=this.props,fe=Q.action,me=Q.showAction;return fe.indexOf("click")!==-1||me.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var Q=this.props.action;return Q==="contextMenu"||Q.length===1&&Q[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var Q=this.props,fe=Q.action,me=Q.showAction;return fe.indexOf("contextMenu")!==-1||me.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var Q=this.props,fe=Q.action,me=Q.hideAction;return fe.indexOf("click")!==-1||me.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var Q=this.props,fe=Q.action,me=Q.showAction;return fe.indexOf("hover")!==-1||me.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var Q=this.props,fe=Q.action,me=Q.hideAction;return fe.indexOf("hover")!==-1||me.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var Q=this.props,fe=Q.action,me=Q.showAction;return fe.indexOf("focus")!==-1||me.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var Q=this.props,fe=Q.action,me=Q.hideAction;return fe.indexOf("focus")!==-1||me.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var Q;(Q=this.popupRef.current)===null||Q===void 0||Q.forceAlign()}}},{key:"fireEvents",value:function(Q,fe){var me=this.props.children.props[Q];me&&me(fe);var we=this.props[Q];we&&we(fe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var Q=this.state.popupVisible,fe=this.props,me=fe.children,we=fe.forceRender,xe=fe.alignPoint,Le=fe.className,ke=fe.autoDestroy,je=S.Children.only(me),Fe={key:"trigger"};this.isContextMenuToShow()?Fe.onContextMenu=this.onContextMenu:Fe.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Fe.onClick=this.onClick,Fe.onMouseDown=this.onMouseDown,Fe.onTouchStart=this.onTouchStart):(Fe.onClick=this.createTwoChains("onClick"),Fe.onMouseDown=this.createTwoChains("onMouseDown"),Fe.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Fe.onMouseEnter=this.onMouseEnter,xe&&(Fe.onMouseMove=this.onMouseMove)):Fe.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Fe.onMouseLeave=this.onMouseLeave:Fe.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Fe.onFocus=this.onFocus,Fe.onBlur=this.onBlur):(Fe.onFocus=this.createTwoChains("onFocus"),Fe.onBlur=this.createTwoChains("onBlur"));var ze=F()(je&&je.props&&je.props.className,Le);ze&&(Fe.className=ze);var at=Object(N.a)({},Fe);Object(Ge.c)(je)&&(at.ref=Object(Ge.a)(this.triggerRef,je.ref));var gt=S.cloneElement(je,at),lt;return(Q||this.popupRef.current||we)&&(lt=S.createElement(de,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!Q&&ke&&(lt=null),S.createElement(Qn.Provider,{value:this.triggerContextValue},gt,lt)}}],[{key:"getDerivedStateFromProps",value:function(Q,fe){var me=Q.popupVisible,we={};return me!==void 0&&fe.popupVisible!==me&&(we.popupVisible=me,we.prevPopupVisible=fe.popupVisible),we}}]),X}(S.Component);return Te.contextType=Qn,Te.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:et,getDocument:mt,onPopupVisibleChange:tt,afterPopupVisibleChange:tt,onPopupAlign:tt,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Te}var Xt=qt(Xe.a),_n={adjustX:1,adjustY:1},wi={topLeft:{points:["bl","tl"],overflow:_n,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_n,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:_n,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:_n,offset:[4,0]}},mr={topLeft:{points:["bl","tl"],overflow:_n,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_n,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:_n,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:_n,offset:[4,0]}},ha=wi,Ci=0,gr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Pn=function(Te,Ae,pe){var X=ie(Ae),ae=Te.getState();Te.setState({defaultActiveFirst:Object(N.a)(Object(N.a)({},ae.defaultActiveFirst),{},Object(ue.a)({},X,pe))})},Oi=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(pe){var X;Object(b.a)(this,Ae),X=Te.call(this,pe),X.onDestroy=function(xe){X.props.onDestroy(xe)},X.onKeyDown=function(xe){var Le=xe.keyCode,ke=X.menuInstance,je=X.props.store,Fe=X.getVisible();if(Le===o.a.ENTER)return X.onTitleClick(xe),Pn(je,X.props.eventKey,!0),!0;if(Le===o.a.RIGHT)return Fe?ke.onKeyDown(xe):(X.triggerOpenChange(!0),Pn(je,X.props.eventKey,!0)),!0;if(Le===o.a.LEFT){var ze;if(Fe)ze=ke.onKeyDown(xe);else return;return ze||(X.triggerOpenChange(!1),ze=!0),ze}return Fe&&(Le===o.a.UP||Le===o.a.DOWN)?ke.onKeyDown(xe):void 0},X.onOpenChange=function(xe){X.props.onOpenChange(xe)},X.onPopupVisibleChange=function(xe){X.triggerOpenChange(xe,xe?"mouseenter":"mouseleave")},X.onMouseEnter=function(xe){var Le=X.props,ke=Le.eventKey,je=Le.onMouseEnter,Fe=Le.store;Pn(Fe,X.props.eventKey,!1),je({key:ke,domEvent:xe})},X.onMouseLeave=function(xe){var Le=X.props,ke=Le.parentMenu,je=Le.eventKey,Fe=Le.onMouseLeave;ke.subMenuInstance=Object(d.a)(X),Fe({key:je,domEvent:xe})},X.onTitleMouseEnter=function(xe){var Le=X.props,ke=Le.eventKey,je=Le.onItemHover,Fe=Le.onTitleMouseEnter;je({key:ke,hover:!0}),Fe({key:ke,domEvent:xe})},X.onTitleMouseLeave=function(xe){var Le=X.props,ke=Le.parentMenu,je=Le.eventKey,Fe=Le.onItemHover,ze=Le.onTitleMouseLeave;ke.subMenuInstance=Object(d.a)(X),Fe({key:je,hover:!1}),ze({key:je,domEvent:xe})},X.onTitleClick=function(xe){var Le=Object(d.a)(X),ke=Le.props;if(ke.onTitleClick({key:ke.eventKey,domEvent:xe}),ke.triggerSubMenuAction==="hover")return;X.triggerOpenChange(!X.getVisible(),"click"),Pn(ke.store,X.props.eventKey,!1)},X.onSubMenuClick=function(xe){typeof X.props.onClick=="function"&&X.props.onClick(X.addKeyPath(xe))},X.onSelect=function(xe){X.props.onSelect(xe)},X.onDeselect=function(xe){X.props.onDeselect(xe)},X.getPrefixCls=function(){return"".concat(X.props.rootPrefixCls,"-submenu")},X.getActiveClassName=function(){return"".concat(X.getPrefixCls(),"-active")},X.getDisabledClassName=function(){return"".concat(X.getPrefixCls(),"-disabled")},X.getSelectedClassName=function(){return"".concat(X.getPrefixCls(),"-selected")},X.getOpenClassName=function(){return"".concat(X.props.rootPrefixCls,"-submenu-open")},X.getVisible=function(){return X.state.isOpen},X.getMode=function(){return X.state.mode},X.saveMenuInstance=function(xe){X.menuInstance=xe},X.addKeyPath=function(xe){return Object(N.a)(Object(N.a)({},xe),{},{keyPath:(xe.keyPath||[]).concat(X.props.eventKey)})},X.triggerOpenChange=function(xe,Le){var ke=X.props.eventKey,je=function(){X.onOpenChange({key:ke,item:Object(d.a)(X),trigger:Le,open:xe})};Le==="mouseenter"?X.mouseenterTimeout=setTimeout(function(){je()},0):je()},X.isChildrenSelected=function(){var xe={find:!1};return Oe(X.props.children,X.props.selectedKeys,xe),xe.find},X.isInlineMode=function(){return X.getMode()==="inline"},X.adjustWidth=function(){if(!X.subMenuTitle||!X.menuInstance)return;var xe=Ne.findDOMNode(X.menuInstance);if(xe.offsetWidth>=X.subMenuTitle.offsetWidth)return;xe.style.minWidth="".concat(X.subMenuTitle.offsetWidth,"px")},X.saveSubMenuTitle=function(xe){X.subMenuTitle=xe},X.getBaseProps=function(){var xe=Object(d.a)(X),Le=xe.props,ke=X.getMode();return{mode:ke==="horizontal"?"vertical":ke,visible:X.getVisible(),level:Le.level+1,inlineIndent:Le.inlineIndent,focusable:!1,onClick:X.onSubMenuClick,onSelect:X.onSelect,onDeselect:X.onDeselect,onDestroy:X.onDestroy,selectedKeys:Le.selectedKeys,eventKey:"".concat(Le.eventKey,"-menu-"),openKeys:Le.openKeys,motion:Le.motion,onOpenChange:X.onOpenChange,subMenuOpenDelay:Le.subMenuOpenDelay,parentMenu:Object(d.a)(X),subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,triggerSubMenuAction:Le.triggerSubMenuAction,builtinPlacements:Le.builtinPlacements,defaultActiveFirst:Le.store.getState().defaultActiveFirst[ie(Le.eventKey)],multiple:Le.multiple,prefixCls:Le.rootPrefixCls,id:X.internalMenuId,manualRef:X.saveMenuInstance,itemIcon:Le.itemIcon,expandIcon:Le.expandIcon,direction:Le.direction}},X.getMotion=function(xe,Le){var ke=Object(d.a)(X),je=ke.haveRendered,Fe=X.props,ze=Fe.motion,at=Fe.rootPrefixCls,gt=Object(N.a)(Object(N.a)({},ze),{},{leavedClassName:"".concat(at,"-hidden"),removeOnLeave:!1,motionAppear:je||!Le||xe!=="inline"});return gt};var ae=pe.store,Q=pe.eventKey,fe=ae.getState(),me=fe.defaultActiveFirst;X.isRootMenu=!1;var we=!1;return me&&(we=me[Q]),Pn(ae,Q,we),X.state={mode:pe.mode,isOpen:pe.isOpen},X}return Object(y.a)(Ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var X=this,ae=this.props,Q=ae.mode,fe=ae.parentMenu,me=ae.manualRef,we=ae.isOpen,xe=function(){X.setState({mode:Q,isOpen:we})},Le=we!==this.state.isOpen,ke=Q!==this.state.mode;if((ke||Le)&&(Me.a.cancel(this.updateStateRaf),ke?this.updateStateRaf=Object(Me.a)(xe):xe()),me&&me(this),Q!=="horizontal"||!(fe==null?void 0:fe.isRootMenu)||!we)return;this.minWidthTimeout=setTimeout(function(){return X.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var X=this.props,ae=X.onDestroy,Q=X.eventKey;ae&&ae(Q),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Me.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(X,ae){var Q=this.getBaseProps();return S.createElement(Pi,Object(p.a)({},Q,{id:this.internalMenuId,className:X,style:ae}),this.props.children)}},{key:"renderChildren",value:function(){var X=this,ae=this.getBaseProps(),Q=ae.mode,fe=ae.visible,me=ae.forceSubMenuRender,we=ae.direction,xe=this.getMotion(Q,fe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||fe||me,!this.haveOpened)return S.createElement("div",null);var Le=F()("".concat(ae.prefixCls,"-sub"),Object(ue.a)({},"".concat(ae.prefixCls,"-rtl"),we==="rtl"));return this.isInlineMode()?S.createElement(On,Object(p.a)({visible:ae.visible,forceRender:me},xe),function(ke){var je=ke.className,Fe=ke.style,ze=F()(Le,je);return X.renderPopupMenu(ze,Fe)}):this.renderPopupMenu(Le)}},{key:"render",value:function(){var X,ae,Q,fe=Object(N.a)({},this.props),me=this.getVisible(),we=this.getPrefixCls(),xe=this.isInlineMode(),Le=this.getMode(),ke=F()(we,"".concat(we,"-").concat(Le),(X={},Object(ue.a)(X,fe.className,!!fe.className),Object(ue.a)(X,this.getOpenClassName(),me),Object(ue.a)(X,this.getActiveClassName(),fe.active||me&&!xe),Object(ue.a)(X,this.getDisabledClassName(),fe.disabled),Object(ue.a)(X,this.getSelectedClassName(),this.isChildrenSelected()),X));this.internalMenuId||(fe.eventKey?this.internalMenuId="".concat(fe.eventKey,"$Menu"):(Ci+=1,this.internalMenuId="$__$".concat(Ci,"$Menu")));var je={},Fe={},ze={};fe.disabled||(je={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Fe={onClick:this.onTitleClick},ze={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var at={},gt=fe.direction,lt=gt==="rtl";xe&&(lt?at.paddingRight=fe.inlineIndent*fe.level:at.paddingLeft=fe.inlineIndent*fe.level);var _t={};this.getVisible()&&(_t={"aria-owns":this.internalMenuId});var vt=null;Le!=="horizontal"&&(vt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(vt=S.createElement(this.props.expandIcon,Object(N.a)({},this.props))));var dt=S.createElement("div",Object(p.a)({ref:this.saveSubMenuTitle,style:at,className:"".concat(we,"-title"),role:"button"},ze,Fe,{"aria-expanded":me},_t,{"aria-haspopup":"true",title:typeof fe.title=="string"?fe.title:void 0}),fe.title,vt||S.createElement("i",{className:"".concat(we,"-arrow")})),ct=this.renderChildren(),At=((ae=fe.parentMenu)===null||ae===void 0?void 0:ae.isRootMenu)?fe.parentMenu.props.getPopupContainer:function(Gt){return Gt.parentNode},bt=gr[Le],zt=fe.popupOffset?{offset:fe.popupOffset}:{},Lt=F()((Q={},Object(ue.a)(Q,fe.popupClassName,fe.popupClassName&&!xe),Object(ue.a)(Q,"".concat(we,"-rtl"),lt),Q)),rt=fe.disabled,nt=fe.triggerSubMenuAction,Tt=fe.subMenuOpenDelay,St=fe.forceSubMenuRender,$e=fe.subMenuCloseDelay,wt=fe.builtinPlacements;q.forEach(function(Gt){return delete fe[Gt]}),delete fe.onClick;var Wt=lt?Object(N.a)(Object(N.a)({},mr),wt):Object(N.a)(Object(N.a)({},wi),wt);delete fe.direction;var Ct=this.getBaseProps(),Mt=xe?null:this.getMotion(Ct.mode,Ct.visible);return S.createElement("li",Object(p.a)({},fe,je,{className:ke,role:"menuitem"}),S.createElement(Xt,{prefixCls:we,popupClassName:F()("".concat(we,"-popup"),Lt),getPopupContainer:At,builtinPlacements:Wt,popupPlacement:bt,popupVisible:xe?!1:me,popupAlign:zt,popup:xe?null:ct,action:rt||xe?[]:[nt],mouseEnterDelay:Tt,mouseLeaveDelay:$e,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:St,popupMotion:Mt},dt),xe?ct:null)}}]),Ae}(S.Component);Oi.defaultProps={onMouseEnter:K,onMouseLeave:K,onTitleMouseEnter:K,onTitleMouseLeave:K,onTitleClick:K,manualRef:K,mode:"vertical",title:""};var Ri=Object(h.b)(function(de,Te){var Ae=de.openKeys,pe=de.activeKey,X=de.selectedKeys,ae=Te.eventKey,Q=Te.subMenuKey;return{isOpen:Ae.indexOf(ae)>-1,active:pe[Q]===ae,selectedKeys:X}})(Oi);Ri.isSubMenu=!0;var vr=Ri,Ii="menuitem-overflowed",yr=.5,Di=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(){var pe;return Object(b.a)(this,Ae),pe=Te.apply(this,arguments),pe.resizeObserver=null,pe.mutationObserver=null,pe.originalTotalWidth=0,pe.overflowedItems=[],pe.menuItemSizes=[],pe.cancelFrameId=null,pe.state={lastVisibleIndex:void 0},pe.childRef=S.createRef(),pe.getMenuItemNodes=function(){var X=pe.props.prefixCls,ae=pe.childRef.current;return ae?[].slice.call(ae.children).filter(function(Q){return Q.className.split(" ").indexOf("".concat(X,"-overflowed-submenu"))<0}):[]},pe.getOverflowedSubMenuItem=function(X,ae,Q){var fe=pe.props,me=fe.overflowedIndicator,we=fe.level,xe=fe.mode,Le=fe.prefixCls,ke=fe.theme;if(we!==1||xe!=="horizontal")return null;var je=pe.props.children[0],Fe=je.props,ze=Fe.children,at=Fe.title,gt=Fe.style,lt=Object(R.a)(Fe,["children","title","style"]),_t=Object(N.a)({},gt),vt="".concat(X,"-overflowed-indicator"),dt="".concat(X,"-overflowed-indicator");ae.length===0&&Q!==!0?_t=Object(N.a)(Object(N.a)({},_t),{},{display:"none"}):Q&&(_t=Object(N.a)(Object(N.a)({},_t),{},{visibility:"hidden",position:"absolute"}),vt="".concat(vt,"-placeholder"),dt="".concat(dt,"-placeholder"));var ct=ke?"".concat(Le,"-").concat(ke):"",At={};return q.forEach(function(bt){lt[bt]!==void 0&&(At[bt]=lt[bt])}),S.createElement(vr,Object(p.a)({title:me,className:"".concat(Le,"-overflowed-submenu"),popupClassName:ct},At,{key:vt,eventKey:dt,disabled:!1,style:_t}),ae)},pe.setChildrenWidthAndResize=function(){if(pe.props.mode!=="horizontal")return;var X=pe.childRef.current;if(!X)return;var ae=X.children;if(!ae||ae.length===0)return;var Q=X.children[ae.length-1];Se(Q,"display","inline-block");var fe=pe.getMenuItemNodes(),me=fe.filter(function(we){return we.className.split(" ").indexOf(Ii)>=0});me.forEach(function(we){Se(we,"display","inline-block")}),pe.menuItemSizes=fe.map(function(we){return ce(we,!0)}),me.forEach(function(we){Se(we,"display","none")}),pe.overflowedIndicatorWidth=ce(X.children[X.children.length-1],!0),pe.originalTotalWidth=pe.menuItemSizes.reduce(function(we,xe){return we+xe},0),pe.handleResize(),Se(Q,"display","none")},pe.handleResize=function(){if(pe.props.mode!=="horizontal")return;var X=pe.childRef.current;if(!X)return;var ae=ce(X);pe.overflowedItems=[];var Q=0,fe;pe.originalTotalWidth>ae+yr&&(fe=-1,pe.menuItemSizes.forEach(function(me){Q+=me,Q+pe.overflowedIndicatorWidth<=ae&&(fe+=1)})),pe.setState({lastVisibleIndex:fe})},pe}return Object(y.a)(Ae,[{key:"componentDidMount",value:function(){var X=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ae=this.childRef.current;if(!ae)return;this.resizeObserver=new Pe.default(function(Q){Q.forEach(function(){var fe=X.cancelFrameId;cancelAnimationFrame(fe),X.cancelFrameId=requestAnimationFrame(X.setChildrenWidthAndResize)})}),[].slice.call(ae.children).concat(ae).forEach(function(Q){X.resizeObserver.observe(Q)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){X.resizeObserver.disconnect(),[].slice.call(ae.children).concat(ae).forEach(function(Q){X.resizeObserver.observe(Q)}),X.setChildrenWidthAndResize()}),this.mutationObserver.observe(ae,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(X){var ae=this,Q=this.state.lastVisibleIndex;return(X||[]).reduce(function(fe,me,we){var xe=me;if(ae.props.mode==="horizontal"){var Le=ae.getOverflowedSubMenuItem(me.props.eventKey,[]);Q!==void 0&&ae.props.className.indexOf("".concat(ae.props.prefixCls,"-root"))!==-1&&(we>Q&&(xe=S.cloneElement(me,{style:{display:"none"},eventKey:"".concat(me.props.eventKey,"-hidden"),className:"".concat(Ii)})),we===Q+1&&(ae.overflowedItems=X.slice(Q+1).map(function(je){return S.cloneElement(je,{key:je.props.eventKey,mode:"vertical-left"})}),Le=ae.getOverflowedSubMenuItem(me.props.eventKey,ae.overflowedItems)));var ke=[].concat(Object(w.a)(fe),[Le,xe]);return we===X.length-1&&ke.push(ae.getOverflowedSubMenuItem(me.props.eventKey,[],!0)),ke}return[].concat(Object(w.a)(fe),[xe])},[])}},{key:"render",value:function(){var X=this.props,ae=X.visible,Q=X.prefixCls,fe=X.overflowedIndicator,me=X.mode,we=X.level,xe=X.tag,Le=X.children,ke=X.theme,je=Object(R.a)(X,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Fe=xe;return S.createElement(Fe,Object(p.a)({ref:this.childRef},je),this.renderChildren(Le))}}]),Ae}(S.Component);Di.defaultProps={tag:"div",className:""};var _r=Di;function br(de){return de.length?de.every(function(Te){return!!Te.props.disabled}):!0}function Zn(de,Te,Ae){var pe=de.getState();de.setState({activeKey:Object(N.a)(Object(N.a)({},pe.activeKey),{},Object(ue.a)({},Te,Ae))})}function Rn(de){return de.eventKey||"0-menu-"}function Jn(de,Te){var Ae=Te,pe=de.children,X=de.eventKey;if(Ae){var ae;if(Ee(pe,function(Q,fe){Q&&Q.props&&!Q.props.disabled&&Ae===M(Q,X,fe)&&(ae=!0)}),ae)return Ae}return Ae=null,de.defaultActiveFirst&&Ee(pe,function(Q,fe){!Ae&&Q&&!Q.props.disabled&&(Ae=M(Q,X,fe))}),Ae}function Er(de){if(!de)return;var Te=this.instanceArray.indexOf(de);Te!==-1?this.instanceArray[Te]=de:this.instanceArray.push(de)}var Li=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(pe){var X;return Object(b.a)(this,Ae),X=Te.call(this,pe),X.onKeyDown=function(ae,Q){var fe=ae.keyCode,me;if(X.getFlatInstanceArray().forEach(function(xe){xe&&xe.props.active&&xe.onKeyDown&&(me=xe.onKeyDown(ae))}),me)return 1;var we=null;return(fe===o.a.UP||fe===o.a.DOWN)&&(we=X.step(fe===o.a.UP?-1:1)),we?(ae.preventDefault(),Zn(X.props.store,Rn(X.props),we.props.eventKey),typeof Q=="function"&&Q(we),1):void 0},X.onItemHover=function(ae){var Q=ae.key,fe=ae.hover;Zn(X.props.store,Rn(X.props),fe?Q:null)},X.onDeselect=function(ae){X.props.onDeselect(ae)},X.onSelect=function(ae){X.props.onSelect(ae)},X.onClick=function(ae){X.props.onClick(ae)},X.onOpenChange=function(ae){X.props.onOpenChange(ae)},X.onDestroy=function(ae){X.props.onDestroy(ae)},X.getFlatInstanceArray=function(){return X.instanceArray},X.step=function(ae){var Q=X.getFlatInstanceArray(),fe=X.props.store.getState().activeKey[Rn(X.props)],me=Q.length;if(!me)return null;ae<0&&(Q=Q.concat().reverse());var we=-1;if(Q.every(function(je,Fe){return je&&je.props.eventKey===fe?(we=Fe,!1):!0}),!X.props.defaultActiveFirst&&we!==-1&&br(Q.slice(we,me-1)))return;var xe=(we+1)%me,Le=xe;do{var ke=Q[Le];if(!ke||ke.props.disabled)Le=(Le+1)%me;else return ke}while(Le!==xe);return null},X.renderCommonMenuItem=function(ae,Q,fe){var me=X.props.store.getState(),we=Object(d.a)(X),xe=we.props,Le=M(ae,xe.eventKey,Q),ke=ae.props;if(!ke||typeof ae.type=="string")return ae;var je=Le===me.activeKey,Fe=Object(N.a)(Object(N.a)({mode:ke.mode||xe.mode,level:xe.level,inlineIndent:xe.inlineIndent,renderMenuItem:X.renderMenuItem,rootPrefixCls:xe.prefixCls,index:Q,parentMenu:xe.parentMenu,manualRef:ke.disabled?void 0:Object(_.a)(ae.ref,Er.bind(Object(d.a)(X))),eventKey:Le,active:!ke.disabled&&je,multiple:xe.multiple,onClick:function(at){(ke.onClick||K)(at),X.onClick(at)},onItemHover:X.onItemHover,motion:xe.motion,subMenuOpenDelay:xe.subMenuOpenDelay,subMenuCloseDelay:xe.subMenuCloseDelay,forceSubMenuRender:xe.forceSubMenuRender,onOpenChange:X.onOpenChange,onDeselect:X.onDeselect,onSelect:X.onSelect,builtinPlacements:xe.builtinPlacements,itemIcon:ke.itemIcon||X.props.itemIcon,expandIcon:ke.expandIcon||X.props.expandIcon},fe),{},{direction:xe.direction});return(xe.mode==="inline"||Ce())&&(Fe.triggerSubMenuAction="click"),S.cloneElement(ae,Object(N.a)(Object(N.a)({},Fe),{},{key:Le||Q}))},X.renderMenuItem=function(ae,Q,fe){if(!ae)return null;var me=X.props.store.getState(),we={openKeys:me.openKeys,selectedKeys:me.selectedKeys,triggerSubMenuAction:X.props.triggerSubMenuAction,subMenuKey:fe};return X.renderCommonMenuItem(ae,Q,we)},pe.store.setState({activeKey:Object(N.a)(Object(N.a)({},pe.store.getState().activeKey),{},Object(ue.a)({},pe.eventKey,Jn(pe,pe.activeKey)))}),X.instanceArray=[],X}return Object(y.a)(Ae,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(X){return this.props.visible||X.visible||this.props.className!==X.className||!k()(this.props.style,X.style)}},{key:"componentDidUpdate",value:function(X){var ae=this.props,Q="activeKey"in ae?ae.activeKey:ae.store.getState().activeKey[Rn(ae)],fe=Jn(ae,Q);if(fe!==Q)Zn(ae.store,Rn(ae),fe);else if("activeKey"in X){var me=Jn(X,X.activeKey);fe!==me&&Zn(ae.store,Rn(ae),fe)}}},{key:"render",value:function(){var X=this,ae=Object(p.a)({},this.props);this.instanceArray=[];var Q=F()(ae.prefixCls,ae.className,"".concat(ae.prefixCls,"-").concat(ae.mode)),fe={className:Q,role:ae.role||"menu"};ae.id&&(fe.id=ae.id),ae.focusable&&(fe.tabIndex=0,fe.onKeyDown=this.onKeyDown);var me=ae.prefixCls,we=ae.eventKey,xe=ae.visible,Le=ae.level,ke=ae.mode,je=ae.overflowedIndicator,Fe=ae.theme;return q.forEach(function(ze){return delete ae[ze]}),delete ae.onClick,S.createElement(_r,Object(p.a)({},ae,{prefixCls:me,mode:ke,tag:"ul",level:Le,theme:Fe,visible:xe,overflowedIndicator:je},fe),Object(B.a)(ae.children).map(function(ze,at){return X.renderMenuItem(ze,at,we||"0-menu-")}))}}]),Ae}(S.Component);Li.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:K};var Tr=Object(h.b)()(Li),Pi=Tr,xr=j("Kwbf");function Sr(de,Te,Ae){var pe=de.prefixCls,X=de.motion,ae=de.defaultMotions,Q=ae===void 0?{}:ae,fe=de.openAnimation,me=de.openTransitionName,we=Te.switchingModeFromInline;if(X)return X;if(Object(D.a)(fe)==="object"&&fe)Object(xr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof fe=="string")return{motionName:"".concat(pe,"-open-").concat(fe)};if(me)return{motionName:me};var xe=Q[Ae];return xe||(we?null:Q.other)}var Mi=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(pe){var X;Object(b.a)(this,Ae),X=Te.call(this,pe),X.onSelect=function(fe){var me=Object(d.a)(X),we=me.props;if(we.selectable){var xe=X.store.getState(),Le=xe.selectedKeys,ke=fe.key;we.multiple?Le=Le.concat([ke]):Le=[ke],"selectedKeys"in we||X.store.setState({selectedKeys:Le}),we.onSelect(Object(N.a)(Object(N.a)({},fe),{},{selectedKeys:Le}))}},X.onClick=function(fe){var me=X.getRealMenuMode(),we=Object(d.a)(X),xe=we.store,Le=we.props.onOpenChange;me!=="inline"&&!("openKeys"in X.props)&&(xe.setState({openKeys:[]}),Le([])),X.props.onClick(fe)},X.onKeyDown=function(fe,me){X.innerMenu.getWrappedInstance().onKeyDown(fe,me)},X.onOpenChange=function(fe){var me=Object(d.a)(X),we=me.props,xe=X.store.getState().openKeys.concat(),Le=!1,ke=function(Fe){var ze=!1;if(Fe.open)ze=xe.indexOf(Fe.key)===-1,ze&&xe.push(Fe.key);else{var at=xe.indexOf(Fe.key);ze=at!==-1,ze&&xe.splice(at,1)}Le=Le||ze};Array.isArray(fe)?fe.forEach(ke):ke(fe),Le&&("openKeys"in X.props||X.store.setState({openKeys:xe}),we.onOpenChange(xe))},X.onDeselect=function(fe){var me=Object(d.a)(X),we=me.props;if(we.selectable){var xe=X.store.getState().selectedKeys.concat(),Le=fe.key,ke=xe.indexOf(Le);ke!==-1&&xe.splice(ke,1),"selectedKeys"in we||X.store.setState({selectedKeys:xe}),we.onDeselect(Object(N.a)(Object(N.a)({},fe),{},{selectedKeys:xe}))}},X.onMouseEnter=function(fe){X.restoreModeVerticalFromInline();var me=X.props.onMouseEnter;me&&me(fe)},X.onTransitionEnd=function(fe){var me=fe.propertyName==="width"&&fe.target===fe.currentTarget,we=fe.target.className,xe=Object.prototype.toString.call(we)==="[object SVGAnimatedString]"?we.animVal:we,Le=fe.propertyName==="font-size"&&xe.indexOf("anticon")>=0;(me||Le)&&X.restoreModeVerticalFromInline()},X.setInnerMenu=function(fe){X.innerMenu=fe},X.isRootMenu=!0;var ae=pe.defaultSelectedKeys,Q=pe.defaultOpenKeys;return"selectedKeys"in pe&&(ae=pe.selectedKeys||[]),"openKeys"in pe&&(Q=pe.openKeys||[]),X.store=Object(h.c)({selectedKeys:ae,openKeys:Q,activeKey:{"0-menu-":Jn(pe,pe.activeKey)}}),X.state={switchingModeFromInline:!1,prevProps:pe,inlineOpenKeys:[],store:X.store},X}return Object(y.a)(Ae,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(X){var ae=this.props,Q=ae.siderCollapsed,fe=ae.inlineCollapsed,me=ae.onOpenChange;(!X.inlineCollapsed&&fe||!X.siderCollapsed&&Q)&&me([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var X=this.props.collapsedWidth,ae=this.store,Q=this.prevOpenKeys,fe=this.getInlineCollapsed()&&(X===0||X==="0"||X==="0px");fe?(this.prevOpenKeys=ae.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Q&&(this.store.setState({openKeys:Q}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var X=this.props.mode,ae=this.state.switchingModeFromInline,Q=this.getInlineCollapsed();return ae&&Q?"inline":Q?"vertical":X}},{key:"getInlineCollapsed",value:function(){var X=this.props,ae=X.inlineCollapsed,Q=X.siderCollapsed;return Q!==void 0?Q:ae}},{key:"restoreModeVerticalFromInline",value:function(){var X=this.state.switchingModeFromInline;X&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var X=Object(N.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ae=this.getRealMenuMode();return X.className+=" ".concat(X.prefixCls,"-root"),X.direction==="rtl"&&(X.className+=" ".concat(X.prefixCls,"-rtl")),X=Object(N.a)(Object(N.a)({},X),{},{mode:ae,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Sr(this.props,this.state,ae)}),delete X.openAnimation,delete X.openTransitionName,S.createElement(h.a,{store:this.store},S.createElement(Pi,Object(p.a)({},X,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(X,ae){var Q=ae.prevProps,fe=ae.store,me=fe.getState(),we={},xe={prevProps:X};return Q.mode==="inline"&&X.mode!=="inline"&&(xe.switchingModeFromInline=!0),"openKeys"in X?we.openKeys=X.openKeys||[]:((X.inlineCollapsed&&!Q.inlineCollapsed||X.siderCollapsed&&!Q.siderCollapsed)&&(xe.switchingModeFromInline=!0,xe.inlineOpenKeys=me.openKeys,we.openKeys=[]),(!X.inlineCollapsed&&Q.inlineCollapsed||!X.siderCollapsed&&Q.siderCollapsed)&&(we.openKeys=ae.inlineOpenKeys,xe.inlineOpenKeys=[])),Object.keys(we).length&&fe.setState(we),xe}}]),Ae}(S.Component);Mi.defaultProps={selectable:!0,onClick:K,onSelect:K,onOpenChange:K,onDeselect:K,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:S.createElement("span",null,"\xB7\xB7\xB7")};var Ar=Mi,fi=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(){var pe;return Object(b.a)(this,Ae),pe=Te.apply(this,arguments),pe.onKeyDown=function(X){var ae=X.keyCode;return ae===o.a.ENTER?(pe.onClick(X),!0):void 0},pe.onMouseLeave=function(X){var ae=pe.props,Q=ae.eventKey,fe=ae.onItemHover,me=ae.onMouseLeave;fe({key:Q,hover:!1}),me({key:Q,domEvent:X})},pe.onMouseEnter=function(X){var ae=pe.props,Q=ae.eventKey,fe=ae.onItemHover,me=ae.onMouseEnter;fe({key:Q,hover:!0}),me({key:Q,domEvent:X})},pe.onClick=function(X){var ae=pe.props,Q=ae.eventKey,fe=ae.multiple,me=ae.onClick,we=ae.onSelect,xe=ae.onDeselect,Le=ae.isSelected,ke={key:Q,keyPath:[Q],item:Object(d.a)(pe),domEvent:X};me(ke),fe?Le?xe(ke):we(ke):Le||we(ke)},pe.saveNode=function(X){pe.node=X},pe}return Object(y.a)(Ae,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var X=this.props;X.onDestroy&&X.onDestroy(X.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var X,ae=Object(N.a)({},this.props),Q=F()(this.getPrefixCls(),ae.className,(X={},Object(ue.a)(X,this.getActiveClassName(),!ae.disabled&&ae.active),Object(ue.a)(X,this.getSelectedClassName(),ae.isSelected),Object(ue.a)(X,this.getDisabledClassName(),ae.disabled),X)),fe=Object(N.a)(Object(N.a)({},ae.attribute),{},{title:typeof ae.title=="string"?ae.title:void 0,className:Q,role:ae.role||"menuitem","aria-disabled":ae.disabled});ae.role==="option"?fe=Object(N.a)(Object(N.a)({},fe),{},{role:"option","aria-selected":ae.isSelected}):(ae.role===null||ae.role==="none")&&(fe.role="none");var me={onClick:ae.disabled?null:this.onClick,onMouseLeave:ae.disabled?null:this.onMouseLeave,onMouseEnter:ae.disabled?null:this.onMouseEnter},we=Object(N.a)({},ae.style);ae.mode==="inline"&&(ae.direction==="rtl"?we.paddingRight=ae.inlineIndent*ae.level:we.paddingLeft=ae.inlineIndent*ae.level),q.forEach(function(Le){return delete ae[Le]}),delete ae.direction;var xe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(xe=S.createElement(this.props.itemIcon,this.props)),S.createElement("li",Object(p.a)({},Object(E.a)(ae,["onClick","onMouseEnter","onMouseLeave","onSelect"]),fe,me,{style:we,ref:this.saveNode}),ae.children,xe)}}]),Ae}(S.Component);fi.isMenuItem=!0,fi.defaultProps={onSelect:K,onMouseEnter:K,onMouseLeave:K,manualRef:K};var wr=Object(h.b)(function(de,Te){var Ae=de.activeKey,pe=de.selectedKeys,X=Te.eventKey,ae=Te.subMenuKey;return{active:Ae[ae]===X,isSelected:Array.isArray(pe)?pe.indexOf(X)!==-1:pe===X}})(fi),Cr=wr,pi=function(de){Object(f.a)(Ae,de);var Te=Object(m.a)(Ae);function Ae(){var pe;return Object(b.a)(this,Ae),pe=Te.apply(this,arguments),pe.renderInnerMenuItem=function(X){var ae=pe.props,Q=ae.renderMenuItem,fe=ae.index;return Q(X,fe,pe.props.subMenuKey)},pe}return Object(y.a)(Ae,[{key:"render",value:function(){var X=Object(p.a)({},this.props),ae=X.className,Q=ae===void 0?"":ae,fe=X.rootPrefixCls,me="".concat(fe,"-item-group-title"),we="".concat(fe,"-item-group-list"),xe=X.title,Le=X.children;return q.forEach(function(ke){return delete X[ke]}),delete X.direction,S.createElement("li",Object(p.a)({},X,{onClick:function(je){return je.stopPropagation()},className:"".concat(Q," ").concat(fe,"-item-group")}),S.createElement("div",{className:me,title:typeof xe=="string"?xe:void 0},xe),S.createElement("ul",{className:we},S.Children.map(Le,this.renderInnerMenuItem)))}}]),Ae}(S.Component);pi.isMenuItemGroup=!0,pi.defaultProps={disabled:!0};var fa=pi,ki=function(Te){var Ae=Te.className,pe=Te.rootPrefixCls,X=Te.style;return S.createElement("li",{className:"".concat(Ae," ").concat(pe,"-item-divider"),style:X})};ki.defaultProps={disabled:!0,className:"",style:{}};var pa=ki,Or=Ar,Rr=j("eDIo");function Ir(de,Te){var Ae=de.prefixCls,pe=de.editable,X=de.locale,ae=de.style;return!pe||pe.showAdd===!1?null:S.createElement("button",{ref:Te,type:"button",className:"".concat(Ae,"-nav-add"),style:ae,"aria-label":(X==null?void 0:X.addAriaLabel)||"Add tab",onClick:function(fe){pe.onEdit("add",{event:fe})}},pe.addIcon||"+")}var Ni=S.forwardRef(Ir);function Dr(de,Te){var Ae=de.prefixCls,pe=de.id,X=de.tabs,ae=de.locale,Q=de.mobile,fe=de.moreIcon,me=fe===void 0?"More":fe,we=de.moreTransitionName,xe=de.style,Le=de.className,ke=de.editable,je=de.tabBarGutter,Fe=de.rtl,ze=de.onTabClick,at=Object(S.useState)(!1),gt=Object(W.a)(at,2),lt=gt[0],_t=gt[1],vt=Object(S.useState)(null),dt=Object(W.a)(vt,2),ct=dt[0],At=dt[1],bt="".concat(pe,"-more-popup"),zt="".concat(Ae,"-dropdown"),Lt=ct!==null?"".concat(bt,"-").concat(ct):null,rt=ae==null?void 0:ae.dropdownAriaLabel,nt=S.createElement(Or,{onClick:function(Mt){var Gt=Mt.key,an=Mt.domEvent;ze(Gt,an),_t(!1)},id:bt,tabIndex:-1,role:"listbox","aria-activedescendant":Lt,selectedKeys:[ct],"aria-label":rt!==void 0?rt:"expanded dropdown"},X.map(function(Ct){return S.createElement(Cr,{key:Ct.key,id:"".concat(bt,"-").concat(Ct.key),role:"option","aria-controls":pe&&"".concat(pe,"-panel-").concat(Ct.key),disabled:Ct.disabled},Ct.tab)}));function Tt(Ct){for(var Mt=X.filter(function(hn){return!hn.disabled}),Gt=Mt.findIndex(function(hn){return hn.key===ct})||0,an=Mt.length,cn=0;cn<an;cn+=1){Gt=(Gt+Ct+an)%an;var Yt=Mt[Gt];if(!Yt.disabled){At(Yt.key);return}}}function St(Ct){var Mt=Ct.which;if(!lt){[o.a.DOWN,o.a.SPACE,o.a.ENTER].includes(Mt)&&(_t(!0),Ct.preventDefault());return}switch(Mt){case o.a.UP:Tt(-1),Ct.preventDefault();break;case o.a.DOWN:Tt(1),Ct.preventDefault();break;case o.a.ESC:_t(!1);break;case o.a.SPACE:case o.a.ENTER:ct!==null&&ze(ct,Ct);break}}Object(S.useEffect)(function(){var Ct=document.getElementById(Lt);Ct&&Ct.scrollIntoView&&Ct.scrollIntoView(!1)},[ct]),Object(S.useEffect)(function(){lt||At(null)},[lt]);var $e=Object(ue.a)({},Fe?"marginLeft":"marginRight",je);X.length||($e.visibility="hidden",$e.order=1);var wt=F()(Object(ue.a)({},"".concat(zt,"-rtl"),Fe)),Wt=Q?null:S.createElement(Rr.a,{prefixCls:zt,overlay:nt,trigger:["hover"],visible:lt,transitionName:we,onVisibleChange:_t,overlayClassName:wt,mouseEnterDelay:.1,mouseLeaveDelay:.1},S.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:$e,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":bt,id:"".concat(pe,"-more"),"aria-expanded":lt,onKeyDown:St},me));return S.createElement("div",{className:F()("".concat(Ae,"-nav-operations"),Le),style:xe,ref:Te},Wt,S.createElement(Ni,{prefixCls:Ae,locale:ae,editable:ke}))}var Lr=S.forwardRef(Dr),mi=Object(S.createContext)(null),Pr=.1,Ui=.01,qn=20,Bi=Math.pow(.995,qn);function Mr(){var de=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(de)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(de.substr(0,4)))}function kr(de,Te){var Ae=Object(S.useState)(),pe=Object(W.a)(Ae,2),X=pe[0],ae=pe[1],Q=Object(S.useState)(0),fe=Object(W.a)(Q,2),me=fe[0],we=fe[1],xe=Object(S.useState)(0),Le=Object(W.a)(xe,2),ke=Le[0],je=Le[1],Fe=Object(S.useState)(),ze=Object(W.a)(Fe,2),at=ze[0],gt=ze[1],lt=Object(S.useRef)();function _t(rt){var nt=rt.touches[0],Tt=nt.screenX,St=nt.screenY;ae({x:Tt,y:St}),window.clearInterval(lt.current)}function vt(rt){if(!X)return;rt.preventDefault();var nt=rt.touches[0],Tt=nt.screenX,St=nt.screenY;ae({x:Tt,y:St});var $e=Tt-X.x,wt=St-X.y;Te($e,wt);var Wt=Date.now();we(Wt),je(Wt-me),gt({x:$e,y:wt})}function dt(){if(!X)return;if(ae(null),gt(null),at){var rt=at.x/ke,nt=at.y/ke,Tt=Math.abs(rt),St=Math.abs(nt);if(Math.max(Tt,St)<Pr)return;var $e=rt,wt=nt;lt.current=window.setInterval(function(){if(Math.abs($e)<Ui&&Math.abs(wt)<Ui){window.clearInterval(lt.current);return}$e*=Bi,wt*=Bi,Te($e*qn,wt*qn)},qn)}}var ct=Object(S.useRef)(0),At=Object(S.useRef)(!1),bt=Object(S.useRef)();function zt(rt){var nt=rt.deltaX,Tt=rt.deltaY,St=0,$e=Math.abs(nt),wt=Math.abs(Tt);$e===wt?St=bt.current==="x"?nt:Tt:$e>wt?(St=nt,bt.current="x"):(St=Tt,bt.current="y");var Wt=Date.now();Wt-ct.current>100&&(At.current=!1),(Te(-St,-St)||At.current)&&(rt.preventDefault(),At.current=!0),ct.current=Wt}var Lt=Object(S.useRef)(null);Lt.current={onTouchStart:_t,onTouchMove:vt,onTouchEnd:dt,onWheel:zt},S.useEffect(function(){function rt($e){Lt.current.onTouchStart($e)}function nt($e){Lt.current.onTouchMove($e)}function Tt($e){Lt.current.onTouchEnd($e)}function St($e){Lt.current.onWheel($e)}return document.addEventListener("touchmove",nt,{passive:!1}),document.addEventListener("touchend",Tt,{passive:!1}),de.current.addEventListener("touchstart",rt,{passive:!1}),de.current.addEventListener("wheel",St),function(){document.removeEventListener("touchmove",nt),document.removeEventListener("touchend",Tt)}},[])}function Nr(){var de=Object(S.useRef)(new Map);function Te(pe){return de.current.has(pe)||de.current.set(pe,S.createRef()),de.current.get(pe)}function Ae(pe){de.current.delete(pe)}return[Te,Ae]}function Fi(de,Te){var Ae=S.useRef(de),pe=S.useState({}),X=Object(W.a)(pe,2),ae=X[1];function Q(fe){var me=typeof fe=="function"?fe(Ae.current):fe;me!==Ae.current&&Te(me,Ae.current),Ae.current=me,ae({})}return[Ae.current,Q]}var ji=function(Te){var Ae=Te.position,pe=Te.prefixCls,X=Te.extra;if(!X)return null;var ae,Q=X;return Ae==="right"&&(ae=Q.right||!Q.left&&Q||null),Ae==="left"&&(ae=Q.left||null),ae?S.createElement("div",{className:"".concat(pe,"-extra-content")},ae):null};function Ur(de,Te){var Ae,pe=S.useContext(mi),X=pe.prefixCls,ae=pe.tabs,Q=de.className,fe=de.style,me=de.id,we=de.animated,xe=de.activeKey,Le=de.rtl,ke=de.extra,je=de.editable,Fe=de.locale,ze=de.tabPosition,at=de.tabBarGutter,gt=de.children,lt=de.onTabClick,_t=de.onTabScroll,vt=Object(S.useRef)(),dt=Object(S.useRef)(),ct=Object(S.useRef)(),At=Object(S.useRef)(),bt=Nr(),zt=Object(W.a)(bt,2),Lt=zt[0],rt=zt[1],nt=ze==="top"||ze==="bottom",Tt=Fi(0,function(Pt,xt){nt&&_t&&_t({direction:Pt>xt?"left":"right"})}),St=Object(W.a)(Tt,2),$e=St[0],wt=St[1],Wt=Fi(0,function(Pt,xt){!nt&&_t&&_t({direction:Pt>xt?"top":"bottom"})}),Ct=Object(W.a)(Wt,2),Mt=Ct[0],Gt=Ct[1],an=Object(S.useState)(0),cn=Object(W.a)(an,2),Yt=cn[0],hn=cn[1],vn=Object(S.useState)(0),fn=Object(W.a)(vn,2),pn=fn[0],Zt=fn[1],un=Object(S.useState)(0),sn=Object(W.a)(un,2),tn=sn[0],bn=sn[1],En=Object(S.useState)(0),An=Object(W.a)(En,2),Bt=An[0],yn=An[1],wn=Object(S.useState)(null),Ht=Object(W.a)(wn,2),Dt=Ht[0],on=Ht[1],Hr=Object(S.useState)(null),zi=Object(W.a)(Hr,2),In=zi[0],Kr=zi[1],Gr=Object(S.useState)(0),Vi=Object(W.a)(Gr,2),zr=Vi[0],Vr=Vi[1],Xr=Object(S.useState)(0),Xi=Object(W.a)(Xr,2),Yr=Xi[0],$r=Xi[1],Qr=i(new Map),Yi=Object(W.a)(Qr,2),Zr=Yi[0],Jr=Yi[1],ei=t(ae,Zr,Yt),$i="".concat(X,"-nav-operations-hidden"),Mn=0,kn=0;nt?Le?(Mn=0,kn=Math.max(0,Yt-Dt)):(Mn=Math.min(0,Dt-Yt),kn=0):(Mn=Math.min(0,In-pn),kn=0);function gi(Pt){return Pt<Mn?[Mn,!1]:Pt>kn?[kn,!1]:[Pt,!0]}var Qi=Object(S.useRef)(),qr=Object(S.useState)(),Zi=Object(W.a)(qr,2),vi=Zi[0],Ji=Zi[1];function yi(){Ji(Date.now())}function _i(){window.clearTimeout(Qi.current)}kr(vt,function(Pt,xt){var nn=!1;function mn(Un,Bn){Un(function(Fn){var jn=gi(Fn+Bn),Dn=Object(W.a)(jn,2),xi=Dn[0],Si=Dn[1];return nn=Si,xi})}if(nt){if(Dt>=Yt)return nn;mn(wt,Pt)}else{if(In>=pn)return nn;mn(Gt,xt)}return _i(),yi(),nn}),Object(S.useEffect)(function(){return _i(),vi&&(Qi.current=window.setTimeout(function(){Ji(0)},100)),_i},[vi]);function qi(){var Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe,xt=ei.get(Pt);if(!xt)return;if(nt){var nn=$e;Le?xt.right<$e?nn=xt.right:xt.right+xt.width>$e+Dt&&(nn=xt.right+xt.width-Dt):xt.left<-$e?nn=-xt.left:xt.left+xt.width>-$e+Dt&&(nn=-(xt.left+xt.width-Dt)),Gt(0),wt(gi(nn)[0])}else{var mn=Mt;xt.top<-Mt?mn=-xt.top:xt.top+xt.height>-Mt+In&&(mn=-(xt.top+xt.height-In)),wt(0),Gt(gi(mn)[0])}}var ea=c(ei,{width:Dt,height:In,left:$e,top:Mt},{width:tn,height:Bt},{width:zr,height:Yr},Object(N.a)(Object(N.a)({},de),{},{tabs:ae})),er=Object(W.a)(ea,2),ta=er[0],na=er[1],ia=ae.map(function(Pt){var xt=Pt.key;return S.createElement(r,{id:me,prefixCls:X,key:xt,rtl:Le,tab:Pt,closable:Pt.closable,editable:je,active:xt===xe,tabPosition:ze,tabBarGutter:at,renderWrapper:gt,removeAriaLabel:Fe==null?void 0:Fe.removeAriaLabel,ref:Lt(xt),onClick:function(mn){lt(xt,mn)},onRemove:function(){rt(xt)},onFocus:function(){qi(xt),yi(),Le||(vt.current.scrollLeft=0),vt.current.scrollTop=0}})}),bi=s(function(){var Pt,xt,nn,mn,Un,Bn,Fn,jn,Dn,xi=((Pt=vt.current)===null||Pt===void 0?void 0:Pt.offsetWidth)||0,Si=((xt=vt.current)===null||xt===void 0?void 0:xt.offsetHeight)||0,lr=((nn=At.current)===null||nn===void 0?void 0:nn.offsetWidth)||0,ur=((mn=At.current)===null||mn===void 0?void 0:mn.offsetHeight)||0,ua=((Un=ct.current)===null||Un===void 0?void 0:Un.offsetWidth)||0,da=((Bn=ct.current)===null||Bn===void 0?void 0:Bn.offsetHeight)||0;on(xi),Kr(Si),Vr(lr),$r(ur);var dr=(((Fn=dt.current)===null||Fn===void 0?void 0:Fn.offsetWidth)||0)-lr,cr=(((jn=dt.current)===null||jn===void 0?void 0:jn.offsetHeight)||0)-ur;hn(dr),Zt(cr);var hr=(Dn=ct.current)===null||Dn===void 0?void 0:Dn.className.includes($i);bn(dr-(hr?0:ua)),yn(cr-(hr?0:da)),Jr(function(){var fr=new Map;return ae.forEach(function(ca){var pr=ca.key,Wn=Lt(pr).current;Wn&&fr.set(pr,{width:Wn.offsetWidth,height:Wn.offsetHeight,left:Wn.offsetLeft,top:Wn.offsetTop})}),fr})}),ra=ae.slice(0,ta),aa=ae.slice(na+1),tr=[].concat(Object(w.a)(ra),Object(w.a)(aa)),sa=Object(S.useState)(),nr=Object(W.a)(sa,2),oa=nr[0],la=nr[1],Tn=ei.get(xe),ir=Object(S.useRef)();function rr(){u.a.cancel(ir.current)}Object(S.useEffect)(function(){var Pt={};return Tn&&(nt?(Le?Pt.right=Tn.right:Pt.left=Tn.left,Pt.width=Tn.width):(Pt.top=Tn.top,Pt.height=Tn.height)),rr(),ir.current=u()(function(){la(Pt)}),rr},[Tn,nt,Le]),Object(S.useEffect)(function(){qi()},[xe,Tn,ei,nt]),Object(S.useEffect)(function(){bi()},[Le,at,xe,ae.map(function(Pt){return Pt.key}).join("_")]);var ar=!!tr.length,Nn="".concat(X,"-nav-wrap"),Ei,Ti,sr,or;return nt?Le?(Ti=$e>0,Ei=$e+Dt<Yt):(Ei=$e<0,Ti=-$e+Dt<Yt):(sr=Mt<0,or=-Mt+In<pn),S.createElement("div",{ref:Te,role:"tablist",className:F()("".concat(X,"-nav"),Q),style:fe,onKeyDown:function(){yi()}},S.createElement(ji,{position:"left",extra:ke,prefixCls:X}),S.createElement(l.a,{onResize:bi},S.createElement("div",{className:F()(Nn,(Ae={},Object(ue.a)(Ae,"".concat(Nn,"-ping-left"),Ei),Object(ue.a)(Ae,"".concat(Nn,"-ping-right"),Ti),Object(ue.a)(Ae,"".concat(Nn,"-ping-top"),sr),Object(ue.a)(Ae,"".concat(Nn,"-ping-bottom"),or),Ae)),ref:vt},S.createElement(l.a,{onResize:bi},S.createElement("div",{ref:dt,className:"".concat(X,"-nav-list"),style:{transform:"translate(".concat($e,"px, ").concat(Mt,"px)"),transition:vi?"none":void 0}},ia,S.createElement(Ni,{ref:At,prefixCls:X,locale:Fe,editable:je,style:{visibility:ar?"hidden":null}}),S.createElement("div",{className:F()("".concat(X,"-ink-bar"),Object(ue.a)({},"".concat(X,"-ink-bar-animated"),we.inkBar)),style:oa}))))),S.createElement(Lr,Object.assign({},de,{ref:ct,prefixCls:X,tabs:tr,className:!ar&&$i})),S.createElement(ji,{position:"right",extra:ke,prefixCls:X}))}var Wi=S.forwardRef(Ur);function Br(de){var Te=de.id,Ae=de.activeKey,pe=de.animated,X=de.tabPosition,ae=de.rtl,Q=de.destroyInactiveTabPane,fe=S.useContext(mi),me=fe.prefixCls,we=fe.tabs,xe=pe.tabPane,Le=we.findIndex(function(ke){return ke.key===Ae});return S.createElement("div",{className:F()("".concat(me,"-content-holder"))},S.createElement("div",{className:F()("".concat(me,"-content"),"".concat(me,"-content-").concat(X),Object(ue.a)({},"".concat(me,"-content-animated"),xe)),style:Le&&xe?Object(ue.a)({},ae?"marginRight":"marginLeft","-".concat(Le,"00%")):null},we.map(function(ke){return S.cloneElement(ke.node,{key:ke.key,prefixCls:me,tabKey:ke.key,id:Te,animated:xe,active:ke.key===Ae,destroyInactiveTabPane:Q})})))}function Hi(de){var Te=de.prefixCls,Ae=de.forceRender,pe=de.className,X=de.style,ae=de.id,Q=de.active,fe=de.animated,me=de.destroyInactiveTabPane,we=de.tabKey,xe=de.children,Le=S.useState(Ae),ke=Object(W.a)(Le,2),je=ke[0],Fe=ke[1];S.useEffect(function(){Q?Fe(!0):me&&Fe(!1)},[Q,me]);var ze={};return Q||(fe?(ze.visibility="hidden",ze.height=0,ze.overflowY="hidden"):ze.display="none"),S.createElement("div",{id:ae&&"".concat(ae,"-panel-").concat(we),role:"tabpanel",tabIndex:Q?0:-1,"aria-labelledby":ae&&"".concat(ae,"-tab-").concat(we),"aria-hidden":!Q,style:Object(N.a)(Object(N.a)({},ze),X),className:F()("".concat(Te,"-tabpane"),Q&&"".concat(Te,"-tabpane-active"),pe)},(Q||je||Ae)&&xe)}var Ki=0;function Fr(de){return Object(B.a)(de).map(function(Te){if(S.isValidElement(Te)){var Ae=Te.key!==void 0?String(Te.key):void 0;return Object(N.a)(Object(N.a)({key:Ae},Te.props),{},{node:Te})}return null}).filter(function(Te){return Te})}function jr(de,Te){var Ae,pe=de.id,X=de.prefixCls,ae=X===void 0?"rc-tabs":X,Q=de.className,fe=de.children,me=de.direction,we=de.activeKey,xe=de.defaultActiveKey,Le=de.editable,ke=de.animated,je=de.tabPosition,Fe=je===void 0?"top":je,ze=de.tabBarGutter,at=de.tabBarStyle,gt=de.tabBarExtraContent,lt=de.locale,_t=de.moreIcon,vt=de.moreTransitionName,dt=de.destroyInactiveTabPane,ct=de.renderTabBar,At=de.onChange,bt=de.onTabClick,zt=de.onTabScroll,Lt=Object(R.a)(de,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),rt=Fr(fe),nt=me==="rtl",Tt;ke===!1?Tt={inkBar:!1,tabPane:!1}:Tt=Object(N.a)({inkBar:!0,tabPane:!1},ke!==!0?ke:null);var St=Object(S.useState)(!1),$e=Object(W.a)(St,2),wt=$e[0],Wt=$e[1];Object(S.useEffect)(function(){Wt(Mr())},[]);var Ct=Object(e.a)(function(){var Bt;return(Bt=rt[0])===null||Bt===void 0?void 0:Bt.key},{value:we,defaultValue:xe}),Mt=Object(W.a)(Ct,2),Gt=Mt[0],an=Mt[1],cn=Object(S.useState)(function(){return rt.findIndex(function(Bt){return Bt.key===Gt})}),Yt=Object(W.a)(cn,2),hn=Yt[0],vn=Yt[1];Object(S.useEffect)(function(){var Bt=rt.findIndex(function(wn){return wn.key===Gt});if(Bt===-1){var yn;Bt=Math.max(0,Math.min(hn,rt.length-1)),an((yn=rt[Bt])===null||yn===void 0?void 0:yn.key)}vn(Bt)},[rt.map(function(Bt){return Bt.key}).join("_"),Gt,hn]);var fn=Object(e.a)(null,{value:pe}),pn=Object(W.a)(fn,2),Zt=pn[0],un=pn[1],sn=Fe;wt&&!["left","right"].includes(Fe)&&(sn="top"),Object(S.useEffect)(function(){pe||(un("rc-tabs-".concat(Ki)),Ki+=1)},[]);function tn(Bt,yn){bt==null||bt(Bt,yn),an(Bt),At==null||At(Bt)}var bn={id:Zt,activeKey:Gt,animated:Tt,tabPosition:sn,rtl:nt,mobile:wt},En,An=Object(N.a)(Object(N.a)({},bn),{},{editable:Le,locale:lt,moreIcon:_t,moreTransitionName:vt,tabBarGutter:ze,onTabClick:tn,onTabScroll:zt,extra:gt,style:at,panes:fe});return ct?En=ct(An,Wi):En=S.createElement(Wi,Object.assign({},An)),S.createElement(mi.Provider,{value:{tabs:rt,prefixCls:ae}},S.createElement("div",Object.assign({ref:Te,id:pe,className:F()(ae,"".concat(ae,"-").concat(sn),(Ae={},Object(ue.a)(Ae,"".concat(ae,"-mobile"),wt),Object(ue.a)(Ae,"".concat(ae,"-editable"),Le),Object(ue.a)(Ae,"".concat(ae,"-rtl"),nt),Ae),Q)},Lt),En,S.createElement(Br,Object.assign({destroyInactiveTabPane:dt},bn,{animated:Tt}))))}var Gi=S.forwardRef(jr);Gi.TabPane=Hi;var Wr=Gi,ma=ye.b=Wr},nEHx:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return ue});var ue;(function(W){W.DARK="dark",W.LIGHT="light",W.HIGH_CONTRAST="hc"})(ue||(ue={}))},nnTU:function(Ke,ye,j){"use strict";j.d(ye,"b",function(){return F}),j.d(ye,"a",function(){return B});var ue=j("MI8n"),W=j("JYp7"),R=j("pmY6"),N=j("24hK"),S=j("746U"),O=j("Cg/j");const F=Object(O.c)("commandService"),B=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ue.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,w){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!w)throw new Error("invalid command");return this.registerCommand({id:e,handler:w})}if(e.description){const i=[];for(let a of e.description.args)i.push(a.constraint);const o=e.handler;e.handler=function(a,...r){return Object(S.o)(r,i),o(a,...r)}}const{id:g}=e;let u=this._commands.get(g);u||(u=new N.a,this._commands.set(g,u));let l=u.unshift(e),s=Object(R.i)(()=>{l();const i=this._commands.get(g);(i==null?void 0:i.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),s}registerCommandAlias(e,w){return B.registerCommand(e,(g,...u)=>g.get(F).executeCommand(w,...u))}getCommand(e){const w=this._commands.get(e);return!w||w.isEmpty()?void 0:W.a.first(w)}getCommands(){const e=new Map;for(const w of this._commands.keys()){const g=this.getCommand(w);g&&e.set(w,g)}return e}};B.registerCommand("noop",()=>{})},p5ED:function(Ke,ye,j){"use strict";var ue=j("+L6B"),W=j("2/Rp"),R=j("5Dmo"),N=j("3S7+"),S=j("k1fw"),O=j("9og8"),F=j("tJVT"),B=j("WmNS"),e=j.n(B),w=j("q1tI"),g=j.n(w),u=j("vHTk"),l=j.n(u),s=j("yEEn"),i=j("ZW9T"),o=j("1vsH"),a=j("V0Rq"),r=j("m3rI");ye.a=function(n){var t,v,c,p,b,y,d,f=n.editOffice,m=f===void 0?"view":f,h=n.data,E=n.theme,_=n.type,T=n.filename,k=n.monacoEditor,D=n.className,x=n.style,P=n.close,H=n.onClose,I=n.hasMask,V=n.disabledDownload,$=Object(w.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ge=Object(F.a)($,2),te=ge[0],be=ge[1],ve=Object(w.useState)(""),oe=Object(F.a)(ve,2),le=oe[0],_e=oe[1],ee=Object(w.useState)(),L=Object(F.a)(ee,2),A=L[0],C=L[1],U=window.ENV==="build"?"/react/build":"",K=r.a.PROXY_SERVER||location.origin,M,ie=1024*1024,Ee=10*ie,Oe=Object(w.useRef)();(t=h)!==null&&t!==void 0&&t.startsWith("/api")&&_!=="txt"&&(h=(r.a.API_SERVER||location.origin)+h),_==="office"&&(M=Object(o.T)(h).filesize,M>Ee&&(_="other")),T&&k&&(k.filename=T),Object(w.useEffect)(function(){var Ce,Pe,Ne=(Ce=document.cookie)===null||Ce===void 0||((Pe=Ce.replace(/\s/g,""))===null||Pe===void 0)?void 0:Pe.split(";");Ne==null||Ne.map(function(Ie){var Me=Ie.split("=");Me[0]==="_educoder_session"&&_e(Me[1])})},[]),Object(w.useEffect)(function(){_==="office"&&q()},[_,h]);var q=function(){var Ce=Object(O.a)(e.a.mark(function Pe(){var Ne,Ie,Me;return e.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return console.log("data:",h),Ne=h,h.startsWith("http")||(Ne=location.origin+Ne),Ie=new URL(Ne).pathname.split("/").pop(),We.next=6,Object(a.V)({attachment_id:Ie});case 6:Me=We.sent,C(Me);case 8:case"end":return We.stop()}},Pe)}));return function(){return Ce.apply(this,arguments)}}(),ce=function(){if(h.startsWith("http")||h.startsWith("blob:")){Se();return}Object(o.z)(T||"educoder",h,T)},Se=function(){Object(o.x)(T||"educoder",decodeURIComponent(h))};return g.a.createElement("div",{style:Object(S.a)({},x||{}),className:"".concat(I&&l.a.bgBlack," ").concat(_?l.a.wrp:"hide")},P&&g.a.createElement("div",{className:l.a.close,ref:Oe},!V&&g.a.createElement(N.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Oe.current}},g.a.createElement("span",{onClick:Se},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(N.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Oe.current}},g.a.createElement("span",{className:"",onClick:H},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(l.a[D]," ").concat(D," ").concat(l.a.monaco," ").concat(_==="txt"?"show":"hide")},_==="txt"&&g.a.createElement(i.b,k)),_==="audio"&&g.a.createElement("audio",{src:"".concat(((v=h)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((c=h)===null||c===void 0?void 0:c.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),_==="video"&&g.a.createElement(g.a.Fragment,null,((p=h)===null||p===void 0?void 0:p.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),_==="office"&&A&&g.a.createElement("iframe",{src:"".concat(U,"/office.html?key=").concat(A.key,"&url=").concat(K+A.url,"&callbackUrl=").concat(K+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(m,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),_==="html"&&g.a.createElement("iframe",{src:h+"&disposition=inline"}),_==="pdf"&&g.a.createElement("iframe",{src:"".concat(U,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!V)}),_==="image"&&g.a.createElement("img",{src:"".concat(((b=h)===null||b===void 0?void 0:b.indexOf("http://"))>-1||((y=h)===null||y===void 0?void 0:y.indexOf("https://"))>-1||(d=h)!==null&&d!==void 0&&d.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),_==="other"&&g.a.createElement("div",null,g.a.createElement(W.a,{type:"primary",size:"large",onClick:ce},g.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),_==="download"&&g.a.createElement(W.a,{type:"primary",size:"large",onClick:ce},g.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Ke,ye,j){"use strict";j.d(ye,"h",function(){return w}),j.d(ye,"g",function(){return u}),j.d(ye,"f",function(){return l}),j.d(ye,"e",function(){return s}),j.d(ye,"i",function(){return i}),j.d(ye,"b",function(){return o}),j.d(ye,"a",function(){return a}),j.d(ye,"d",function(){return r}),j.d(ye,"c",function(){return n});var ue=j("C/vA"),W=j("JYp7");const R=!1;let N=null;function S(t){N=t}if(R){const t="__is_disposable_tracked__";S(new class{trackDisposable(v){const c=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[t]||console.log(c)},3e3)}setParent(v,c){if(v&&v!==a.None)try{v[t]=!0}catch(p){}}markAsDisposed(v){if(v&&v!==a.None)try{v[t]=!0}catch(c){}}markAsSingleton(v){}})}function O(t){return N==null||N.trackDisposable(t),t}function F(t){N==null||N.markAsDisposed(t)}function B(t,v){N==null||N.setParent(t,v)}function e(t,v){if(!N)return;for(const c of t)N.setParent(c,v)}function w(t){return N==null||N.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function u(t){return typeof t.dispose=="function"&&t.dispose.length===0}function l(t){if(W.a.is(t)){let v=[];for(const c of t)if(c)try{c.dispose()}catch(p){v.push(p)}if(v.length===1)throw v[0];if(v.length>1)throw new g(v);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function s(...t){const v=i(()=>l(t));return e(t,v),v}function i(t){const v=O({dispose:Object(ue.a)(()=>{F(v),t()})});return v}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,O(this)}dispose(){if(this._isDisposed)return;F(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 B(t,this),this._isDisposed?o.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}}o.DISABLE_DISPOSED_WARNING=!1;class a{constructor(){this._store=new o,O(this),B(this._store,this)}dispose(){F(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,O(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var v;if(this._isDisposed||t===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),t&&B(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,F(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&&B(t,null),t}}class n{constructor(t){this.object=t}dispose(){}}},psGv:function(Ke,ye,j){var ue,W;(function(){var R;(function(){"use strict";var F=[,,function(g){function u(i){this.__parent=i,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=[]}u.prototype.clone_empty=function(){var i=new u(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},u.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},u.prototype.has_match=function(i){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(i))return!0;return!1},u.prototype.set_indent=function(i,o){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(i){this.__items.push(i);var o=i.lastIndexOf(`
|
|
`);o!==-1?this.__character_count=i.length-o:this.__character_count+=i.length},u.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function l(i,o){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),o=o||"",i.indent_level>0&&(o=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}l.prototype.get_indent_size=function(i,o){var a=this.__base_string_length;return o=o||0,i<0&&(a=0),a+=i*this.__indent_size,a+=o,a},l.prototype.get_indent_string=function(i,o){var a=this.__base_string;return o=o||0,i<0&&(i=0,a=""),o+=i*this.__indent_size,this.__ensure_cache(o),a+=this.__cache[o],a},l.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var i=this.__cache.length,o=0,a="";this.__indent_size&&i>=this.__indent_size&&(o=Math.floor(i/this.__indent_size),i-=o*this.__indent_size,a=new Array(o+1).join(this.__indent_string)),i&&(a+=new Array(i+1).join(" ")),this.__cache.push(a)};function s(i,o){this.__indent_cache=new l(i,o),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(i,o){return this.__indent_cache.get_indent_string(i,o)},s.prototype.get_indent_size=function(i,o){return this.__indent_cache.get_indent_size(i,o)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(i){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
|
|
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return i!==`
|
|
`&&(a=a.replace(/[\n]/g,i)),a},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(i,o){return i=i||0,o=o||0,this.next_line.set_indent(i,o),this.__lines.length>1?(this.current_line.set_indent(i,o),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(i){for(var o=0;o<i.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},s.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},s.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(" "))},s.prototype.remove_indent=function(i){for(var o=this.__lines.length;i<o;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},s.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&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},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(i,o){for(var a=this.__lines.length-2;a>=0;){var r=this.__lines[a];if(r.is_empty())break;if(r.item(0).indexOf(i)!==0&&r.item(-1)!==o){this.__lines.splice(a+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},g.exports.Output=s},function(g){function u(l,s,i,o){this.type=l,this.text=s,this.comments_before=null,this.newlines=i||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=u},,,function(g){function u(i,o){this.raw_options=l(i,o),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"])}u.prototype._get_array=function(i,o){var a=this.raw_options[i],r=o||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(r=a.concat()):typeof a=="string"&&(r=a.split(/[^a-zA-Z0-9_\/\-]+/)),r},u.prototype._get_boolean=function(i,o){var a=this.raw_options[i],r=a===void 0?!!o:!!a;return r},u.prototype._get_characters=function(i,o){var a=this.raw_options[i],r=o||"";return typeof a=="string"&&(r=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},u.prototype._get_number=function(i,o){var a=this.raw_options[i];o=parseInt(o,10),isNaN(o)&&(o=0);var r=parseInt(a,10);return isNaN(r)&&(r=o),r},u.prototype._get_selection=function(i,o,a){var r=this._get_selection_list(i,o,a);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[i]+"'");return r[0]},u.prototype._get_selection_list=function(i,o,a){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[o[0]],!this._is_valid_selection(a,o))throw new Error("Invalid Default Value!");var r=this._get_array(i,a);if(!this._is_valid_selection(r,o))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[i]+"'");return r},u.prototype._is_valid_selection=function(i,o){return i.length&&o.length&&!i.some(function(a){return o.indexOf(a)===-1})};function l(i,o){var a={};i=s(i);var r;for(r in i)r!==o&&(a[r]=i[r]);if(o&&i[o])for(r in i[o])a[r]=i[o][r];return a}function s(i){var o={},a;for(a in i){var r=a.replace(/-/g,"_");o[r]=i[a]}return o}g.exports.Options=u,g.exports.normalizeOpts=s,g.exports.mergeOpts=l},,function(g){var u=RegExp.prototype.hasOwnProperty("sticky");function l(s){this.__input=s||"",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 s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},l.prototype.peek=function(s){var i=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(i=this.__input.charAt(s)),i},l.prototype.__match=function(s,i){s.lastIndex=i;var o=s.exec(this.__input);return o&&!(u&&s.sticky)&&(o.index!==i&&(o=null)),o},l.prototype.test=function(s,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(s,i):!1},l.prototype.testChar=function(s,i){var o=this.peek(i);return s.lastIndex=0,o!==null&&s.test(o)},l.prototype.match=function(s){var i=this.__match(s,this.__position);return i?this.__position+=i[0].length:i=null,i},l.prototype.read=function(s,i,o){var a="",r;return s&&(r=this.match(s),r&&(a+=r[0])),i&&(r||!s)&&(a+=this.readUntil(i,o)),a},l.prototype.readUntil=function(s,i){var o="",a=this.__position;s.lastIndex=this.__position;var r=s.exec(this.__input);return r?(a=r.index,i&&(a+=r[0].length)):a=this.__input_length,o=this.__input.substring(this.__position,a),this.__position=a,o},l.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},l.prototype.get_regexp=function(s,i){var o=null,a="g";return i&&u&&(a="y"),typeof s=="string"&&s!==""?o=new RegExp(s,a):s&&(o=new RegExp(s.source,a)),o},l.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(s){var i=this.__position,o=this.readUntilAfter(s);return this.__position=i,o},l.prototype.lookBack=function(s){var i=this.__position-1;return i>=s.length&&this.__input.substring(i-s.length,i).toLowerCase()===s},g.exports.InputScanner=l},function(g,u,l){var s=l(8).InputScanner,i=l(3).Token,o=l(10).TokenStream,a=l(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(t,v){this._input=new s(t),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,v=new i(r.START,""),c=null,p=[],b=new o;v.type!==r.EOF;){for(t=this._get_next_token(v,c);this._is_comment(t);)b.add(t),t=this._get_next_token(v,c);b.isEmpty()||(t.comments_before=b,b=new o),t.parent=c,this._is_opening(t)?(p.push(c),c=t):c&&this._is_closing(t,c)&&(t.opened=c,c.closed=t,c=p.pop(),t.parent=c),t.previous=v,v.next=t,this.__tokens.add(t),v=t}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(t,v){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(r.RAW,c):this._create_token(r.EOF,"")},n.prototype._is_comment=function(t){return!1},n.prototype._is_opening=function(t){return!1},n.prototype._is_closing=function(t,v){return!1},n.prototype._create_token=function(t,v){var c=new i(t,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=n,g.exports.TOKEN=r},function(g){function u(l){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=l}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__tokens[this.__position],this.__position+=1),l},u.prototype.peek=function(l){var s=null;return l=l||0,l+=this.__position,l>=0&&l<this.__tokens_length&&(s=this.__tokens[l]),s},u.prototype.add=function(l){this.__parent_token&&(l.parent=this.__parent_token),this.__tokens.push(l),this.__tokens_length+=1},g.exports.TokenStream=u},function(g,u,l){var s=l(12).Pattern;function i(o,a){s.call(this,o,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new s,i.prototype.__set_whitespace_patterns=function(o,a){o+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var a=this.__split(this._newline_regexp,o);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return o},i.prototype.matching=function(o,a){var r=this._create();return r.__set_whitespace_patterns(o,a),r._update(),r},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(o,a){o.lastIndex=0;for(var r=0,n=[],t=o.exec(a);t;)n.push(a.substring(r,t.index)),r=t.index+t[0].length,t=o.exec(a);return r<a.length?n.push(a.substring(r,a.length)):n.push(""),n},g.exports.WhitespacePattern=i},function(g){function u(l,s){this._input=l,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}u.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},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(l){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(l),s._update(),s},u.prototype.until=function(l){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(l),s._update(),s},u.prototype.starting_with=function(l){var s=this._create();return s._starting_pattern=this._input.get_regexp(l,!0),s._update(),s},u.prototype.matching=function(l){var s=this._create();return s._match_pattern=this._input.get_regexp(l,!0),s._update(),s},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},g.exports.Pattern=u},function(g){function u(l,s){l=typeof l=="string"?l:l.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(l+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(l+/\sbeautify\signore:end\s/.source+s,"g")}u.prototype.get_directives=function(l){if(!l.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(l);i;)s[i[1]]=i[2],i=this.__directive_pattern.exec(l);return s},u.prototype.readIgnored=function(l){return l.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=u},function(g,u,l){var s=l(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(a,r){s.call(this,a,r),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),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 n=new s(a);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new s,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(a){var r=this._create();return r._disabled[a]=!0,r._update(),r},o.prototype.read_options=function(a){var r=this._create();for(var n in i)r._disabled[n]=a.templating.indexOf(n)===-1;return r._update(),r},o.prototype.exclude=function(a){var r=this._create();return r._excluded[a]=!0,r._update(),r},o.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},o.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("|")+")")},o.prototype._read_template=function(){var a="",r=this._input.peek();if(r==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(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},g.exports.TemplatablePattern=o},,,,function(g,u,l){var s=l(19).Beautifier,i=l(20).Options;function o(a,r,n,t){var v=new s(a,r,n,t);return v.beautify()}g.exports=o,g.exports.defaultOptions=function(){return new i}},function(g,u,l){var s=l(20).Options,i=l(2).Output,o=l(21).Tokenizer,a=l(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,t=function(E,_){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new i(E,_)};t.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},t.prototype.set_space_before_token=function(E,_){this._output.space_before_token=E,this._output.non_breaking_space=_},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(E){this._output.add_raw_token(E)},t.prototype.print_preserved_newlines=function(E){var _=0;E.type!==a.TEXT&&E.previous.type!==a.TEXT&&(_=E.newlines?1:0),this.preserve_newlines&&(_=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var T=0;T<_;T++)this.print_newline(T>0);return _!==0},t.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(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(E){this._output.add_new_line(E)},t.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var v=function(E){for(var _=null,T=E.next;T.type!==a.EOF&&E.closed!==T;){if(T.type===a.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===a.EQUALS&&T.next.next&&T.next.next.type===a.VALUE&&(_=T.next.next.text);break}T=T.next}return _},c=function(E,_){var T=null,k=null;return _.closed?(E==="script"?T="text/javascript":E==="style"&&(T="text/css"),T=v(_)||T,T.search("text/css")>-1?k="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?k="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?k="html":T.search(/test\/null/)>-1&&(k="null"),k):null};function p(E,_){return _.indexOf(E)!==-1}function b(E,_,T){this.parent=E||null,this.tag=_?_.tag_name:"",this.indent_level=T||0,this.parser_token=_||null}function y(E){this._printer=E,this._current_frame=null}y.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},y.prototype.record_tag=function(E){var _=new b(this._current_frame,E,this._printer.indent_level);this._current_frame=_},y.prototype._try_pop_frame=function(E){var _=null;return E&&(_=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),_},y.prototype._get_frame=function(E,_){for(var T=this._current_frame;T&&!(E.indexOf(T.tag)!==-1);){if(_&&_.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},y.prototype.try_pop=function(E,_){var T=this._get_frame([E],_);return this._try_pop_frame(T)},y.prototype.indent_to_tag=function(E){var _=this._get_frame(E);_&&(this._printer.indent_level=_.indent_level)};function d(E,_,T,k){this._source_text=E||"",_=_||{},this._js_beautify=T,this._css_beautify=k,this._tag_stack=null;var D=new s(_,"html");this._options=D,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"}d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,_=this._options.eol;this._options.eol==="auto"&&(_=`
|
|
`,E&&r.test(E)&&(_=E.match(r)[0])),E=E.replace(n,`
|
|
`);var T=E.match(/^[\t ]*/)[0],k={text:"",type:""},D=new f,x=new t(this._options,T),P=new o(E,this._options).tokenize();this._tag_stack=new y(x);for(var H=null,I=P.next();I.type!==a.EOF;)I.type===a.TAG_OPEN||I.type===a.COMMENT?(H=this._handle_tag_open(x,I,D,k),D=H):I.type===a.ATTRIBUTE||I.type===a.EQUALS||I.type===a.VALUE||I.type===a.TEXT&&!D.tag_complete?H=this._handle_inside_tag(x,I,D,P):I.type===a.TAG_CLOSE?H=this._handle_tag_close(x,I,D):I.type===a.TEXT?H=this._handle_text(x,I,D):x.add_raw_token(I),k=H,I=P.next();var V=x._output.get_code(_);return V},d.prototype._handle_tag_close=function(E,_,T){var k={text:_.text,type:_.type};return E.alignment_size=0,T.tag_complete=!0,E.set_space_before_token(_.newlines||_.whitespace_before!=="",!0),T.is_unformatted?E.add_raw_token(_):(T.tag_start_char==="<"&&(E.set_space_before_token(_.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(_)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(E.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&E.set_wrap_point(),k},d.prototype._handle_inside_tag=function(E,_,T,k){var D=T.has_wrapped_attrs,x={text:_.text,type:_.type};if(E.set_space_before_token(_.newlines||_.whitespace_before!=="",!0),T.is_unformatted)E.add_raw_token(_);else if(T.tag_start_char==="{"&&_.type===a.TEXT)E.print_preserved_newlines(_)?(_.newlines=0,E.add_raw_token(_)):E.print_token(_);else{if(_.type===a.ATTRIBUTE?(E.set_space_before_token(!0),T.attr_count+=1):(_.type===a.EQUALS||_.type===a.VALUE&&_.previous.type===a.EQUALS)&&E.set_space_before_token(!1),_.type===a.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(_),D=D||_.newlines!==0),this._is_wrap_attributes_force)){var P=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var H=!0,I=0,V;do{if(V=k.peek(I),V.type===a.ATTRIBUTE){H=!1;break}I+=1}while(I<4&&V.type!==a.EOF&&V.type!==a.TAG_CLOSE);P=!H}P&&(E.print_newline(!1),D=!0)}E.print_token(_),D=D||E.previous_token_wrapped(),T.has_wrapped_attrs=D}return x},d.prototype._handle_text=function(E,_,T){var k={text:_.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(E,_,T):T.is_unformatted||T.is_content_unformatted?E.add_raw_token(_):(E.traverse_whitespace(_),E.print_token(_)),k},d.prototype._print_custom_beatifier_text=function(E,_,T){var k=this;if(_.text!==""){var D=_.text,x,P=1,H="",I="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:T.custom_beautifier_name==="html"&&(x=function(ve,oe){var le=new d(ve,oe,k._js_beautify,k._css_beautify);return le.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-E.indent_level);var V=E.get_full_indent(P);if(D=D.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&D[0]==="<"&&D.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(D);if(!$){E.add_raw_token(_);return}H=V+$[1]+`
|
|
`,D=$[4],$[5]&&(I=V+$[5]),D=D.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
|
|
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(_.whitespace_before=$[0]))}if(D)if(x){var ge=function(){this.eol=`
|
|
`};ge.prototype=this._options.raw_options;var te=new ge;D=x(V+D,te)}else{var be=_.whitespace_before;be&&(D=D.replace(new RegExp(`
|
|
(`+be+")?","g"),`
|
|
`)),D=V+D.replace(/\n/g,`
|
|
`+V)}H&&(D?D=H+D+`
|
|
`+I:D=H+I),E.print_newline(!1),D&&(_.text=D,_.whitespace_before="",_.newlines=0,E.add_raw_token(_),E.print_newline(!0))}},d.prototype._handle_tag_open=function(E,_,T,k){var D=this._get_tag_open_token(_);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&_.type===a.TAG_OPEN&&_.text.indexOf("</")===0?(E.add_raw_token(_),D.start_tag_token=this._tag_stack.try_pop(D.tag_name)):(E.traverse_whitespace(_),this._set_tag_position(E,_,D,T,k),D.is_inline_element||E.set_wrap_point(),E.print_token(_)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(D.alignment_size=_.text.length+1),!D.tag_complete&&!D.is_unformatted&&(E.alignment_size=D.alignment_size),D};var f=function(E,_){if(this.parent=E||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="",!_)this.tag_complete=!0;else{var T;this.tag_start_char=_.text[0],this.text=_.text,this.tag_start_char==="<"?(T=_.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=_.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(_.text.startsWith("{{#>")||_.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&_.next!==null?this.tag_check=_.next.text.split(" ")[0]:this.tag_check=_.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),_.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||_.closed&&_.closed.text==="/>";var k=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(k=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(k)))}};d.prototype._get_tag_open_token=function(E){var _=new f(this._tag_stack.get_parser_token(),E);return _.alignment_size=this._options.wrap_attributes_indent_size,_.is_end_tag=_.is_end_tag||p(_.tag_check,this._options.void_elements),_.is_empty_element=_.tag_complete||_.is_start_tag&&_.is_end_tag,_.is_unformatted=!_.tag_complete&&p(_.tag_check,this._options.unformatted),_.is_content_unformatted=!_.is_empty_element&&p(_.tag_check,this._options.content_unformatted),_.is_inline_element=p(_.tag_name,this._options.inline)||_.tag_name.includes("-")||_.tag_start_char==="{",_},d.prototype._set_tag_position=function(E,_,T,k,D){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=c(T.tag_check,_)))),p(T.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var x=E.current_line_has_match(/{{#if/);x||E.print_newline(!1)}T.tag_name==="!--"&&D.type===a.TAG_CLOSE&&k.is_end_tag&&T.text.indexOf(`
|
|
`)===-1||(T.is_inline_element||T.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,T))}else if(T.is_end_tag){var P=!1;P=T.start_tag_token&&T.start_tag_token.multiline_content,P=P||!T.is_inline_element&&!(k.is_inline_element||k.is_unformatted)&&!(D.type===a.TAG_CLOSE&&T.start_tag_token===k)&&D.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(P=!1),P&&E.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(D.type!=="TK_CONTENT"||T.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,T)},d.prototype._calcluate_parent_multiline=function(E,_){_.parent&&E._output.just_added_newline()&&!((_.is_inline_element||_.is_unformatted)&&_.parent.is_inline_element)&&(_.parent.multiline_content=!0)};var m=["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"];d.prototype._do_optional_end_element=function(E){var _=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")_=_||this._tag_stack.try_pop("head");else if(E.tag_name==="li")_=_||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")_=_||this._tag_stack.try_pop("dt",["dl"]),_=_||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&m.indexOf(E.tag_name)!==-1){var T=E.parent.parent;(!T||h.indexOf(T.tag_name)===-1)&&(_=_||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(_=_||this._tag_stack.try_pop("rt",["ruby","rtc"]),_=_||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?_=_||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?_=_||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?_=_||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"]),_=_||this._tag_stack.try_pop("thead",["table"]),_=_||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"]),_=_||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(_=_||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),_=_||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),_},g.exports.Beautifier=d},function(g,u,l){var s=l(6).Options;function i(o){s.call(this,o,"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"])}i.prototype=new s,g.exports.Options=i},function(g,u,l){var s=l(9).Tokenizer,i=l(9).TOKEN,o=l(13).Directives,a=l(14).TemplatablePattern,r=l(12).Pattern,n={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:i.START,RAW:i.RAW,EOF:i.EOF},t=new o(/<\!--/,/-->/),v=function(c,p){s.call(this,c,p),this._current_tag_name="";var b=new a(this._input).read_options(this._options),y=new r(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),handlebars_comment:y.starting_with(/{{!--/).until_after(/--}}/),handlebars:y.starting_with(/{{/).until_after(/}}/),handlebars_open:y.until(/[\n\r\t }]/),handlebars_raw_close:y.until(/}}/),comment:y.starting_with(/<!--/).until_after(/-->/),cdata:y.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:y.starting_with(/<!\[/).until_after(/]>/),processing:y.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 d=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=y.matching(d).until_after(d)}};v.prototype=new s,v.prototype._is_comment=function(c){return!1},v.prototype._is_opening=function(c){return c.type===n.TAG_OPEN},v.prototype._is_closing=function(c,p){return c.type===n.TAG_CLOSE&&p&&((c.text===">"||c.text==="/>")&&p.text[0]==="<"||c.text==="}}"&&p.text[0]==="{"&&p.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(c,p){var b=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(n.EOF,""):(b=b||this._read_open_handlebars(y,p),b=b||this._read_attribute(y,c,p),b=b||this._read_close(y,p),b=b||this._read_raw_content(y,c,p),b=b||this._read_content_word(y),b=b||this._read_comment_or_cdata(y),b=b||this._read_processing(y),b=b||this._read_open(y,p),b=b||this._create_token(n.UNKNOWN,this._input.next()),b)},v.prototype._read_comment_or_cdata=function(c){var p=null,b=null,y=null;if(c==="<"){var d=this._input.peek(1);d==="!"&&(b=this.__patterns.comment.read(),b?(y=t.get_directives(b),y&&y.ignore==="start"&&(b+=t.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(p=this._create_token(n.COMMENT,b),p.directives=y)}return p},v.prototype._read_processing=function(c){var p=null,b=null,y=null;if(c==="<"){var d=this._input.peek(1);(d==="!"||d==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(p=this._create_token(n.COMMENT,b),p.directives=y)}return p},v.prototype._read_open=function(c,p){var b=null,y=null;return p||c==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),y=this._create_token(n.TAG_OPEN,b)),y},v.prototype._read_open_handlebars=function(c,p){var b=null,y=null;return p||this._options.indent_handlebars&&c==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),y=this._create_token(n.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),y=this._create_token(n.TAG_OPEN,b))),y},v.prototype._read_close=function(c,p){var b=null,y=null;return p&&(p.text[0]==="<"&&(c===">"||c==="/"&&this._input.peek(1)===">")?(b=this._input.next(),c==="/"&&(b+=this._input.next()),y=this._create_token(n.TAG_CLOSE,b)):p.text[0]==="{"&&c==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),y=this._create_token(n.TAG_CLOSE,"}}"))),y},v.prototype._read_attribute=function(c,p,b){var y=null,d="";if(b&&b.text[0]==="<")if(c==="=")y=this._create_token(n.EQUALS,this._input.next());else if(c==='"'||c==="'"){var f=this._input.next();c==='"'?f+=this.__patterns.double_quote.read():f+=this.__patterns.single_quote.read(),y=this._create_token(n.VALUE,f)}else d=this.__patterns.attribute.read(),d&&(p.type===n.EQUALS?y=this._create_token(n.VALUE,d):y=this._create_token(n.ATTRIBUTE,d));return y},v.prototype._is_content_unformatted=function(c){return this._options.void_elements.indexOf(c)===-1&&(this._options.content_unformatted.indexOf(c)!==-1||this._options.unformatted.indexOf(c)!==-1)},v.prototype._read_raw_content=function(c,p,b){var y="";if(b&&b.text[0]==="{")y=this.__patterns.handlebars_raw_close.read();else if(p.type===n.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var d=p.opened.text.substr(1).toLowerCase();if(d==="script"||d==="style"){var f=this._read_comment_or_cdata(c);if(f)return f.type=n.TEXT,f;y=this._input.readUntil(new RegExp("</"+d+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(d)&&(y=this._input.readUntil(new RegExp("</"+d+"[\\n\\r\\t ]*?>","ig")))}return y?this._create_token(n.TEXT,y):null},v.prototype._read_content_word=function(c){var p="";if(this._options.unformatted_content_delimiter&&(c===this._options.unformatted_content_delimiter[0]&&(p=this.__patterns.unformatted_content_delimiter.read())),p||(p=this.__patterns.word.read()),p)return this._create_token(n.TEXT,p)},g.exports.Tokenizer=v,g.exports.TOKEN=n}],B={};function e(g){var u=B[g];if(u!==void 0)return u.exports;var l=B[g]={exports:{}};return F[g](l,l.exports,e),l.exports}var w=e(18);R=w})();var N=R;if(!0)!(ue=[j,j("6UM0"),j("TXwP")],W=function(F){var B=j("6UM0"),e=j("TXwP");return{html_beautify:function(w,g){return N(w,g,B.js_beautify,e.css_beautify)}}}.apply(ye,ue),W!==void 0&&(Ke.exports=W));else var S,O})()},"rAM+":function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return W});var ue=j("Qw5x");function W(R,N){var S;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(S=Object(ue.a)(R))||N&&R&&typeof R.length=="number"){S&&(R=S);var O=0,F=function(){};return{s:F,n:function(){return O>=R.length?{done:!0}:{done:!1,value:R[O++]}},e:function(u){throw u},f:F}}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 B=!0,e=!1,w;return{s:function(){S=R[Symbol.iterator]()},n:function(){var u=S.next();return B=u.done,u},e:function(u){e=!0,w=u},f:function(){try{!B&&S.return!=null&&S.return()}finally{if(e)throw w}}}}},rUJ1:function(Ke,ye){const j=/[&<>"']/,ue=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,N={"&":"&","<":"<",">":">",'"':""","'":"'"},S=y=>N[y];function O(y,d){if(d){if(j.test(y))return y.replace(ue,S)}else if(W.test(y))return y.replace(R,S);return y}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(y){return y.replace(F,(d,f)=>(f=f.toLowerCase(),f==="colon"?":":f.charAt(0)==="#"?f.charAt(1)==="x"?String.fromCharCode(parseInt(f.substring(2),16)):String.fromCharCode(+f.substring(1)):""))}const e=/(^|[^\[])\^/g;function w(y,d){y=y.source||y,d=d||"";const f={replace:(m,h)=>(h=h.source||h,h=h.replace(e,"$1"),y=y.replace(m,h),f),getRegex:()=>new RegExp(y,d)};return f}const g=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l(y,d,f){if(y){let m;try{m=decodeURIComponent(B(f)).replace(g,"").toLowerCase()}catch(h){return null}if(m.indexOf("javascript:")===0||m.indexOf("vbscript:")===0||m.indexOf("data:")===0)return null}d&&!u.test(f)&&(f=r(d,f));try{f=encodeURI(f).replace(/%25/g,"%")}catch(m){return null}return f}const s={},i=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(y,d){s[" "+y]||(i.test(y)?s[" "+y]=y+"/":s[" "+y]=c(y,"/",!0)),y=s[" "+y];const f=y.indexOf(":")===-1;return d.substring(0,2)==="//"?f?d:y.replace(o,"$1")+d:d.charAt(0)==="/"?f?d:y.replace(a,"$1")+d:y+d}const n={exec:function(){}};function t(y){let d=1,f,m;for(;d<arguments.length;d++){f=arguments[d];for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&(y[m]=f[m])}return y}function v(y,d){const f=y.replace(/\|/g,(E,_,T)=>{let k=!1,D=_;for(;--D>=0&&T[D]==="\\";)k=!k;return k?"|":" |"}),m=f.split(/ \|/);let h=0;if(m.length>d)m.splice(d);else for(;m.length<d;)m.push("");for(;h<m.length;h++)m[h]=m[h].trim().replace(/\\\|/g,"|");return m}function c(y,d,f){const m=y.length;if(m===0)return"";let h=0;for(;h<m;){const E=y.charAt(m-h-1);if(E===d&&!f)h++;else if(E!==d&&f)h++;else break}return y.substr(0,m-h)}function p(y,d){if(y.indexOf(d[1])===-1)return-1;const f=y.length;let m=0,h=0;for(;h<f;h++)if(y[h]==="\\")h++;else if(y[h]===d[0])m++;else if(y[h]===d[1]&&(m--,m<0))return h;return-1}function b(y){y&&y.sanitize&&!y.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")}Ke.exports={escape:O,unescape:B,edit:w,cleanUrl:l,resolveUrl:r,noopTest:n,merge:t,splitCells:v,rtrim:c,findClosingBracket:p,checkSanitizeDeprecation:b}},sboe:function(Ke,ye,j){"use strict";j.d(ye,"a",function(){return R});var ue=j("q1tI"),W=j.n(ue),R=ue.createContext(null)},spXi:function(Ke,ye,j){Ke.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(Ke,ye,j){"use strict";var ue=j("VTBJ"),W=j("1OyB"),R=j("vuIU"),N=j("Ji7U"),S=j("LK+K"),O=j("q1tI"),F=j.n(O),B=j("m+aA"),e=j("Zm9Q"),w=j("Kwbf"),g=j("c+Xe"),u=j("bdgK"),l="rc-observer-key",s=function(i){Object(N.a)(a,i);var o=Object(S.a)(a);function a(){var r;return Object(W.a)(this,a),r=o.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(n){var t=r.props.onResize,v=n[0].target,c=v.getBoundingClientRect(),p=c.width,b=c.height,y=v.offsetWidth,d=v.offsetHeight,f=Math.floor(p),m=Math.floor(b);if(r.state.width!==f||r.state.height!==m||r.state.offsetWidth!==y||r.state.offsetHeight!==d){var h={width:f,height:m,offsetWidth:y,offsetHeight:d};r.setState(h),t&&Promise.resolve().then(function(){t(Object(ue.a)(Object(ue.a)({},h),{},{offsetWidth:y,offsetHeight:d}))})}},r.setChildNode=function(n){r.childNode=n},r}return Object(R.a)(a,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var t=Object(B.a)(this.childNode||this),v=t!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new u.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,t=Object(e.a)(n);if(t.length>1)Object(w.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(w.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=t[0];if(O.isValidElement(v)&&Object(g.c)(v)){var c=v.ref;t[0]=O.cloneElement(v,{ref:Object(g.a)(c,this.setChildNode)})}return t.length===1?t[0]:t.map(function(p,b){return!O.isValidElement(p)||"key"in p&&p.key!==null?p:O.cloneElement(p,{key:"".concat(l,"-").concat(b)})})}}]),a}(O.Component);s.displayName="ResizeObserver",ye.a=s},t9D7:function(Ke,ye,j){"use strict";j.d(ye,"b",function(){return F}),j.d(ye,"g",function(){return e}),j.d(ye,"d",function(){return w}),j.d(ye,"e",function(){return g}),j.d(ye,"a",function(){return u}),j.d(ye,"f",function(){return i}),j.d(ye,"c",function(){return o});var ue=j("Vhoy"),W=j("MI8n"),R=j("pmY6"),N=j("Cg/j"),S=j("ic2d"),O=j("nEHx");const F=Object(N.c)("themeService");var B;(function(a){function r(n){return n&&typeof n=="object"&&typeof n.id=="string"}a.isThemeColor=r})(B||(B={}));function e(a){return{id:a}}var w;(function(a){function r(b){return b&&typeof b=="object"&&typeof b.id=="string"&&(typeof b.color=="undefined"||B.isThemeColor(b.color))}a.isThemeIcon=r;const n=new RegExp(`^\\$\\((${ue.a.iconNameExpression}(?:${ue.a.iconModifierExpression})?)\\)$`);function t(b){const y=n.exec(b);if(!y)return;let[,d]=y;return{id:d}}a.fromString=t;function v(b,y){let d=b.id;const f=d.lastIndexOf("~");return f!==-1&&(d=d.substring(0,f)),y&&(d=`${d}~${y}`),{id:d}}a.modify=v;function c(b,y){var d,f;return b.id===y.id&&((d=b.color)===null||d===void 0?void 0:d.id)===((f=y.color)===null||f===void 0?void 0:f.id)}a.isEqual=c;function p(b,y){return{id:b.id,color:y?e(y):void 0}}a.asThemeIcon=p,a.asClassNameArray=ue.a.asClassNameArray,a.asClassName=ue.a.asClassName,a.asCSSSelector=ue.a.asCSSSelector})(w||(w={}));function g(a){switch(a){case O.a.DARK:return"vs-dark";case O.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const u={ThemingContribution:"base.contributions.theming"};class l{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new W.b}onColorThemeChange(a){return this.themingParticipants.push(a),this.onThemingParticipantAddedEmitter.fire(a),Object(R.i)(()=>{const r=this.themingParticipants.indexOf(a);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let s=new l;S.a.add(u.ThemingContribution,s);function i(a){return s.onColorThemeChange(a)}class o extends R.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(Ke,ye,j){typeof window!="undefined"&&function(W,R){Ke.exports=R()}(this,function(){return function(ue){var W={};function R(N){if(W[N])return W[N].exports;var S=W[N]={i:N,l:!1,exports:{}};return ue[N].call(S.exports,S,S.exports,R),S.l=!0,S.exports}return R.m=ue,R.c=W,R.d=function(N,S,O){R.o(N,S)||Object.defineProperty(N,S,{enumerable:!0,get:O})},R.r=function(N){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},R.t=function(N,S){if(S&1&&(N=R(N)),S&8)return N;if(S&4&&typeof N=="object"&&N&&N.__esModule)return N;var O=Object.create(null);if(R.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:N}),S&2&&typeof N!="string")for(var F in N)R.d(O,F,function(B){return N[B]}.bind(null,F));return O},R.n=function(N){var S=N&&N.__esModule?function(){return N.default}:function(){return N};return R.d(S,"a",S),S},R.o=function(N,S){return Object.prototype.hasOwnProperty.call(N,S)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,W,R){"use strict";var N=Object.prototype.hasOwnProperty,S="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(S=!1));function F(g,u,l){this.fn=g,this.context=u,this.once=l||!1}function B(g,u,l,s,i){if(typeof l!="function")throw new TypeError("The listener must be a function");var o=new F(l,s||g,i),a=S?S+u:u;return g._events[a]?g._events[a].fn?g._events[a]=[g._events[a],o]:g._events[a].push(o):(g._events[a]=o,g._eventsCount++),g}function e(g,u){--g._eventsCount===0?g._events=new O:delete g._events[u]}function w(){this._events=new O,this._eventsCount=0}w.prototype.eventNames=function(){var u=[],l,s;if(this._eventsCount===0)return u;for(s in l=this._events)N.call(l,s)&&u.push(S?s.slice(1):s);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},w.prototype.listeners=function(u){var l=S?S+u:u,s=this._events[l];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,o=s.length,a=new Array(o);i<o;i++)a[i]=s[i].fn;return a},w.prototype.listenerCount=function(u){var l=S?S+u:u,s=this._events[l];return s?s.fn?1:s.length:0},w.prototype.emit=function(u,l,s,i,o,a){var r=S?S+u:u;if(!this._events[r])return!1;var n=this._events[r],t=arguments.length,v,c;if(n.fn){n.once&&this.removeListener(u,n.fn,void 0,!0);switch(t){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,l),!0;case 3:return n.fn.call(n.context,l,s),!0;case 4:return n.fn.call(n.context,l,s,i),!0;case 5:return n.fn.call(n.context,l,s,i,o),!0;case 6:return n.fn.call(n.context,l,s,i,o,a),!0}for(c=1,v=new Array(t-1);c<t;c++)v[c-1]=arguments[c];n.fn.apply(n.context,v)}else{var p=n.length,b;for(c=0;c<p;c++){n[c].once&&this.removeListener(u,n[c].fn,void 0,!0);switch(t){case 1:n[c].fn.call(n[c].context);break;case 2:n[c].fn.call(n[c].context,l);break;case 3:n[c].fn.call(n[c].context,l,s);break;case 4:n[c].fn.call(n[c].context,l,s,i);break;default:if(!v)for(b=1,v=new Array(t-1);b<t;b++)v[b-1]=arguments[b];n[c].fn.apply(n[c].context,v)}}}return!0},w.prototype.on=function(u,l,s){return B(this,u,l,s,!1)},w.prototype.once=function(u,l,s){return B(this,u,l,s,!0)},w.prototype.removeListener=function(u,l,s,i){var o=S?S+u:u;if(!this._events[o])return this;if(!l)return e(this,o),this;var a=this._events[o];if(a.fn)a.fn===l&&(!i||a.once)&&(!s||a.context===s)&&e(this,o);else{for(var r=0,n=[],t=a.length;r<t;r++)(a[r].fn!==l||i&&!a[r].once||s&&a[r].context!==s)&&n.push(a[r]);n.length?this._events[o]=n.length===1?n[0]:n:e(this,o)}return this},w.prototype.removeAllListeners=function(u){var l;return u?(l=S?S+u:u,this._events[l]&&e(this,l)):(this._events=new O,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=S,w.EventEmitter=w,ue.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(ue,W,R){(function(N){var S=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(w,g,u){if(u=u||{},w=w.trim(),g=g.trim(),!g){if(!u.alwaysNormalize)return w;var l=e.parseURL(w);if(!l)throw new Error("Error trying to parse base URL.");return l.path=e.normalizePath(l.path),e.buildURLFromParts(l)}var s=e.parseURL(g);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return u.alwaysNormalize?(s.path=e.normalizePath(s.path),e.buildURLFromParts(s)):g;var i=e.parseURL(w);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var o=O.exec(i.path);i.netLoc=o[1],i.path=o[2]}i.netLoc&&!i.path&&(i.path="/");var a={scheme:i.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(a.netLoc=i.netLoc,s.path[0]!=="/"))if(!s.path)a.path=i.path,s.params||(a.params=i.params,s.query||(a.query=i.query));else{var r=i.path,n=r.substring(0,r.lastIndexOf("/")+1)+s.path;a.path=e.normalizePath(n)}return a.path===null&&(a.path=u.alwaysNormalize?e.normalizePath(s.path):s.path),e.buildURLFromParts(a)},parseURL:function(w){var g=S.exec(w);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(F,"");w.length!==(w=w.replace(B,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};ue.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ue,W,R){function N(u){var l={};function s(o){if(l[o])return l[o].exports;var a=l[o]={i:o,l:!1,exports:{}};return u[o].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=u,s.c=l,s.i=function(o){return o},s.d=function(o,a,r){s.o(o,a)||Object.defineProperty(o,a,{configurable:!1,enumerable:!0,get:r})},s.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},s.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return s.d(a,"a",a),a},s.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},s.p="/",s.oe=function(o){throw console.error(o),o};var i=s(s.s=ENTRY_MODULE);return i.default||i}var S="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+S+").*?\\)";function F(u){return(u+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function B(u){return!isNaN(1*u)}function e(u,l,s){var i={};i[s]=[];var o=l.toString(),a=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return i;for(var r=a[1],n=new RegExp("(\\\\n|\\W)"+F(r)+O,"g"),t;t=n.exec(o);){if(t[3]==="dll-reference")continue;i[s].push(t[3])}for(n=new RegExp("\\("+F(r)+'\\("(dll-reference\\s('+S+'))"\\)\\)'+O,"g");t=n.exec(o);)u[t[2]]||(i[s].push(t[1]),u[t[2]]=R(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var v=Object.keys(i),c=0;c<v.length;c++)for(var p=0;p<i[v[c]].length;p++)B(i[v[c]][p])&&(i[v[c]][p]=1*i[v[c]][p]);return i}function w(u){var l=Object.keys(u);return l.reduce(function(s,i){return s||u[i].length>0},!1)}function g(u,l){for(var s={main:[l]},i={main:[]},o={main:{}};w(s);)for(var a=Object.keys(s),r=0;r<a.length;r++){var n=a[r],t=s[n],v=t.pop();if(o[n]=o[n]||{},o[n][v]||!u[n][v])continue;o[n][v]=!0,i[n]=i[n]||[],i[n].push(v);for(var c=e(u,u[n][v],n),p=Object.keys(c),b=0;b<p.length;b++)s[p[b]]=s[p[b]]||[],s[p[b]]=s[p[b]].concat(c[p[b]])}return i}ue.exports=function(u,l){l=l||{};var s={main:R.m},i=l.all?{main:Object.keys(s.main)}:g(s,u),o="";Object.keys(i).filter(function(v){return v!=="main"}).forEach(function(v){for(var c=0;i[v][c];)c++;i[v].push(c),s[v][c]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+v+" = ("+N.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+i[v].map(function(p){return""+JSON.stringify(p)+": "+s[v][p].toString()}).join(",")+`});
|
|
`}),o=o+"new (("+N.toString().replace("ENTRY_MODULE",JSON.stringify(u))+")({"+i.main.map(function(v){return""+JSON.stringify(v)+": "+s.main[v].toString()}).join(",")+"}))(self);";var a=new window.Blob([o],{type:"text/javascript"});if(l.bare)return a;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,n=r.createObjectURL(a),t=new window.Worker(n);return t.objectURL=n,t}},"./src/config.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"hlsDefaultConfig",function(){return b}),R.d(W,"mergeConfig",function(){return d}),R.d(W,"enableStreamingMode",function(){return f});var N=R("./src/controller/abr-controller.ts"),S=R("./src/controller/audio-stream-controller.ts"),O=R("./src/controller/audio-track-controller.ts"),F=R("./src/controller/subtitle-stream-controller.ts"),B=R("./src/controller/subtitle-track-controller.ts"),e=R("./src/controller/buffer-controller.ts"),w=R("./src/controller/timeline-controller.ts"),g=R("./src/controller/cap-level-controller.ts"),u=R("./src/controller/fps-controller.ts"),l=R("./src/controller/eme-controller.ts"),s=R("./src/controller/cmcd-controller.ts"),i=R("./src/utils/xhr-loader.ts"),o=R("./src/utils/fetch-loader.ts"),a=R("./src/utils/cues.ts"),r=R("./src/utils/mediakeys-helper.ts"),n=R("./src/utils/logger.ts");function t(){return t=Object.assign||function(m){for(var h=1;h<arguments.length;h++){var E=arguments[h];for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(m[_]=E[_])}return m},t.apply(this,arguments)}function v(m,h){var E=Object.keys(m);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(m);h&&(_=_.filter(function(T){return Object.getOwnPropertyDescriptor(m,T).enumerable})),E.push.apply(E,_)}return E}function c(m){for(var h=1;h<arguments.length;h++){var E=arguments[h]!=null?arguments[h]:{};h%2?v(Object(E),!0).forEach(function(_){p(m,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(E)):v(Object(E)).forEach(function(_){Object.defineProperty(m,_,Object.getOwnPropertyDescriptor(E,_))})}return m}function p(m,h,E){return h in m?Object.defineProperty(m,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):m[h]=E,m}var b=c(c({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:i.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:N.default,bufferController:e.default,capLevelController:g.default,fpsController:u.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},y()),{},{subtitleStreamController:F.SubtitleStreamController,subtitleTrackController:B.default,timelineController:w.TimelineController,audioStreamController:S.default,audioTrackController:O.default,emeController:l.default,cmcdController:s.default});function y(){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 d(m,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({},m,h)}function f(m){var h=m.loader;if(h!==o.default&&h!==i.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),m.progressive=!1;else{var E=Object(o.fetchSupported)();E&&(m.loader=o.default,m.progressive=!0,m.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/utils/ewma-bandwidth-estimator.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),B=R("./src/errors.ts"),e=R("./src/types/loader.ts"),w=R("./src/utils/logger.ts");function g(s,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function u(s,i,o){return i&&g(s.prototype,i),o&&g(s,o),s}var l=function(){function s(o){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=o;var a=o.config;this.bwEstimator=new S.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var i=s.prototype;return i.registerListeners=function(){var a=this.hls;a.on(O.Events.FRAG_LOADING,this.onFragLoading,this),a.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(O.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(O.Events.FRAG_LOADING,this.onFragLoading,this),a.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(O.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},i.onFragLoading=function(a,r){var n=r.frag;if(n.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=n,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},i.onLevelLoaded=function(a,r){var n=this.hls.config;r.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},i._abandonRulesCheck=function(){var a=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.autoLevelEnabled,v=n.config,c=n.media;if(!a||!c)return;var p=r?r.stats:a.stats,b=r?r.duration:a.duration;if(p.aborted){w.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||c.paused||!c.playbackRate||!c.readyState)return;var y=performance.now()-p.loading.start,d=Math.abs(c.playbackRate);if(y<=500*b/d)return;var f=n.levels,m=n.minAutoLevel,h=f[a.level],E=p.total||Math.max(p.loaded,Math.round(b*h.maxBitrate/8)),_=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/y),T=(E-p.loaded)/_,k=c.currentTime,D=(F.BufferHelper.bufferInfo(c,k,v.maxBufferHole).end-k)/d;if(D>=2*b/d||T<=D)return;var x=Number.POSITIVE_INFINITY,P;for(P=a.level-1;P>m;P--){var H=f[P].maxBitrate;if(x=b*H/(8*.8*_),x<D)break}if(x>=T)return;var I=this.bwEstimator.getEstimate();w.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 "+P+`
|
|
Current BW estimate: `+(Object(N.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+T.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+x.toFixed(3)+` s
|
|
Time to underbuffer: `+D.toFixed(3)+" s"),n.nextLoadLevel=P,this.bwEstimator.sample(y,p.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),n.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:r,stats:p})},i.onFragLoaded=function(a,r){var n=r.frag,t=r.part;if(n.type===e.PlaylistLevelType.MAIN&&Object(N.isFiniteNumber)(n.sn)){var v=t?t.stats:n.stats,c=t?t.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[n.level],b=(p.loaded?p.loaded.bytes:0)+v.loaded,y=(p.loaded?p.loaded.duration:0)+c;p.loaded={bytes:b,duration:y},p.realBitrate=Math.round(8*b/y)}if(n.bitrateTest){var d={stats:v,frag:n,part:t,id:n.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,d),n.bitrateTest=!1}}},i.onFragBuffered=function(a,r){var n=r.frag,t=r.part,v=t?t.stats:n.stats;if(v.aborted)return;if(n.type!==e.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var c=v.parsing.end-v.loading.start;this.bwEstimator.sample(c,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0},i.onError=function(a,r){switch(r.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},i.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},i.getNextABRAutoLevel=function(){var a=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.maxAutoLevel,v=n.config,c=n.minAutoLevel,p=n.media,b=r?r.duration:a?a.duration:0,y=p?p.currentTime:0,d=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,m=(F.BufferHelper.bufferInfo(p,y,v.maxBufferHole).end-y)/d,h=this.findBestLevel(f,c,t,m,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(h>=0)return h;w.logger.trace((m?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=b?Math.min(b,v.maxStarvationDelay):v.maxStarvationDelay,_=v.abrBandWidthFactor,T=v.abrBandWidthUpFactor;if(!m){var k=this.bitrateTestDelay;if(k){var D=b?Math.min(b,v.maxLoadingDelay):v.maxLoadingDelay;E=D-k,w.logger.trace("bitrate test took "+Math.round(1e3*k)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),_=T=1}}return h=this.findBestLevel(f,c,t,m+E,_,T),Math.max(h,0)},i.findBestLevel=function(a,r,n,t,v,c){for(var p,b=this.fragCurrent,y=this.partCurrent,d=this.lastLoadedFragLevel,f=this.hls.levels,m=f[d],h=!!(m!=null&&(p=m.details)!==null&&p!==void 0&&p.live),E=m==null?void 0:m.codecSet,_=y?y.duration:b?b.duration:0,T=n;T>=r;T--){var k=f[T];if(!k||E&&k.codecSet!==E)continue;var D=k.details,x=(y?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||_,P=void 0;T<=d?P=v*a:P=c*a;var H=f[T].maxBitrate,I=H*x/P;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(P)+"/"+H+"/"+x+"/"+t+"/"+I),P>H&&(!I||h&&!this.bitrateTestDelay||I<t))return T}return-1},u(s,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,r=this.bwEstimator;if(a!==-1&&(!r||!r.canEstimate()))return a;var n=this.getNextABRAutoLevel();return a!==-1&&(n=Math.min(a,n)),n},set:function(a){this._nextAutoLevel=a}}]),s}();W.default=l},"./src/controller/audio-stream-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/controller/base-stream-controller.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),B=R("./src/controller/fragment-tracker.ts"),e=R("./src/types/level.ts"),w=R("./src/types/loader.ts"),g=R("./src/loader/fragment.ts"),u=R("./src/demux/chunk-cache.ts"),l=R("./src/demux/transmuxer-interface.ts"),s=R("./src/types/transmuxer.ts"),i=R("./src/controller/fragment-finders.ts"),o=R("./src/utils/discontinuities.ts"),a=R("./src/errors.ts"),r=R("./src/utils/logger.ts");function n(){return n=Object.assign||function(b){for(var y=1;y<arguments.length;y++){var d=arguments[y];for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(b[f]=d[f])}return b},n.apply(this,arguments)}function t(b,y){b.prototype=Object.create(y.prototype),b.prototype.constructor=b,v(b,y)}function v(b,y){return v=Object.setPrototypeOf||function(f,m){return f.__proto__=m,f},v(b,y)}var c=100,p=function(b){t(y,b);function y(f,m){var h;return h=b.call(this,f,m,"[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 d=y.prototype;return d.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},d._registerListeners=function(){var m=this.hls;m.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(O.Events.ERROR,this.onError,this),m.on(O.Events.BUFFER_RESET,this.onBufferReset,this),m.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},d._unregisterListeners=function(){var m=this.hls;m.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(O.Events.ERROR,this.onError,this),m.off(O.Events.BUFFER_RESET,this.onBufferReset,this),m.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},d.onInitPtsFound=function(m,h){var E=h.frag,_=h.id,T=h.initPTS;if(_==="main"){var k=E.cc;this.initPTS[E.cc]=T,this.log("InitPTS for cc: "+k+" found from main: "+T),this.videoTrackCC=k,this.state===S.State.WAITING_INIT_PTS&&this.tick()}},d.startLoad=function(m){if(!this.levels){this.startPosition=m,this.state=S.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(c),this.fragLoadError=0,h>0&&m===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=S.State.IDLE):(this.loadedmetadata=!1,this.state=S.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()},d.doTick=function(){switch(this.state){case S.State.IDLE:this.doTickIdle();break;case S.State.WAITING_TRACK:{var m,h=this.levels,E=this.trackId,_=h==null||((m=h[E])===null||m===void 0)?void 0:m.details;if(_){if(this.waitForCdnTuneIn(_))break;this.state=S.State.WAITING_INIT_PTS}break}case S.State.FRAG_LOADING_WAITING_RETRY:{var T,k=performance.now(),D=this.retryDate;(!D||k>=D||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=S.State.IDLE);break}case S.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var P=x.frag,H=x.part,I=x.cache,V=x.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=S.State.FRAG_LOADING;var $=I.flush(),ge={frag:P,part:H,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ge),V&&b.prototype._handleFragmentLoadComplete.call(this,ge)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var te=this.getLoadPosition(),be=F.BufferHelper.bufferInfo(this.mediaBuffer,te,this.config.maxBufferHole),ve=Object(i.fragmentWithinToleranceTest)(be.end,this.config.maxFragLookUpTolerance,P);ve<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+be.end+" is needed"),this.clearWaitingFragment())}}else this.state=S.State.IDLE}}this.onTickEnd()},d.clearWaitingFragment=function(){var m=this.waitingData;m&&(this.fragmentTracker.removeFragment(m.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=S.State.IDLE)},d.onTickEnd=function(){var m=this.media;if(!m||!m.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:m,E=h.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=m.currentTime},d.doTickIdle=function(){var m,h,E=this.hls,_=this.levels,T=this.media,k=this.trackId,D=E.config;if(!_||!_[k])return;if(!T&&(this.startFragRequested||!D.startFragPrefetch))return;var x=_[k],P=x.details;if(!P||P.live&&this.levelLastLoaded!==k||this.waitForCdnTuneIn(P)){this.state=S.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if(H===null)return;var I=H.len,V=this.getMaxBufferLength(),$=this.audioSwitch;if(I>=V&&!$)return;if(!$&&this._streamEnded(H,P)){E.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=S.State.ENDED;return}var ge=P.fragments,te=ge[0].start,be=H.end;if($){var ve=this.getLoadPosition();be=ve,P.PTSKnown&&ve<te&&((H.end>te||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=te+.05))}var oe=this.getNextFragment(be,P);if(!oe){this.bufferFlushed=!0;return}((m=oe.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((h=oe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(oe,P):this.loadFragment(oe,P,be)},d.getMaxBufferLength=function(){var m=b.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.PlaylistLevelType.MAIN);return h===null?m:Math.max(m,h.len)},d.onMediaDetaching=function(){this.videoBuffer=null,b.prototype.onMediaDetaching.call(this)},d.onAudioTracksUpdated=function(m,h){var E=h.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(_){return new e.Level(_)})},d.onAudioTrackSwitching=function(m,h){var E=!!h.url;this.trackId=h.id;var _=this.fragCurrent;_!=null&&_.loader&&_.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(c):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=S.State.IDLE):this.state=S.State.STOPPED,this.tick()},d.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},d.onLevelLoaded=function(m,h){this.mainDetails=h.details},d.onAudioTrackLoaded=function(m,h){var E,_=this.levels,T=h.details,k=h.id;if(!_){this.warn("Audio tracks were reset while loading level "+k);return}this.log("Track "+k+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var D=_[k],x=0;if(T.live||(E=D.details)!==null&&E!==void 0&&E.live){var P=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!P)return;!D.details&&T.hasProgramDateTime&&P.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(T,P),x=T.fragments[0].start):x=this.alignPlaylists(T,D.details)}D.details=T,this.levelLastLoaded=k,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(D.details,x),this.state===S.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=S.State.IDLE),this.tick()},d._handleFragmentLoadProgress=function(m){var h,E=m.frag,_=m.part,T=m.payload,k=this.config,D=this.trackId,x=this.levels;if(!x){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var P=x[D];console.assert(P,"Audio track is defined on fragment load progress");var H=P.details;console.assert(H,"Audio track details are defined on fragment load progress");var I=k.defaultAudioCodec||P.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new l.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[E.cc],ge=(h=E.initSegment)===null||h===void 0?void 0:h.data;if($!==void 0){var te=!1,be=_?_.index:-1,ve=be!==-1,oe=new s.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,T.byteLength,be,ve);V.push(T,ge,I,"",E,_,H.totalduration,te,oe,$)}else{r.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+D);var le=this.waitingData=this.waitingData||{frag:E,part:_,cache:new u.default,complete:!1},_e=le.cache;_e.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=S.State.WAITING_INIT_PTS}},d._handleFragmentLoadComplete=function(m){if(this.waitingData){this.waitingData.complete=!0;return}b.prototype._handleFragmentLoadComplete.call(this,m)},d.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},d.onBufferCreated=function(m,h){var E=h.tracks.audio;E&&(this.mediaBuffer=E.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},d.onFragBuffered=function(m,h){var E=h.frag,_=h.part;if(E.type!==w.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(_?" p: "+_.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,_)},d.onError=function(m,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(w.PlaylistLevelType.AUDIO,h);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==S.State.ERROR&&this.state!==S.State.STOPPED&&(this.state=h.fatal?S.State.ERROR:S.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===S.State.PARSING||this.state===S.State.PARSED)){var E=!0,_=this.getFwdBufferInfo(this.mediaBuffer,w.PlaylistLevelType.AUDIO);_&&_.len>.5&&(E=!this.reduceMaxBufferLength(_.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},d.onBufferFlushed=function(m,h){var E=h.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},d._handleTransmuxComplete=function(m){var h,E="audio",_=this.hls,T=m.remuxResult,k=m.chunkMeta,D=this.getCurrentContext(k);if(!D){this.warn("The loading context changed while buffering fragment "+k.sn+" of level "+k.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(k.level);return}var x=D.frag,P=D.part,H=T.audio,I=T.text,V=T.id3,$=T.initSegment;if(this.fragContextChanged(x))return;if(this.state=S.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,x,k),_.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:E,tracks:$.tracks})),H){var ge=H.startPTS,te=H.endPTS,be=H.startDTS,ve=H.endDTS;P&&(P.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:te,startDTS:be,endDTS:ve}),x.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ge,te,be,ve),this.bufferFragmentData(H,x,P,k)}if(V!=null&&(h=V.samples)!==null&&h!==void 0&&h.length){var oe=n({frag:x,id:E},V);_.trigger(O.Events.FRAG_PARSING_METADATA,oe)}if(I){var le=n({frag:x,id:E},I);_.trigger(O.Events.FRAG_PARSING_USERDATA,le)}},d._bufferInitSegment=function(m,h,E){if(this.state!==S.State.PARSING)return;m.video&&delete m.video;var _=m.audio;if(!_)return;_.levelCodec=_.codec,_.id="audio",this.log("Init audio buffer, container:"+_.container+", codecs[parsed]=["+_.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,m);var T=_.initSegment;if(T!=null&&T.byteLength){var k={type:"audio",frag:h,part:null,chunkMeta:E,parent:h.type,data:T};this.hls.trigger(O.Events.BUFFER_APPENDING,k)}this.tick()},d.loadFragment=function(m,h,E){var _=this.fragmentTracker.getState(m);this.fragCurrent=m,(this.audioSwitch||_===B.FragmentState.NOT_LOADED||_===B.FragmentState.PARTIAL)&&(m.sn==="initSegment"?this._loadInitSegment(m):h.live&&!Object(N.isFiniteNumber)(this.initPTS[m.cc])?(this.log("Waiting for video PTS in continuity counter "+m.cc+" of live stream before loading audio fragment "+m.sn+" of level "+this.trackId),this.state=S.State.WAITING_INIT_PTS):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,m,h,E)))},d.completeAudioSwitch=function(){var m=this.hls,h=this.media,E=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,m.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:E})},y}(S.default);W.default=p},"./src/controller/audio-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function B(l,s){for(var i=0;i<s.length;i++){var o=s[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function e(l,s,i){return s&&B(l.prototype,s),i&&B(l,i),l}function w(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,g(l,s)}function g(l,s){return g=Object.setPrototypeOf||function(o,a){return o.__proto__=a,o},g(l,s)}var u=function(l){w(s,l);function s(o){var a;return a=l.call(this,o,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var i=s.prototype;return i.registerListeners=function(){var a=this.hls;a.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(N.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(N.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,l.prototype.destroy.call(this)},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},i.onManifestParsed=function(a,r){this.tracks=r.audioTracks||[]},i.onAudioTrackLoaded=function(a,r){var n=r.id,t=r.details,v=this.tracksInGroup[n];if(!v){this.warn("Invalid audio track id "+n);return}var c=v.details;v.details=r.details,this.log("audioTrack "+n+" loaded ["+t.startSN+"-"+t.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,r,c))},i.onLevelLoading=function(a,r){this.switchLevel(r.level)},i.onLevelSwitching=function(a,r){this.switchLevel(r.level)},i.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.audioGroupIds))return;var n=r.audioGroupIds[r.urlId];if(this.groupId!==n){this.groupId=n;var t=this.tracks.filter(function(c){return!n||c.groupId===n});this.selectDefaultTrack&&!t.some(function(c){return c.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var v={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(N.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},i.onError=function(a,r){if(l.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===F.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},i.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 n=r[this.trackId];this.log("Now switching to audio-track index "+a);var t=r[a],v=t.id,c=t.groupId,p=c===void 0?"":c,b=t.name,y=t.type,d=t.url;if(this.trackId=a,this.trackName=b,this.selectDefaultTrack=!1,this.hls.trigger(N.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:p,name:b,type:y,url:d}),t.details&&!t.details.live)return;var f=this.switchParams(t.url,n==null?void 0:n.details);this.loadPlaylist(f)},i.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,n=this.findTrackId(r)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},i.findTrackId=function(a){for(var r=this.tracksInGroup,n=0;n<r.length;n++){var t=r[n];if((!this.selectDefaultTrack||t.default)&&(!a||a===t.name))return t.id}return-1},i.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var n=r.id,t=r.groupId,v=r.url;if(a)try{v=a.addDirectives(v)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(N.Events.AUDIO_TRACK_LOADING,{url:v,id:n,groupId:t,deliveryDirectives:a||null})}},e(s,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),s}(O.default);W.default=u},"./src/controller/base-playlist-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/polyfills/number.ts"),S=R("./src/types/level.ts"),O=R("./src/controller/level-helper.ts"),F=R("./src/utils/logger.ts"),B=R("./src/errors.ts"),e=function(){function w(u,l){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,l+":"),this.warn=F.logger.warn.bind(F.logger,l+":"),this.hls=u}var g=w.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(l,s){s.fatal&&s.type===B.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(l,s){var i=s==null?void 0:s.renditionReports;if(i)for(var o=0;o<i.length;o++){var a=i[o],r=""+a.URI;if(r===l.substr(-r.length)){var n=parseInt(a["LAST-MSN"]),t=parseInt(a["LAST-PART"]);if(s&&this.hls.config.lowLatencyMode){var v=Math.min(s.age-s.partTarget,s.targetduration);t!==void 0&&v>s.partTarget&&(t+=1)}if(Object(N.isFiniteNumber)(n))return new S.HlsUrlParameters(n,Object(N.isFiniteNumber)(t)?t:void 0,S.HlsSkip.No)}}},g.loadPlaylist=function(l){},g.shouldLoadTrack=function(l){return this.canLoad&&l&&!!l.url&&(!l.details||l.details.live)},g.playlistLoaded=function(l,s,i){var o=this,a=s.details,r=s.stats,n=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(a.advancedDateTime=Date.now()-n,a.live||i!=null&&i.live){if(a.reloaded(i),i&&this.log("live playlist "+l+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),i&&a.fragments.length>0&&Object(O.mergeDetails)(i,a),!this.canLoad||!a.live)return;var t,v=void 0,c=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var p=this.hls.config.lowLatencyMode,b=a.lastPartSn,y=a.endSN,d=a.lastPartIndex,f=d!==-1,m=b===y,h=p?0:d;f?(v=m?y+1:b,c=m?h:d+1):v=y+1;var E=a.age,_=E+a.ageHeader,T=Math.min(_-a.partTarget,a.targetduration*1.5);if(T>0){if(i&&T>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+T+" with playlist age: "+a.age),T=0;else{var k=Math.floor(T/a.targetduration);if(v+=k,c!==void 0){var D=Math.round(T%a.targetduration/a.partTarget);c+=D}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+T+" skip sn "+k+" to part "+c)}a.tuneInGoal=T}if(t=this.getDeliveryDirectives(a,s.deliveryDirectives,v,c),p||!m){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(a,s.deliveryDirectives,v,c);var x=Object(O.computeReloadInterval)(a,r);v!==void 0&&a.canBlockReload&&(x-=a.partTarget||1),this.log("reload live playlist "+l+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return o.loadPlaylist(t)},x)}else this.clearTimer()},g.getDeliveryDirectives=function(l,s,i,o){var a=Object(S.getSkipValue)(l,i);return s!=null&&s.skip&&l.deltaUpdateFailed&&(i=s.msn,o=s.part,a=S.HlsSkip.No),new S.HlsUrlParameters(i,o,a)},g.retryLoadingOrFail=function(l){var s=this,i=this.hls.config,o=this.retryCount<i.levelLoadingMaxRetry;if(o){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)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return s.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 o},w}()},"./src/controller/base-stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"State",function(){return y}),R.d(W,"default",function(){return d});var N=R("./src/polyfills/number.ts"),S=R("./src/task-loop.ts"),O=R("./src/controller/fragment-tracker.ts"),F=R("./src/utils/buffer-helper.ts"),B=R("./src/utils/logger.ts"),e=R("./src/events.ts"),w=R("./src/errors.ts"),g=R("./src/types/transmuxer.ts"),u=R("./src/utils/mp4-tools.ts"),l=R("./src/utils/discontinuities.ts"),s=R("./src/controller/fragment-finders.ts"),i=R("./src/controller/level-helper.ts"),o=R("./src/loader/fragment-loader.ts"),a=R("./src/crypt/decrypter.ts"),r=R("./src/utils/time-ranges.ts"),n=R("./src/types/loader.ts");function t(f,m){for(var h=0;h<m.length;h++){var E=m[h];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function v(f,m,h){return m&&t(f.prototype,m),h&&t(f,h),f}function c(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function p(f,m){f.prototype=Object.create(m.prototype),f.prototype.constructor=f,b(f,m)}function b(f,m){return b=Object.setPrototypeOf||function(E,_){return E.__proto__=_,E},b(f,m)}var y={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"},d=function(f){p(m,f);function m(E,_,T){var k;return k=f.call(this)||this,k.hls=void 0,k.fragPrevious=null,k.fragCurrent=null,k.fragmentTracker=void 0,k.transmuxer=null,k._state=y.STOPPED,k.media=void 0,k.mediaBuffer=void 0,k.config=void 0,k.bitrateTest=!1,k.lastCurrentTime=0,k.nextLoadPosition=0,k.startPosition=0,k.loadedmetadata=!1,k.fragLoadError=0,k.retryDate=0,k.levels=null,k.fragmentLoader=void 0,k.levelLastLoaded=null,k.startFragRequested=!1,k.decrypter=void 0,k.initPTS=[],k.onvseeking=null,k.onvended=null,k.logPrefix="",k.log=void 0,k.warn=void 0,k.logPrefix=T,k.log=B.logger.log.bind(B.logger,T+":"),k.warn=B.logger.warn.bind(B.logger,T+":"),k.hls=E,k.fragmentLoader=new o.default(E.config),k.fragmentTracker=_,k.config=E.config,k.decrypter=new a.default(E,E.config),E.on(e.Events.KEY_LOADED,k.onKeyLoaded,c(k)),k}var h=m.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(_){},h.stopLoad=function(){this.fragmentLoader.abort();var _=this.fragCurrent;_&&this.fragmentTracker.removeFragment(_),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=y.STOPPED},h._streamEnded=function(_,T){var k=this.fragCurrent,D=this.fragmentTracker;if(!T.live&&k&&k.sn===T.endSN&&!_.nextStart){var x=D.getState(k);return x===O.FragmentState.PARTIAL||x===O.FragmentState.OK}return!1},h.onMediaAttached=function(_,T){var k=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),k.addEventListener("seeking",this.onvseeking),k.addEventListener("ended",this.onvended);var D=this.config;this.levels&&D.autoStartLoad&&this.state===y.STOPPED&&this.startLoad(D.startPosition)},h.onMediaDetaching=function(){var _=this.media;_!=null&&_.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),_&&(_.removeEventListener("seeking",this.onvseeking),_.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 _=this.config,T=this.fragCurrent,k=this.media,D=this.mediaBuffer,x=this.state,P=k?k.currentTime:0,H=F.BufferHelper.bufferInfo(D||k,P,_.maxBufferHole);if(this.log("media seeking to "+(Object(N.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+x),x===y.ENDED)this.resetLoadingState();else if(T&&!H.len){var I=_.maxFragLookUpTolerance,V=T.start-I,$=T.start+T.duration+I,ge=P>$;(P<V||ge)&&(ge&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}k&&(this.lastCurrentTime=P),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(_,T){if(this.state!==y.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=y.IDLE;var k=this.levels[T.frag.level].details;k&&this.loadFragment(T.frag,k,T.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=y.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,f.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(_,T){this.log("Loading key for "+_.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+_.level),this.state=y.KEY_LOADING,this.fragCurrent=_,this.hls.trigger(e.Events.KEY_LOADING,{frag:_})},h.loadFragment=function(_,T,k){this._loadFragForPlayback(_,T,k)},h._loadFragForPlayback=function(_,T,k){var D=this,x=function(H){if(D.fragContextChanged(_)){D.warn("Fragment "+_.sn+(H.part?" p: "+H.part.index:"")+" of level "+_.level+" was dropped during download."),D.fragmentTracker.removeFragment(_);return}_.stats.chunkCount++,D._handleFragmentLoadProgress(H)};this._doFragLoad(_,T,k,x).then(function(P){if(!P)return;D.fragLoadError=0;var H=D.state;if(D.fragContextChanged(_)){(H===y.FRAG_LOADING||H===y.BACKTRACKING||!D.fragCurrent&&H===y.PARSING)&&(D.fragmentTracker.removeFragment(_),D.state=y.IDLE);return}if("payload"in P&&(D.log("Loaded fragment "+_.sn+" of level "+_.level),D.hls.trigger(e.Events.FRAG_LOADED,P),D.state===y.BACKTRACKING)){D.fragmentTracker.backtrack(_,P),D.resetFragmentLoading(_);return}D._handleFragmentLoadComplete(P)}).catch(function(P){D.warn(P),D.resetFragmentLoading(_)})},h.flushMainBuffer=function(_,T,k){if(k===void 0&&(k=null),!(_-T))return;var D={startOffset:_,endOffset:T,type:k};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,D)},h._loadInitSegment=function(_){var T=this;this._doFragLoad(_).then(function(k){if(!k||T.fragContextChanged(_)||!T.levels)throw new Error("init load aborted");return k}).then(function(k){var D=T.hls,x=k.payload,P=_.decryptdata;if(x&&x.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var H=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(x),P.key.buffer,P.iv.buffer).then(function(I){var V=self.performance.now();return D.trigger(e.Events.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:H,tdecrypt:V}}),k.payload=I,k})}return k}).then(function(k){var D=T.fragCurrent,x=T.hls,P=T.levels;if(!P)throw new Error("init load aborted, missing levels");var H=P[_.level].details;console.assert(H,"Level details are defined when init segment is loaded");var I=_.stats;T.state=y.IDLE,T.fragLoadError=0,_.data=new Uint8Array(k.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),k.frag===D&&x.trigger(e.Events.FRAG_BUFFERED,{stats:I,frag:D,part:null,id:_.type}),T.tick()}).catch(function(k){T.warn(k),T.resetFragmentLoading(_)})},h.fragContextChanged=function(_){var T=this.fragCurrent;return!_||!T||_.level!==T.level||_.sn!==T.sn||_.urlId!==T.urlId},h.fragBufferedComplete=function(_,T){var k=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+_.type+" sn: "+_.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+_.level+" "+r.default.toString(F.BufferHelper.getBuffered(k))),this.state=y.IDLE,this.tick()},h._handleFragmentLoadComplete=function(_){var T=this.transmuxer;if(!T)return;var k=_.frag,D=_.part,x=_.partsLoaded,P=!x||x.length===0||x.some(function(I){return!I}),H=new g.ChunkMetadata(k.level,k.sn,k.stats.chunkCount+1,0,D?D.index:-1,!P);T.flush(H)},h._handleFragmentLoadProgress=function(_){},h._doFragLoad=function(_,T,k,D){var x=this;if(k===void 0&&(k=null),!this.levels)throw new Error("frag load aborted, missing levels");if(k=Math.max(_.start,k||0),this.config.lowLatencyMode&&T){var P=T.partList;if(P&&D){k>_.end&&T.fragmentHint&&(_=T.fragmentHint);var H=this.getNextPart(P,_,k);if(H>-1){var I=P[H];return this.log("Loading part sn: "+_.sn+" p: "+I.index+" cc: "+_.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+H+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+_.level+", target: "+parseFloat(k.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=y.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:_,part:P[H],targetBufferTime:k}),this.doFragPartsLoad(_,P,H,D).catch(function(V){return x.handleFragLoadError(V)})}else if(!_.url||this.loadedEndOfParts(P,k))return Promise.resolve(null)}}return this.log("Loading fragment "+_.sn+" cc: "+_.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+_.level+", target: "+parseFloat(k.toFixed(3))),Object(N.isFiniteNumber)(_.sn)&&!this.bitrateTest&&(this.nextLoadPosition=_.start+_.duration),this.state=y.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:_,targetBufferTime:k}),this.fragmentLoader.load(_,D).catch(function(V){return x.handleFragLoadError(V)})},h.doFragPartsLoad=function(_,T,k,D){var x=this;return new Promise(function(P,H){var I=[],V=function $(ge){var te=T[ge];x.fragmentLoader.loadPart(_,te,D).then(function(be){I[te.index]=be;var ve=be.part;x.hls.trigger(e.Events.FRAG_LOADED,be);var oe=T[ge+1];if(oe&&oe.fragment===_)$(ge+1);else return P({frag:_,part:ve,partsLoaded:I})}).catch(H)};V(k)})},h.handleFragLoadError=function(_){var T=_.data;return T&&T.details===w.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(e.Events.ERROR,T),null},h._handleTransmuxerFlush=function(_){var T=this.getCurrentContext(_);if(!T||this.state!==y.PARSING){this.fragCurrent||(this.state=y.IDLE);return}var k=T.frag,D=T.part,x=T.level,P=self.performance.now();k.stats.parsing.end=P,D&&(D.stats.parsing.end=P),this.updateLevelTiming(k,D,x,_.partial)},h.getCurrentContext=function(_){var T=this.levels,k=_.level,D=_.sn,x=_.part;if(!T||!T[k])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+k+". The current chunk will not be buffered."),null;var P=T[k],H=x>-1?Object(i.getPartWith)(P,D,x):null,I=H?H.fragment:Object(i.getFragmentWithSN)(P,D,this.fragCurrent);return I?{frag:I,part:H,level:P}:null},h.bufferFragmentData=function(_,T,k,D){if(!_||this.state!==y.PARSING)return;var x=_.data1,P=_.data2,H=x;if(x&&P&&(H=Object(u.appendUint8Array)(x,P)),!H||!H.length)return;var I={type:_.type,frag:T,part:k,chunkMeta:D,parent:T.type,data:H};this.hls.trigger(e.Events.BUFFER_APPENDING,I),_.dropped&&_.independent&&!k&&this.flushBufferGap(T)},h.flushBufferGap=function(_){var T=this.media;if(!T)return;if(!F.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,_.start);return}var k=T.currentTime,D=F.BufferHelper.bufferInfo(T,k,0),x=_.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),H=Math.max(Math.min(_.start-P,D.end-P),k+P);_.start-H>P&&this.flushMainBuffer(H,_.start)},h.getFwdBufferInfo=function(_,T){var k=this.config,D=this.getLoadPosition();if(!Object(N.isFiniteNumber)(D))return null;var x=F.BufferHelper.bufferInfo(_,D,k.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(D,T);if(P&&x.nextStart<P.end)return F.BufferHelper.bufferInfo(_,D,Math.max(x.nextStart,k.maxBufferHole))}return x},h.getMaxBufferLength=function(_){var T=this.config,k;return _?k=Math.max(8*T.maxBufferSize/_,T.maxBufferLength):k=T.maxBufferLength,Math.min(k,T.maxMaxBufferLength)},h.reduceMaxBufferLength=function(_){var T=this.config,k=_||T.maxBufferLength;return T.maxMaxBufferLength>=k?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(_,T){var k,D,x=T.fragments,P=x.length;if(!P)return null;var H=this.config,I=x[0].start,V;if(T.live){var $=H.initialLiveManifestSize;if(P<$)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+$+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(T,x),this.startPosition=V?this.hls.liveSyncPosition||V.start:_)}else _<=I&&(V=x[0]);if(!V){var ge=H.lowLatencyMode?T.partEnd:T.fragmentEnd;V=this.getFragmentAtPosition(_,ge,T)}return(k=V)!==null&&k!==void 0&&k.initSegment&&!((D=V)!==null&&D!==void 0&&D.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},h.getNextPart=function(_,T,k){for(var D=-1,x=!1,P=!0,H=0,I=_.length;H<I;H++){var V=_[H];if(P=P&&!V.independent,D>-1&&k<V.start)break;var $=V.loaded;!$&&(x||V.independent||P)&&V.fragment===T&&(D=H),x=$}return D},h.loadedEndOfParts=function(_,T){var k=_[_.length-1];return k&&T>k.start&&k.loaded},h.getInitialLiveFragment=function(_,T){var k=this.fragPrevious,D=null;if(k){if(_.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+k.programDateTime),D=Object(s.findFragmentByPDT)(T,k.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var x=k.sn+1;if(x>=_.startSN&&x<=_.endSN){var P=T[x-_.startSN];k.cc===P.cc&&(D=P,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=Object(s.findFragWithCC)(T,k.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(D=this.getFragmentAtPosition(H,this.bitrateTest?_.fragmentEnd:_.edge,_))}return D},h.getFragmentAtPosition=function(_,T,k){var D=this.config,x=this.fragPrevious,P=k.fragments,H=k.endSN,I=k.fragmentHint,V=D.maxFragLookUpTolerance,$=!!(D.lowLatencyMode&&k.partList&&I);$&&I&&!this.bitrateTest&&(P=P.concat(I),H=I.sn);var ge;if(_<T){var te=_>T-V?0:V;ge=Object(s.findFragmentByPTS)(x,P,_,te)}else ge=P[P.length-1];if(ge){var be=ge.sn-k.startSN,ve=x&&ge.level===x.level,oe=P[be+1],le=this.fragmentTracker.getState(ge);if(le===O.FragmentState.BACKTRACKED){ge=null;for(var _e=be;P[_e]&&this.fragmentTracker.getState(P[_e])===O.FragmentState.BACKTRACKED;)x?ge=P[_e--]:ge=P[--_e];ge||(ge=oe)}else x&&ge.sn===x.sn&&!$&&(ve&&(ge.sn<H&&this.fragmentTracker.getState(oe)!==O.FragmentState.OK?(this.log("SN "+ge.sn+" just loaded, load next one: "+oe.sn),ge=oe):ge=null))}return ge},h.synchronizeToLiveEdge=function(_){var T=this.config,k=this.media;if(!k)return;var D=this.hls.liveSyncPosition,x=k.currentTime,P=_.fragments[0].start,H=_.edge,I=x>=P-T.maxFragLookUpTolerance&&x<=H;if(D!==null&&k.duration>D&&(x<D||!I)){var V=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*_.targetduration;(!I&&k.readyState<4||x<H-V)&&(this.loadedmetadata||(this.nextLoadPosition=D),k.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+D.toFixed(3)),k.currentTime=D))}},h.alignPlaylists=function(_,T){var k=this.levels,D=this.levelLastLoaded,x=this.fragPrevious,P=D!==null?k[D]:null,H=_.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var I=_.fragments[0].start,V=!T,$=_.alignedSliding&&Object(N.isFiniteNumber)(I);if(V||!$&&!I){Object(l.alignStream)(x,P,_);var ge=_.fragments[0].start;return this.log("Live playlist sliding: "+ge.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+_.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+H),ge}return I},h.waitForCdnTuneIn=function(_){var T=3;return _.live&&_.canBlockReload&&_.tuneInGoal>Math.max(_.partHoldBack,_.partTarget*T)},h.setStartPosition=function(_,T){var k=this.startPosition;if(k<T&&(k=-1),k===-1||this.lastCurrentTime===-1){var D=_.startTimeOffset;Object(N.isFiniteNumber)(D)?(k=T+D,D<0&&(k+=_.totalduration),k=Math.min(Math.max(T,k),T+_.totalduration),this.log("Start time offset "+D+" found in playlist, adjust startPosition to "+k),this.startPosition=k):_.live?k=this.hls.liveSyncPosition||T:this.startPosition=k=0,this.lastCurrentTime=k}this.nextLoadPosition=k},h.getLoadPosition=function(){var _=this.media,T=0;return this.loadedmetadata&&_?T=_.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},h.handleFragLoadAborted=function(_,T){this.transmuxer&&_.sn!=="initSegment"&&_.stats.aborted&&(this.warn("Fragment "+_.sn+(T?" part"+T.index:"")+" of level "+_.level+" was aborted"),this.resetFragmentLoading(_))},h.resetFragmentLoading=function(_){(!this.fragCurrent||!this.fragContextChanged(_))&&(this.state=y.IDLE)},h.onFragmentOrKeyLoadError=function(_,T){if(T.fatal)return;var k=T.frag;if(!k||k.type!==_)return;var D=this.fragCurrent;console.assert(D&&k.sn===D.sn&&k.level===D.level&&k.urlId===D.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(k.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+k.sn+" of "+_+" "+k.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=y.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(_===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=y.IDLE):(B.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=y.ERROR)},h.afterBufferFlushed=function(_,T,k){if(!_)return;var D=F.BufferHelper.getBuffered(_);this.fragmentTracker.detectEvictedFragments(T,D,k),this.state===y.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=y.IDLE},h.resetLiveStartWhenNotLoaded=function(_){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[_].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(_,T,k,D){var x=this,P=k.details;console.assert(!!P,"level.details must be defined");var H=Object.keys(_.elementaryStreams).reduce(function(I,V){var $=_.elementaryStreams[V];if($){var ge=$.endPTS-$.startPTS;if(ge<=0)return x.warn("Could not parse fragment "+_.sn+" "+V+" duration reliably ("+ge+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),I||!1;var te=D?0:Object(i.updateFragPTSDTS)(P,_,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return x.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:k,drift:te,type:V,frag:_,start:$.startPTS,end:$.endPTS}),!0}return I},!1);H?(this.state=y.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:_,part:T})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(m,[{key:"state",get:function(){return this._state},set:function(_){var T=this._state;T!==_&&(this._state=_,this.log(T+"->"+_))}}]),m}(S.default)},"./src/controller/buffer-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s});var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./src/errors.ts"),B=R("./src/utils/buffer-helper.ts"),e=R("./src/utils/mediasource-helper.ts"),w=R("./src/loader/fragment.ts"),g=R("./src/controller/buffer-operation-queue.ts"),u=Object(e.getMediaSource)(),l=/([ha]vc.)(?:\.[^.,]+)+/,s=function(){function i(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 n=r.hls,t=r.media,v=r.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),n.trigger(S.Events.MEDIA_ATTACHED,{media:t})),v&&v.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var o=i.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.registerListeners=function(){var r=this.hls;r.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(S.Events.BUFFER_RESET,this.onBufferReset,this),r.on(S.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(S.Events.BUFFER_EOS,this.onBufferEos,this),r.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(S.Events.FRAG_PARSED,this.onFragParsed,this),r.on(S.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var r=this.hls;r.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(S.Events.BUFFER_RESET,this.onBufferReset,this),r.off(S.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(S.Events.BUFFER_EOS,this.onBufferEos,this),r.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(S.Events.FRAG_PARSED,this.onFragParsed,this),r.off(S.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(r,n){var t=2;(n.audio&&!n.video||!n.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(r,n){var t=this.media=n.media;if(t&&u){var v=this.mediaSource=new u;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(v),this._objectUrl=t.src}},o.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,t=this._objectUrl;if(n){if(O.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(v){O.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(r.removeAttribute("src"),r.load()):O.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(S.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(n){var t=r.sourceBuffer[n];try{t&&(r.removeBufferListeners(n),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[n]=void 0)}catch(v){O.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",v)}}),this._initSourceBuffer()},o.onBufferCodecs=function(r,n){var t=this,v=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(c){if(v){var p=t.tracks[c];if(p&&typeof p.buffer.changeType=="function"){var b=n[c],y=b.codec,d=b.levelCodec,f=b.container,m=(p.levelCodec||p.codec).replace(l,"$1"),h=(d||y).replace(l,"$1");if(m!==h){var E=f+";codecs="+(d||y);t.appendChangeType(c,E)}}}else t.pendingTracks[c]=n[c]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(r,n){var t=this,v=this.operationQueue,c={execute:function(){var b=t.sourceBuffer[r];b&&(O.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),b.changeType(n)),v.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(b){O.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",b)}};v.append(c,r)},o.onBufferAppending=function(r,n){var t=this,v=this.hls,c=this.operationQueue,p=this.tracks,b=n.data,y=n.type,d=n.frag,f=n.part,m=n.chunkMeta,h=m.buffering[y],E=self.performance.now();h.start=E;var _=d.stats.buffering,T=f?f.stats.buffering:null;_.start===0&&(_.start=E),T&&T.start===0&&(T.start=E);var k=p.audio,D=y==="audio"&&m.id===1&&(k==null?void 0:k.container)==="audio/mpeg",x={execute:function(){if(h.executeStart=self.performance.now(),D){var H=t.sourceBuffer[y];if(H){var I=d.start-H.timestampOffset;Math.abs(I)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+I+") sn: "+d.sn+")"),H.timestampOffset=d.start)}}t.appendExecutor(b,y)},onStart:function(){},onComplete:function(){var H=self.performance.now();h.executeEnd=h.end=H,_.first===0&&(_.first=H),T&&T.first===0&&(T.first=H);var I=t.sourceBuffer,V={};for(var $ in I)V[$]=B.BufferHelper.getBuffered(I[$]);t.appendError=0,t.hls.trigger(S.Events.BUFFER_APPENDED,{type:y,frag:d,part:f,chunkMeta:m,parent:d.type,timeRanges:V})},onError:function(H){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",H);var I={type:F.ErrorTypes.MEDIA_ERROR,parent:d.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=F.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,I.details=F.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>v.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),v.trigger(S.Events.ERROR,I)}};c.append(x,y)},o.onBufferFlushing=function(r,n){var t=this,v=this.operationQueue,c=function(b){return{execute:t.removeExecutor.bind(t,b,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(S.Events.BUFFER_FLUSHED,{type:b})},onError:function(d){O.logger.warn("[buffer-controller]: Failed to remove from "+b+" SourceBuffer",d)}}};n.type?v.append(c(n.type),n.type):this.getSourceBufferTypes().forEach(function(p){v.append(c(p),p)})},o.onFragParsed=function(r,n){var t=this,v=n.frag,c=n.part,p=[],b=c?c.elementaryStreams:v.elementaryStreams;b[w.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(b[w.ElementaryStreamTypes.AUDIO]&&p.push("audio"),b[w.ElementaryStreamTypes.VIDEO]&&p.push("video"));var y=function(){var f=self.performance.now();v.stats.buffering.end=f,c&&(c.stats.buffering.end=f);var m=c?c.stats:v.stats;t.hls.trigger(S.Events.FRAG_BUFFERED,{frag:v,part:c,stats:m,id:v.type})};p.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(y,p)},o.onFragChanged=function(r,n){this.flushBackBuffer()},o.onBufferEos=function(r,n){var t=this,v=this.getSourceBufferTypes().reduce(function(c,p){var b=t.sourceBuffer[p];return(!n.type||n.type===p)&&(b&&!b.ended&&(b.ended=!0,O.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),c&&!!(!b||b.ended)},!0);v&&this.blockBuffers(function(){var c=t.mediaSource;if(!c||c.readyState!=="open")return;c.endOfStream()})},o.onLevelUpdated=function(r,n){var t=n.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var r=this.hls,n=this.details,t=this.media,v=this.sourceBuffer;if(!t||n===null)return;var c=this.getSourceBufferTypes();if(!c.length)return;var p=n.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(N.isFiniteNumber)(p)||p<0)return;var b=t.currentTime,y=n.levelTargetDuration,d=Math.max(p,y),f=Math.floor(b/y)*y-d;c.forEach(function(m){var h=v[m];if(h){var E=B.BufferHelper.getBuffered(h);E.length>0&&f>E.start(0)&&(r.trigger(S.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),n.live&&r.trigger(S.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f}),r.trigger(S.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:m}))}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,t=this.media,v=this.mediaSource,c=r.fragments[0].start+r.totalduration,p=t.duration,b=Object(N.isFiniteNumber)(v.duration)?v.duration:0;r.live&&n.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(r)):(c>b&&c>p||!Object(N.isFiniteNumber)(p))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+c.toFixed(3)),v.duration=c)},o.updateSeekableRange=function(r){var n=this.mediaSource,t=r.fragments,v=t.length;if(v&&r.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var c=Math.max(0,t[0].start),p=Math.max(c,c+r.totalduration);n.setLiveSeekableRange(c,p)}},o.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,t=this.pendingTracks,v=Object.keys(t).length;if(v&&!r||v===2){this.createSourceBuffers(t),this.pendingTracks={};var c=this.getSourceBufferTypes();if(c.length===0){this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}c.forEach(function(p){n.executeNext(p)})}},o.createSourceBuffers=function(r){var n=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var c in r)if(!n[c]){var p=r[c];if(!p)throw Error("source buffer exists for track "+c+", however track does not");var b=p.levelCodec||p.codec,y=p.container+";codecs="+b;O.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var d=n[c]=t.addSourceBuffer(y),f=c;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.tracks[c]={buffer:d,codec:b,container:p.container,levelCodec:p.levelCodec,id:p.id},v++}catch(m){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+m.message),this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:m,mimeType:y})}}v&&this.hls.trigger(S.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(r){var n=this.operationQueue,t=n.current(r);t.onStart()},o._onSBUpdateEnd=function(r){var n=this.operationQueue,t=n.current(r);t.onComplete(),n.shiftAndExecuteNext(r)},o._onSBUpdateError=function(r,n){O.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(n)},o.removeExecutor=function(r,n,t){var v=this.media,c=this.mediaSource,p=this.operationQueue,b=this.sourceBuffer,y=b[r];if(!v||!c||!y){O.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(r);return}var d=Object(N.isFiniteNumber)(v.duration)?v.duration:Infinity,f=Object(N.isFiniteNumber)(c.duration)?c.duration:Infinity,m=Math.max(0,n),h=Math.min(t,d,f);h>m?(O.logger.log("[buffer-controller]: Removing ["+m+","+h+"] from the "+r+" SourceBuffer"),console.assert(!y.updating,r+" sourceBuffer must not be updating"),y.remove(m,h)):p.shiftAndExecuteNext(r)},o.appendExecutor=function(r,n){var t=this.operationQueue,v=this.sourceBuffer,c=v[n];if(!c){O.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(n);return}c.ended=!1,console.assert(!c.updating,n+" sourceBuffer must not be updating"),c.appendBuffer(r)},o.blockBuffers=function(r,n){var t=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var v=this.operationQueue,c=n.map(function(p){return v.appendBlocker(p)});Promise.all(c).then(function(){r(),n.forEach(function(p){var b=t.sourceBuffer[p];(!b||!b.updating)&&v.shiftAndExecuteNext(p)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(r,n,t){var v=this.sourceBuffer[r];if(!v)return;var c=t.bind(this,r);this.listeners[r].push({event:n,listener:c}),v.addEventListener(n,c)},o.removeBufferListeners=function(r){var n=this.sourceBuffer[r];if(!n)return;this.listeners[r].forEach(function(t){n.removeEventListener(t.event,t.listener)})},i}()},"./src/controller/buffer-operation-queue.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return S});var N=R("./src/utils/logger.ts"),S=function(){function O(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var F=O.prototype;return F.append=function(e,w){var g=this.queues[w];g.push(e),g.length===1&&this.buffers[w]&&this.executeNext(w)},F.insertAbort=function(e,w){var g=this.queues[w];g.unshift(e),this.executeNext(w)},F.appendBlocker=function(e){var w,g=new Promise(function(l){w=l}),u={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(u,e),g},F.executeNext=function(e){var w=this.buffers,g=this.queues,u=w[e],l=g[e];if(l.length){var s=l[0];try{s.execute()}catch(i){N.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(i),(!u||!u.updating)&&(l.shift(),this.executeNext(e))}}},F.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},F.current=function(e){return this.queues[e][0]},O}()},"./src/controller/cap-level-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts");function S(B,e){for(var w=0;w<e.length;w++){var g=e[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(B,g.key,g)}}function O(B,e,w){return e&&S(B.prototype,e),w&&S(B,w),B}var F=function(){function B(w){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=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=B.prototype;return e.setStreamController=function(g){this.streamController=g},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 g=this.hls;g.on(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,u){B.isLevelAllowed(u.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(u.droppedLevel)},e.onMediaAttaching=function(g,u){this.media=u.media instanceof HTMLVideoElement?u.media:null},e.onManifestParsed=function(g,u){var l=this.hls;this.restrictedLevels=[],this.firstLevel=u.firstLevel,l.config.capLevelToPlayerSize&&u.video&&this.startCapping()},e.onBufferCodecs=function(g,u){var l=this.hls;l.config.capLevelToPlayerSize&&u.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var u=this.hls;u.autoLevelCapping=this.getMaxLevel(g.length-1),u.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=u.autoLevelCapping}}},e.getMaxLevel=function(g){var u=this,l=this.hls.levels;if(!l.length)return-1;var s=l.filter(function(i,o){return B.isLevelAllowed(o,u.restrictedLevels)&&o<=g});return this.clientRect=null,B.getMaxLevelByMediaSize(s,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 g=this.media,u={width:0,height:0};if(g){var l=g.getBoundingClientRect();u.width=l.width,u.height=l.height,!u.width&&!u.height&&(u.width=l.right-l.left||g.width||0,u.height=l.bottom-l.top||g.height||0)}return this.clientRect=u,u},B.isLevelAllowed=function(g,u){return u===void 0&&(u=[]),u.indexOf(g)===-1},B.getMaxLevelByMediaSize=function(g,u,l){if(!g||!g.length)return-1;for(var s=function(n,t){return t?n.width!==t.width||n.height!==t.height:!0},i=g.length-1,o=0;o<g.length;o+=1){var a=g[o];if((a.width>=u||a.height>=l)&&s(a,g[o+1])){i=o;break}}return i},O(B,[{key:"mediaWidth",get:function(){return this.getDimensions().width*B.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*B.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(u){}return g}}]),B}();W.default=F},"./src/controller/cmcd-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s});var N=R("./src/events.ts"),S=R("./src/types/cmcd.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/utils/logger.ts");function B(i,o){for(var a=0;a<o.length;a++){var r=o[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function e(i,o,a){return o&&B(i.prototype,o),a&&B(i,a),i}function w(i,o){var a=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(a)return(a=a.call(i)).next.bind(a);if(Array.isArray(i)||(a=g(i))||o&&i&&typeof i.length=="number"){a&&(i=a);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[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 g(i,o){if(!i)return;if(typeof i=="string")return u(i,o);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(i);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return u(i,o)}function u(i,o){(o==null||o>i.length)&&(o=i.length);for(var a=0,r=new Array(o);a<o;a++)r[a]=i[a];return r}function l(){return l=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var a=arguments[o];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i[r]=a[r])}return i},l.apply(this,arguments)}var s=function(){function i(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(v){try{r.apply(v,{ot:S.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(c){F.logger.warn("Could not generate manifest CMCD data.",c)}},this.applyFragmentData=function(v){try{var c=v.frag,p=r.hls.levels[c.level],b=r.getObjectType(c),y={d:c.duration*1e3,ot:b};(b===S.CMCDObjectType.VIDEO||b===S.CMCDObjectType.AUDIO||b==S.CMCDObjectType.MUXED)&&(y.br=p.bitrate/1e3,y.tb=r.getTopBandwidth(b),y.bl=r.getBufferLength(b)),r.apply(v,y)}catch(d){F.logger.warn("Could not generate segment CMCD data.",d)}},this.hls=a;var n=this.config=a.config,t=n.cmcd;t!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||i.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var o=i.prototype;return o.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.onBufferCreated=function(r,n){var t,v;this.audioBuffer=(t=n.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(v=n.tracks.video)===null||v===void 0?void 0:v.buffer},o.createData=function(){var r;return{v:S.CMCDVersion,sf:S.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}},o.apply=function(r,n){n===void 0&&(n={}),l(n,this.createData());var t=n.ot===S.CMCDObjectType.INIT||n.ot===S.CMCDObjectType.VIDEO||n.ot===S.CMCDObjectType.MUXED;if(this.starved&&t&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var v=i.toHeaders(n);if(!Object.keys(v).length)return;r.headers||(r.headers={}),l(r.headers,v)}else{var c=i.toQuery(n);if(!c)return;r.url=i.appendQueryToUri(r.url,c)}},o.getObjectType=function(r){var n=r.type;return n==="subtitle"?S.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?S.CMCDObjectType.INIT:n==="audio"?S.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?S.CMCDObjectType.VIDEO:S.CMCDObjectType.MUXED:void 0},o.getTopBandwidth=function(r){for(var n=0,t=r===S.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=w(t),c;!(c=v()).done;){var p=c.value;p.bitrate>n&&(n=p.bitrate)}return n>0?n:NaN},o.getBufferLength=function(r){var n=this.hls.media,t=r===S.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!n)return NaN;var v=O.BufferHelper.bufferInfo(t,n.currentTime,this.config.maxBufferHole);return v.len*1e3},o.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,t=r||this.config.loader;return function(){function v(p){this.loader=void 0,this.loader=new t(p)}var c=v.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(b,y,d){n(b),this.loader.load(b,y,d)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},o.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,t=r||this.config.loader;return function(){function v(p){this.loader=void 0,this.loader=new t(p)}var c=v.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(b,y,d){n(b),this.loader.load(b,y,d)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},i.uuid=function(){var r=URL.createObjectURL(new Blob),n=r.toString();return URL.revokeObjectURL(r),n.substr(n.lastIndexOf("/")+1)},i.serialize=function(r){for(var n=[],t=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},v=function(D){return Math.round(D)},c=function(D){return v(D/100)*100},p=function(D){return encodeURIComponent(D)},b={br:v,d:v,bl:c,dl:c,mtp:c,nor:p,rtp:c,tb:v},y=Object.keys(r||{}).sort(),d=w(y),f;!(f=d()).done;){var m=f.value,h=r[m];if(!t(h))continue;if(m==="v"&&h===1)continue;if(m=="pr"&&h===1)continue;var E=b[m];E&&(h=E(h));var _=typeof h,T=void 0;m==="ot"||m==="sf"||m==="st"?T=m+"="+h:_==="boolean"?T=m:_==="number"?T=m+"="+h:T=m+"="+JSON.stringify(h),n.push(T)}return n.join(",")},i.toHeaders=function(r){for(var n=Object.keys(r),t={},v=["Object","Request","Session","Status"],c=[{},{},{},{}],p={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},b=0,y=n;b<y.length;b++){var d=y[b],f=p[d]!=null?p[d]:1;c[f][d]=r[d]}for(var m=0;m<c.length;m++){var h=i.serialize(c[m]);h&&(t["CMCD-"+v[m]]=h)}return t},i.toQuery=function(r){return"CMCD="+encodeURIComponent(i.serialize(r))},i.appendQueryToUri=function(r,n){if(!n)return r;var t=r.includes("?")?"&":"?";return""+r+t+n},i}()},"./src/controller/eme-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=R("./src/utils/mediakeys-helper.ts");function B(s,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function e(s,i,o){return i&&B(s.prototype,i),o&&B(s,o),s}var w=3,g=function(i,o,a){var r={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(n){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:a.audioRobustness||""})}),o.forEach(function(n){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:a.videoRobustness||""})}),[r]},u=function(i,o,a,r){switch(i){case F.KeySystems.WIDEVINE:return g(o,a,r);default:throw new Error("Unknown key-system: "+i)}},l=function(){function s(o){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=o,this._config=o.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 i=s.prototype;return i.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},i._registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(a){switch(a){case F.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},i._attemptKeySystemAccess=function(a,r,n){var t=this,v=u(a,r,n,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var c=this.requestMediaKeySystemAccess(a,v);this.mediaKeysPromise=c.then(function(p){return t._onMediaKeySystemAccessObtained(a,p)}),c.catch(function(p){O.logger.error('Failed to obtain key-system "'+a+'" access:',p)})},i._onMediaKeySystemAccessObtained=function(a,r){var n=this;O.logger.log('Access for key-system "'+a+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:a};this._mediaKeysList.push(t);var v=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(c){return t.mediaKeys=c,O.logger.log('Media-keys created for key-system "'+a+'"'),n._onMediaKeysCreated(),c});return v.catch(function(c){O.logger.error("Failed to create media-keys:",c)}),v},i._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),a._onNewMediaKeySession(r.mediaKeysSession))})},i._onNewMediaKeySession=function(a){var r=this;O.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(n){r._onKeySessionMessage(a,n.message)},!1)},i._onKeySessionMessage=function(a,r){O.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(n){O.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),a.update(n)})},i.onMediaEncrypted=function(a){var r=this;if(O.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(v){if(!r._media)return;r._attemptSetMediaKeys(v),r._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(n).catch(n)},i._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){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},i._generateRequestWithPreferredKeySession=function(a,r){var n=this,t=this._mediaKeysList[0];if(!t){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var v=t.mediaKeysSession;if(!v){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+a+'" init data type'),t.mediaKeysSessionInitialized=!0,v.generateRequest(a,r).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(c){O.logger.error("Error generating key-session request:",c),n.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},i._createLicenseXhr=function(a,r,n){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,a,r,n);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,t,a),v=void 0}catch(c){O.logger.error(c)}try{t.readyState||t.open("POST",a,!0),v&&v.call(this.hls,t,a)}catch(c){throw new Error("issue setting up KeySystem license XHR "+c)}return t},i._onLicenseRequestReadyStageChange=function(a,r,n,t){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var v=a.response,c=this._licenseResponseCallback;if(c)try{v=c.call(this.hls,a,r)}catch(b){O.logger.error(b)}t(v)}else{if(O.logger.error("License Request XHR failed ("+r+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=w-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(n,t)}break}},i._generateLicenseRequestChallenge=function(a,r){switch(a.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},i._requestLicense=function(a,r){O.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(n.mediaKeySystemDomain),v=this._createLicenseXhr(t,a,r);O.logger.log("Sending license request to URL: "+t);var c=this._generateLicenseRequestChallenge(n,a);v.send(c)}catch(p){O.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(a,r){if(!this._emeEnabled)return;var n=r.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},i.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(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},i.onManifestParsed=function(a,r){if(!this._emeEnabled)return;var n=r.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),t=r.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,n,t)},e(s,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),s}();W.default=l},"./src/controller/fps-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/logger.ts"),O=function(){function F(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 B=F.prototype;return B.setStreamController=function(w){this.streamController=w},B.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching)},B.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},B.onMediaAttaching=function(w,g){var u=this.hls.config;if(u.capLevelOnFPSDrop){var l=g.media instanceof self.HTMLVideoElement?g.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),u.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(w,g,u){var l=performance.now();if(g){if(this.lastTime){var s=l-this.lastTime,i=u-this.lastDroppedFrames,o=g-this.lastDecodedFrames,a=1e3*i/s,r=this.hls;if(r.trigger(N.Events.FPS_DROP,{currentDropped:i,currentDecoded:o,totalDroppedFrames:u}),a>0&&i>r.config.fpsDroppedMonitoringThreshold*o){var n=r.currentLevel;S.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=n)&&(n=n-1,r.trigger(N.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=l,this.lastDroppedFrames=u,this.lastDecodedFrames=g}},B.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var g=w.getVideoPlaybackQuality();this.checkFPS(w,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},F}();W.default=O},"./src/controller/fragment-finders.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"findFragmentByPDT",function(){return O}),R.d(W,"findFragmentByPTS",function(){return F}),R.d(W,"fragmentWithinToleranceTest",function(){return B}),R.d(W,"pdtWithinToleranceTest",function(){return e}),R.d(W,"findFragWithCC",function(){return w});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/binary-search.ts");function O(g,u,l){if(u===null||!Array.isArray(g)||!g.length||!Object(N.isFiniteNumber)(u))return null;var s=g[0].programDateTime;if(u<(s||0))return null;var i=g[g.length-1].endProgramDateTime;if(u>=(i||0))return null;l=l||0;for(var o=0;o<g.length;++o){var a=g[o];if(e(u,l,a))return a}return null}function F(g,u,l,s){l===void 0&&(l=0),s===void 0&&(s=0);var i=null;if(g?i=u[g.sn-u[0].sn+1]||null:l===0&&u[0].start===0&&(i=u[0]),i&&B(l,s,i)===0)return i;var o=S.default.search(u,B.bind(null,l,s));return o||i}function B(g,u,l){g===void 0&&(g=0),u===void 0&&(u=0);var s=Math.min(u,l.duration+(l.deltaPTS?l.deltaPTS:0));return l.start+l.duration-s<=g?1:l.start-s>g&&l.start?-1:0}function e(g,u,l){var s=Math.min(u,l.duration+(l.deltaPTS?l.deltaPTS:0))*1e3,i=l.endProgramDateTime||0;return i-s>g}function w(g,u){return S.default.search(g,function(l){return l.cc<u?1:l.cc>u?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"FragmentState",function(){return O}),R.d(W,"FragmentTracker",function(){return F});var N=R("./src/events.ts"),S=R("./src/types/loader.ts"),O;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(O||(O={}));var F=function(){function w(u){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=u,this._registerListeners()}var g=w.prototype;return g._registerListeners=function(){var l=this.hls;l.on(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(N.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var l=this.hls;l.off(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(N.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(l,s){if(s===S.PlaylistLevelType.MAIN){var i=this.activeFragment,o=this.activeParts;if(!i)return null;if(o)for(var a=o.length;a--;){var r=o[a],n=r?r.end:i.appendedPTS;if(r.start<=l&&n!==void 0&&l<=n)return a>9&&(this.activeParts=o.slice(a-9)),r}else if(i.start<=l&&i.appendedPTS!==void 0&&l<=i.appendedPTS)return i}return this.getBufferedFrag(l,s)},g.getBufferedFrag=function(l,s){for(var i=this.fragments,o=Object.keys(i),a=o.length;a--;){var r=i[o[a]];if((r==null?void 0:r.body.type)===s&&r.buffered){var n=r.body;if(n.start<=l&&l<=n.end)return n}}return null},g.detectEvictedFragments=function(l,s,i){var o=this;Object.keys(this.fragments).forEach(function(a){var r=o.fragments[a];if(!r)return;if(!r.buffered){r.body.type===i&&o.removeFragment(r.body);return}var n=r.range[l];if(!n)return;n.time.some(function(t){var v=!o.isTimeBuffered(t.startPTS,t.endPTS,s);return v&&o.removeFragment(r.body),v})})},g.detectPartialFragments=function(l){var s=this,i=this.timeRanges,o=l.frag,a=l.part;if(!i||o.sn==="initSegment")return;var r=e(o),n=this.fragments[r];if(!n)return;Object.keys(i).forEach(function(t){var v=o.elementaryStreams[t];if(!v)return;var c=i[t],p=a!==null||v.partial===!0;n.range[t]=s.getBufferedTimes(o,a,p,c)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},g.fragBuffered=function(l){var s=e(l),i=this.fragments[s];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},g.getBufferedTimes=function(l,s,i,o){for(var a={time:[],partial:i},r=s?s.start:l.start,n=s?s.end:l.end,t=l.minEndPTS||n,v=l.maxStartPTS||r,c=0;c<o.length;c++){var p=o.start(c)-this.bufferPadding,b=o.end(c)+this.bufferPadding;if(v>=p&&t<=b){a.time.push({startPTS:Math.max(r,o.start(c)),endPTS:Math.min(n,o.end(c))});break}else if(r<b&&n>p)a.partial=!0,a.time.push({startPTS:Math.max(r,o.start(c)),endPTS:Math.min(n,o.end(c))});else if(n<=p)break}return a},g.getPartialFragment=function(l){var s=null,i,o,a,r=0,n=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(v){var c=t[v];if(!c)return;B(c)&&(o=c.body.start-n,a=c.body.end+n,l>=o&&l<=a&&(i=Math.min(l-o,a-l),r<=i&&(s=c.body,r=i)))}),s},g.getState=function(l){var s=e(l),i=this.fragments[s];return i?i.buffered?B(i)?O.PARTIAL:O.OK:i.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(l,s){var i=e(l),o=this.fragments[i];if(!o||o.backtrack)return null;var a=o.backtrack=s||o.loaded;return o.loaded=null,a},g.getBacktrackData=function(l){var s=e(l),i=this.fragments[s];if(i){var o,a=i.backtrack;if(a!=null&&(o=a.payload)!==null&&o!==void 0&&o.byteLength)return a;this.removeFragment(l)}return null},g.isTimeBuffered=function(l,s,i){for(var o,a,r=0;r<i.length;r++){if(o=i.start(r)-this.bufferPadding,a=i.end(r)+this.bufferPadding,l>=o&&s<=a)return!0;if(s<=o)return!1}return!1},g.onFragLoaded=function(l,s){var i=s.frag,o=s.part;if(i.sn==="initSegment"||i.bitrateTest||o)return;var a=e(i);this.fragments[a]={body:i,loaded:s,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(l,s){var i=this,o=s.frag,a=s.part,r=s.timeRanges;if(o.type===S.PlaylistLevelType.MAIN)if(this.activeFragment=o,a){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(a)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var v=r[t];if(i.detectEvictedFragments(t,v),!a)for(var c=0;c<v.length;c++)o.appendedPTS=Math.max(v.end(c),o.appendedPTS||0)})},g.onFragBuffered=function(l,s){this.detectPartialFragments(s)},g.hasFragment=function(l){var s=e(l);return!!this.fragments[s]},g.removeFragmentsInRange=function(l,s,i){var o=this;Object.keys(this.fragments).forEach(function(a){var r=o.fragments[a];if(!r)return;if(r.buffered){var n=r.body;n.type===i&&n.start<s&&n.end>l&&o.removeFragment(n)}})},g.removeFragment=function(l){var s=e(l);l.stats.loaded=0,l.clearElementaryStreamInfo(),delete this.fragments[s]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function B(w){var g,u;return w.buffered&&(((g=w.range.video)===null||g===void 0?void 0:g.partial)||((u=w.range.audio)===null||u===void 0?void 0:u.partial))}function e(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"STALL_MINIMUM_DURATION_MS",function(){return B}),R.d(W,"MAX_START_GAP_JUMP",function(){return e}),R.d(W,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),R.d(W,"SKIP_BUFFER_RANGE_START",function(){return g}),R.d(W,"default",function(){return u});var N=R("./src/utils/buffer-helper.ts"),S=R("./src/errors.ts"),O=R("./src/events.ts"),F=R("./src/utils/logger.ts"),B=250,e=2,w=.1,g=.05,u=function(){function l(i,o,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=i,this.media=o,this.fragmentTracker=a,this.hls=r}var s=l.prototype;return s.destroy=function(){this.hls=this.fragmentTracker=this.media=null},s.poll=function(o){var a=this.config,r=this.media,n=this.stalled,t=r.currentTime,v=r.seeking,c=this.seeking&&!v,p=!this.seeking&&v;if(this.seeking=v,t!==o){if(this.moved=!0,n!==null){if(this.stallReported){var b=self.performance.now()-n;F.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(b)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||c)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!N.BufferHelper.getBuffered(r).length)return;var y=N.BufferHelper.bufferInfo(r,t,0),d=y.len>0,f=y.nextStart||0;if(!d&&!f)return;if(v){var m=y.len>e,h=!f||f-t>e&&!this.fragmentTracker.getPartialFragment(t);if(m||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,_=Math.max(f,y.start||0)-t,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,k=T==null||((E=T.details)===null||E===void 0)?void 0:E.live,D=k?T.details.targetduration*2:e;if(_>0&&_<=D){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(n===null){this.stalled=x;return}var P=x-n;!v&&P>=B&&this._reportStall(y.len);var H=N.BufferHelper.bufferInfo(r,t,a.maxBufferHole);this._tryFixBufferStall(H,P)},s._tryFixBufferStall=function(o,a){var r=this.config,n=this.fragmentTracker,t=this.media,v=t.currentTime,c=n.getPartialFragment(v);if(c){var p=this._trySkipBufferHole(c);if(p)return}o.len>r.maxBufferHole&&a>r.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},s._reportStall=function(o){var a=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+o+")"),a.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},s._trySkipBufferHole=function(o){for(var a=this.config,r=this.hls,n=this.media,t=n.currentTime,v=0,c=N.BufferHelper.getBuffered(n),p=0;p<c.length;p++){var b=c.start(p);if(t+a.maxBufferHole>=v&&t<b){var y=Math.max(b+g,n.currentTime+w);return F.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+y),this.moved=!0,this.stalled=null,n.currentTime=y,o&&r.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+y,frag:o}),y}v=c.end(p)}return 0},s._tryNudgeBuffer=function(){var o=this.config,a=this.hls,r=this.media,n=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<o.nudgeMaxRetry){var v=n+t*o.nudgeOffset;F.logger.warn("Nudging 'currentTime' from "+n+" to "+v),r.currentTime=v,a.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else F.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+o.nudgeMaxRetry+" nudges"),a.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},l}()},"./src/controller/id3-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/texttrack-utils.ts"),O=R("./src/demux/id3.ts"),F=.25,B=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var w=e.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var u=this.hls;u.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),u.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var u=this.hls;u.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),u.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(u,l){this.media=l.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(S.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(u){if(!this.media)return;for(var l=0;l<u.length;l++){var s=u[l];if(s.kind==="metadata"&&s.label==="id3")return Object(S.sendAddTrackEvent)(s,this.media),s}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(u,l){if(!this.media)return;var s=l.frag,i=l.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<i.length;a++){var r=O.getID3Frames(i[a].data);if(r){var n=i[a].pts,t=a<i.length-1?i[a+1].pts:s.end,v=t-n;v<=0&&(t=n+F);for(var c=0;c<r.length;c++){var p=r[c];if(!O.isTimeStampFrame(p)){var b=new o(n,t,"");b.value=p,this.id3Track.addCue(b)}}}}},w.onBufferFlushing=function(u,l){var s=l.startOffset,i=l.endOffset,o=l.type;if(!o||o==="audio"){var a=this.id3Track;a&&Object(S.removeCuesInRange)(a,s,i)}},e}();W.default=B},"./src/controller/latency-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/errors.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts");function F(w,g){for(var u=0;u<g.length;u++){var l=g[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(w,l.key,l)}}function B(w,g,u){return g&&F(w.prototype,g),u&&F(w,u),w}var e=function(){function w(u){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=u,this.config=u.config,this.registerListeners()}var g=w.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(S.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(S.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(S.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(S.Events.ERROR,this.onError)},g.onMediaAttached=function(l,s){this.media=s.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(l,s){var i=s.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(l,s){if(s.details!==N.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var l=this.media,s=this.levelDetails;if(!l||!s)return;this.currentTime=l.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var o=this.config,a=o.lowLatencyMode,r=o.maxLiveSyncPlaybackRate;if(!a||r===1)return;var n=this.targetLatency;if(n===null)return;var t=i-n,v=Math.min(this.maxLatency,n+s.targetduration),c=t<v;if(s.live&&c&&t>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,r)),b=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;l.playbackRate=Math.min(p,Math.max(1,b))}else l.playbackRate!==1&&l.playbackRate!==0&&(l.playbackRate=1)},g.estimateLiveEdge=function(){var l=this.levelDetails;return l===null?null:l.edge+l.age},g.computeLatency=function(){var l=this.estimateLiveEdge();return l===null?null:l-this.currentTime},B(w,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var l=this.config,s=this.levelDetails;return l.liveMaxLatencyDuration!==void 0?l.liveMaxLatencyDuration:s?l.liveMaxLatencyDurationCount*s.targetduration:0}},{key:"targetLatency",get:function(){var l=this.levelDetails;if(l===null)return null;var s=l.holdBack,i=l.partHoldBack,o=l.targetduration,a=this.config,r=a.liveSyncDuration,n=a.liveSyncDurationCount,t=a.lowLatencyMode,v=this.hls.userConfig,c=t&&i||s;(v.liveSyncDuration||v.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*o);var p=o,b=1;return c+Math.min(this.stallCount*b,p)}},{key:"liveSyncPosition",get:function(){var l=this.estimateLiveEdge(),s=this.targetLatency,i=this.levelDetails;if(l===null||s===null||i===null)return null;var o=i.edge,a=l-s-this.edgeStalled,r=o-i.totalduration,n=o-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(r,a),n)}},{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 s=(this.config.lowLatencyMode&&l.partTarget||l.targetduration)*3;return Math.max(l.age-s,0)}},{key:"forwardBufferLength",get:function(){var l=this.media,s=this.levelDetails;if(!l||!s)return 0;var i=l.buffered.length;return i?l.buffered.end(i-1):s.edge-this.currentTime}}]),w}()},"./src/controller/level-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return a});var N=R("./src/types/level.ts"),S=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/codecs.ts"),B=R("./src/controller/level-helper.ts"),e=R("./src/controller/base-playlist-controller.ts"),w=R("./src/types/loader.ts");function g(){return g=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(r[v]=t[v])}return r},g.apply(this,arguments)}function u(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function l(r,n,t){return n&&u(r.prototype,n),t&&u(r,t),r}function s(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,i(r,n)}function i(r,n){return i=Object.setPrototypeOf||function(v,c){return v.__proto__=c,v},i(r,n)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(r){s(n,r);function n(v){var c;return c=r.call(this,v,"[level-controller]")||this,c._levels=[],c._firstLevel=-1,c._startLevel=void 0,c.currentLevelIndex=-1,c.manualLevelIndex=-1,c.onParsedComplete=void 0,c._registerListeners(),c}var t=n.prototype;return t._registerListeners=function(){var c=this.hls;c.on(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(S.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var c=this.hls;c.off(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(S.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 c=this._levels;c.forEach(function(p){p.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(c,p){var b=[],y=[],d=[],f,m={},h,E=!1,_=!1,T=!1;if(p.levels.forEach(function(P){var H=P.attrs;E=E||!!(P.width&&P.height),_=_||!!P.videoCodec,T=T||!!P.audioCodec,o&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var I=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;h=m[I],h?h.url.push(P.url):(h=new N.Level(P),m[I]=h,b.push(h)),H&&(H.AUDIO&&Object(B.addGroupId)(h,"audio",H.AUDIO),H.SUBTITLES&&Object(B.addGroupId)(h,"text",H.SUBTITLES))}),(E||_)&&T&&(b=b.filter(function(P){var H=P.videoCodec,I=P.width,V=P.height;return!!H||!!(I&&V)})),b=b.filter(function(P){var H=P.audioCodec,I=P.videoCodec;return(!H||Object(F.isCodecSupportedInMp4)(H,"audio"))&&(!I||Object(F.isCodecSupportedInMp4)(I,"video"))}),p.audioTracks&&(y=p.audioTracks.filter(function(P){return!P.audioCodec||Object(F.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(B.assignTrackIdsByGroup)(y)),p.subtitles&&(d=p.subtitles,Object(B.assignTrackIdsByGroup)(d)),b.length>0){f=b[0].bitrate,b.sort(function(P,H){return P.bitrate-H.bitrate}),this._levels=b;for(var k=0;k<b.length;k++)if(b[k].bitrate===f){this._firstLevel=k,this.log("manifest loaded, "+b.length+" level(s) found, first bitrate: "+f);break}var D=T&&!_,x={levels:b,audioTracks:y,subtitleTracks:d,firstLevel:this._firstLevel,stats:p.stats,audio:T,video:_,altAudio:!D&&y.some(function(P){return!!P.url})};this.hls.trigger(S.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(c,p){if(r.prototype.onError.call(this,c,p),p.fatal)return;var b=p.context,y=this._levels[this.currentLevelIndex];if(b&&(b.type===w.PlaylistContextType.AUDIO_TRACK&&y.audioGroupIds&&b.groupId===y.audioGroupIds[y.urlId]||b.type===w.PlaylistContextType.SUBTITLE_TRACK&&y.textGroupIds&&b.groupId===y.textGroupIds[y.urlId])){this.redundantFailover(this.currentLevelIndex);return}var d=!1,f=!0,m;switch(p.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:if(p.frag){var h=this._levels[p.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(m=p.frag.level)):m=p.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:b&&(b.deliveryDirectives&&(f=!1),m=b.level),d=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:m=p.level,d=!0;break}m!==void 0&&this.recoverLevel(p,m,d,f)},t.recoverLevel=function(c,p,b,y){var d=c.details,f=this._levels[p];if(f.loadError++,b){var m=this.retryLoadingOrFail(c);if(m)c.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(y){var h=f.url.length;if(h>1&&f.loadError<h)c.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var E=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(d+": switch to "+E),c.levelRetry=!0,this.hls.nextAutoLevel=E)}}},t.redundantFailover=function(c){var p=this._levels[c],b=p.url.length;if(b>1){var y=(p.urlId+1)%b;this.warn("Switching to redundant URL-id "+y),this._levels.forEach(function(d){d.urlId=y}),this.level=c}},t.onFragLoaded=function(c,p){var b=p.frag;if(b!==void 0&&b.type===w.PlaylistLevelType.MAIN){var y=this._levels[b.level];y!==void 0&&(y.fragmentError=0,y.loadError=0)}},t.onLevelLoaded=function(c,p){var b,y=p.level,d=p.details,f=this._levels[y];if(!f){var m;this.warn("Invalid level index "+y),(m=p.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(d.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(f.fragmentError===0&&(f.loadError=0,this.retryCount=0),this.playlistLoaded(y,p,f.details)):(b=p.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(d.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(c,p){var b=this.hls.levels[this.currentLevelIndex];if(!b)return;if(b.audioGroupIds){for(var y=-1,d=this.hls.audioTracks[p.id].groupId,f=0;f<b.audioGroupIds.length;f++)if(b.audioGroupIds[f]===d){y=f;break}y!==b.urlId&&(b.urlId=y,this.startLoad())}},t.loadPlaylist=function(c){var p=this.currentLevelIndex,b=this._levels[p];if(this.canLoad&&b&&b.url.length>0){var y=b.urlId,d=b.url[y];if(c)try{d=c.addDirectives(d)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Attempt loading level index "+p+(c?" at sn "+c.msn+" part "+c.part:"")+" with URL-id "+y+" "+d),this.clearTimer(),this.hls.trigger(S.Events.LEVEL_LOADING,{url:d,level:p,id:y,deliveryDirectives:c||null})}},t.removeLevel=function(c,p){var b=function(f,m){return m!==p},y=this._levels.filter(function(d,f){return f!==c?!0:d.url.length>1&&p!==void 0?(d.url=d.url.filter(b),d.audioGroupIds&&(d.audioGroupIds=d.audioGroupIds.filter(b)),d.textGroupIds&&(d.textGroupIds=d.textGroupIds.filter(b)),d.urlId=0,!0):!1}).map(function(d,f){var m=d.details;return m!=null&&m.fragments&&m.fragments.forEach(function(h){h.level=f}),d});this._levels=y,this.hls.trigger(S.Events.LEVELS_UPDATED,{levels:y})},l(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(c){var p,b=this._levels;if(b.length===0)return;if(this.currentLevelIndex===c&&(p=b[c])!==null&&p!==void 0&&p.details)return;if(c<0||c>=b.length){var y=c<0;if(this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:c,fatal:y,reason:"invalid level idx"}),y)return;c=Math.min(c,b.length-1)}this.clearTimer();var d=this.currentLevelIndex,f=b[d],m=b[c];this.log("switching to level "+c+" from "+d),this.currentLevelIndex=c;var h=g({},m,{level:c,maxBitrate:m.maxBitrate,uri:m.uri,urlId:m.urlId});delete h._urlId,this.hls.trigger(S.Events.LEVEL_SWITCHING,h);var E=m.details;if(!E||E.live){var _=this.switchParams(m.uri,f==null?void 0:f.details);this.loadPlaylist(_)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(c){this.manualLevelIndex=c,this._startLevel===void 0&&(this._startLevel=c),c!==-1&&(this.level=c)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(c){this._firstLevel=c}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var c=this.hls.config.startLevel;return c!==void 0?c:this._firstLevel}else return this._startLevel},set:function(c){this._startLevel=c}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(c){this.level=c,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=c)}}]),n}(e.default)},"./src/controller/level-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"addGroupId",function(){return O}),R.d(W,"assignTrackIdsByGroup",function(){return F}),R.d(W,"updatePTS",function(){return B}),R.d(W,"updateFragPTSDTS",function(){return w}),R.d(W,"mergeDetails",function(){return g}),R.d(W,"mapPartIntersection",function(){return u}),R.d(W,"mapFragmentIntersection",function(){return l}),R.d(W,"adjustSliding",function(){return s}),R.d(W,"addSliding",function(){return i}),R.d(W,"computeReloadInterval",function(){return o}),R.d(W,"getFragmentWithSN",function(){return a}),R.d(W,"getPartWith",function(){return r});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/logger.ts");function O(n,t,v){switch(t){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(v);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(v);break}}function F(n){var t={};n.forEach(function(v){var c=v.groupId||"";v.id=t[c]=t[c]||0,t[c]++})}function B(n,t,v){var c=n[t],p=n[v];e(c,p)}function e(n,t){var v=t.startPTS;if(Object(N.isFiniteNumber)(v)){var c=0,p;t.sn>n.sn?(c=v-n.start,p=n):(c=n.start-v,p=t),p.duration!==c&&(p.duration=c)}else if(t.sn>n.sn){var b=n.cc===t.cc;b&&n.minEndPTS?t.start=n.start+(n.minEndPTS-n.start):t.start=n.start+n.duration}else t.start=Math.max(n.start-t.duration,0)}function w(n,t,v,c,p,b){var y=c-v;y<=0&&(S.logger.warn("Fragment should have a positive duration",t),c=v+t.duration,b=p+t.duration);var d=v,f=c,m=t.startPTS,h=t.endPTS;if(Object(N.isFiniteNumber)(m)){var E=Math.abs(m-v);Object(N.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(E,t.deltaPTS):t.deltaPTS=E,d=Math.max(v,m),v=Math.min(v,m),p=Math.min(p,t.startDTS),f=Math.min(c,h),c=Math.max(c,h),b=Math.max(b,t.endDTS)}t.duration=c-v;var _=v-t.start;t.appendedPTS=c,t.start=t.startPTS=v,t.maxStartPTS=d,t.startDTS=p,t.endPTS=c,t.minEndPTS=f,t.endDTS=b;var T=t.sn;if(!n||T<n.startSN||T>n.endSN)return 0;var k,D=T-n.startSN,x=n.fragments;for(x[D]=t,k=D;k>0;k--)e(x[k],x[k-1]);for(k=D;k<x.length-1;k++)e(x[k],x[k+1]);return n.fragmentHint&&e(x[x.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,_}function g(n,t){for(var v=null,c=n.fragments,p=c.length-1;p>=0;p--){var b=c[p].initSegment;if(b){v=b;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var y=0,d;if(l(n,t,function(k,D){k.relurl&&(y=k.cc-D.cc),Object(N.isFiniteNumber)(k.startPTS)&&Object(N.isFiniteNumber)(k.endPTS)&&(D.start=D.startPTS=k.startPTS,D.startDTS=k.startDTS,D.appendedPTS=k.appendedPTS,D.maxStartPTS=k.maxStartPTS,D.endPTS=k.endPTS,D.endDTS=k.endDTS,D.minEndPTS=k.minEndPTS,D.duration=k.endPTS-k.startPTS,D.duration&&(d=D),t.PTSKnown=t.alignedSliding=!0),D.elementaryStreams=k.elementaryStreams,D.loader=k.loader,D.stats=k.stats,D.urlId=k.urlId,k.initSegment&&(D.initSegment=k.initSegment,v=k.initSegment)}),v){var f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;f.forEach(function(k){var D;(!k.initSegment||k.initSegment.relurl===((D=v)===null||D===void 0?void 0:D.relurl))&&(k.initSegment=v)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(k){return!k}),t.deltaUpdateFailed)){S.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var m=t.skippedSegments;m--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var h=t.fragments;if(y){S.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<h.length;E++)h[E].cc+=y}t.skippedSegments&&(t.startCC=t.fragments[0].cc),u(n.partList,t.partList,function(k,D){D.elementaryStreams=k.elementaryStreams,D.stats=k.stats}),d?w(t,d,d.startPTS,d.endPTS,d.startDTS,d.endDTS):s(n,t),h.length&&(t.totalduration=t.edge-h[0].start),t.driftStartTime=n.driftStartTime,t.driftStart=n.driftStart;var _=t.advancedDateTime;if(t.advanced&&_){var T=t.edge;t.driftStart||(t.driftStartTime=_,t.driftStart=T),t.driftEndTime=_,t.driftEnd=T}else t.driftEndTime=n.driftEndTime,t.driftEnd=n.driftEnd,t.advancedDateTime=n.advancedDateTime}function u(n,t,v){if(n&&t)for(var c=0,p=0,b=n.length;p<=b;p++){var y=n[p],d=t[p+c];y&&d&&y.index===d.index&&y.fragment.sn===d.fragment.sn?v(y,d):c--}}function l(n,t,v){for(var c=t.skippedSegments,p=Math.max(n.startSN,t.startSN)-t.startSN,b=(n.fragmentHint?1:0)+(c?t.endSN:Math.min(n.endSN,t.endSN))-t.startSN,y=t.startSN-n.startSN,d=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,f=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,m=p;m<=b;m++){var h=f[y+m],E=d[m];c&&!E&&m<c&&(E=t.fragments[m]=h),h&&E&&v(h,E)}}function s(n,t){var v=t.startSN+t.skippedSegments-n.startSN,c=n.fragments;if(v<0||v>=c.length)return;i(t,c[v].start)}function i(n,t){if(t){for(var v=n.fragments,c=n.skippedSegments;c<v.length;c++)v[c].start+=t;n.fragmentHint&&(n.fragmentHint.start+=t)}}function o(n,t){var v=1e3*n.levelTargetDuration,c=v/2,p=n.age,b=p>0&&p<v*3,y=t.loading.end-t.loading.start,d,f=n.availabilityDelay;if(n.updated===!1)if(b){var m=333*n.misses;d=Math.max(Math.min(c,y*2),m),n.availabilityDelay=(n.availabilityDelay||0)+d}else d=c;else b?(f=Math.min(f||v/2,p),n.availabilityDelay=f,d=f+v-p):d=v-y;return Math.round(d)}function a(n,t,v){if(!n||!n.details)return null;var c=n.details,p=c.fragments[t-c.startSN];return p||(p=c.fragmentHint,p&&p.sn===t?p:t<c.startSN&&v&&v.sn===t?v:null)}function r(n,t,v){if(!n||!n.details)return null;var c=n.details.partList;if(c)for(var p=c.length;p--;){var b=c[p];if(b.index===v&&b.fragment.sn===t)return b}return null}},"./src/controller/stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return c});var N=R("./src/polyfills/number.ts"),S=R("./src/controller/base-stream-controller.ts"),O=R("./src/is-supported.ts"),F=R("./src/events.ts"),B=R("./src/utils/buffer-helper.ts"),e=R("./src/controller/fragment-tracker.ts"),w=R("./src/types/loader.ts"),g=R("./src/loader/fragment.ts"),u=R("./src/demux/transmuxer-interface.ts"),l=R("./src/types/transmuxer.ts"),s=R("./src/controller/gap-controller.ts"),i=R("./src/errors.ts"),o=R("./src/utils/logger.ts");function a(p,b){for(var y=0;y<b.length;y++){var d=b[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function r(p,b,y){return b&&a(p.prototype,b),y&&a(p,y),p}function n(p,b){p.prototype=Object.create(b.prototype),p.prototype.constructor=p,t(p,b)}function t(p,b){return t=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},t(p,b)}var v=100,c=function(p){n(b,p);function b(d,f){var m;return m=p.call(this,d,f,"[stream-controller]")||this,m.audioCodecSwap=!1,m.gapController=null,m.level=-1,m._forceStartLoad=!1,m.altAudio=!1,m.audioOnly=!1,m.fragPlaying=null,m.onvplaying=null,m.onvseeked=null,m.fragLastKbps=0,m.stalled=!1,m.couldBacktrack=!1,m.audioCodecSwitch=!1,m.videoBuffer=null,m._registerListeners(),m}var y=b.prototype;return y._registerListeners=function(){var f=this.hls;f.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.on(F.Events.ERROR,this.onError,this),f.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var f=this.hls;f.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.off(F.Events.ERROR,this.onError,this),f.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},y.startLoad=function(f){if(this.levels){var m=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=h.startLevel;E===-1&&(h.config.testBandwidth?(E=0,this.bitrateTest=!0):E=h.nextAutoLevel),this.level=h.nextLoadLevel=E,this.loadedmetadata=!1}m>0&&f===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),f=m),this.state=S.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()}else this._forceStartLoad=!0,this.state=S.State.STOPPED},y.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},y.doTick=function(){switch(this.state){case S.State.IDLE:this.doTickIdle();break;case S.State.WAITING_LEVEL:{var f,m=this.levels,h=this.level,E=m==null||((f=m[h])===null||f===void 0)?void 0:f.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=S.State.IDLE;break}break}case S.State.FRAG_LOADING_WAITING_RETRY:{var _,T=self.performance.now(),k=this.retryDate;(!k||T>=k||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=S.State.IDLE)}break;default:break}this.onTickEnd()},y.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},y.doTickIdle=function(){var f,m,h=this.hls,E=this.levelLastLoaded,_=this.levels,T=this.media,k=h.config,D=h.nextLoadLevel;if(E===null||!T&&(this.startFragRequested||!k.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!_||!_[D])return;var x=_[D];this.level=h.nextLoadLevel=D;var P=x.details;if(!P||this.state===S.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==D){this.state=S.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,w.PlaylistLevelType.MAIN);if(H===null)return;var I=H.len,V=this.getMaxBufferLength(x.maxBitrate);if(I>=V)return;if(this._streamEnded(H,P)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,$),this.state=S.State.ENDED;return}var ge=H.end,te=this.getNextFragment(ge,P);if(this.couldBacktrack&&!this.fragPrevious&&te&&te.sn!=="initSegment"){var be=te.sn-P.startSN;be>1&&(te=P.fragments[be-1],this.fragmentTracker.removeFragment(te))}if(te&&this.fragmentTracker.getState(te)===e.FragmentState.OK&&this.nextLoadPosition>ge){var ve=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,ve,w.PlaylistLevelType.MAIN),te=this.getNextFragment(this.nextLoadPosition,P)}if(!te)return;te.initSegment&&!te.initSegment.data&&!this.bitrateTest&&(te=te.initSegment),((f=te.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((m=te.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(te,P):this.loadFragment(te,P,ge)},y.loadFragment=function(f,m,h){var E,_=this.fragmentTracker.getState(f);if(this.fragCurrent=f,_===e.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(f);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else _=e.FragmentState.NOT_LOADED}_===e.FragmentState.NOT_LOADED||_===e.FragmentState.PARTIAL?f.sn==="initSegment"?this._loadInitSegment(f):this.bitrateTest?(f.bitrateTest=!0,this.log("Fragment "+f.sn+" of level "+f.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(f)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,f,m,h)):_===e.FragmentState.APPENDING?this.reduceMaxBufferLength(f.duration)&&this.fragmentTracker.removeFragment(f):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},y.getAppendedFrag=function(f){var m=this.fragmentTracker.getAppendedFrag(f,w.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},y.getBufferedFrag=function(f){return this.fragmentTracker.getBufferedFrag(f,w.PlaylistLevelType.MAIN)},y.followingBufferedFrag=function(f){return f?this.getBufferedFrag(f.end+.5):null},y.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},y.nextLevelSwitch=function(){var f=this.levels,m=this.media;if(m!=null&&m.readyState){var h,E=this.getAppendedFrag(m.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!m.paused&&f){var _=this.hls.nextLoadLevel,T=f[_],k=this.fragLastKbps;k&&this.fragCurrent?h=this.fragCurrent.duration*T.maxBitrate/(1e3*k)+1:h=0}else h=0;var D=this.getBufferedFrag(m.currentTime+h);if(D){var x=this.followingBufferedFrag(D);if(x){this.abortCurrentFrag();var P=x.maxStartPTS?x.maxStartPTS:x.start,H=x.duration,I=Math.max(D.end,P+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},y.abortCurrentFrag=function(){var f=this.fragCurrent;this.fragCurrent=null,f!=null&&f.loader&&f.loader.abort(),this.state===S.State.KEY_LOADING&&(this.state=S.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},y.flushMainBuffer=function(f,m){p.prototype.flushMainBuffer.call(this,f,m,this.altAudio?"video":null)},y.onMediaAttached=function(f,m){p.prototype.onMediaAttached.call(this,f,m);var h=m.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 s.default(this.config,h,this.fragmentTracker,this.hls)},y.onMediaDetaching=function(){var f=this.media;f&&(f.removeEventListener("playing",this.onvplaying),f.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),p.prototype.onMediaDetaching.call(this)},y.onMediaPlaying=function(){this.tick()},y.onMediaSeeked=function(){var f=this.media,m=f?f.currentTime:null;Object(N.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},y.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},y.onManifestParsed=function(f,m){var h=!1,E=!1,_;m.levels.forEach(function(T){_=T.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(h=!0),_.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=h&&E&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=m.levels,this.startFragRequested=!1},y.onLevelLoading=function(f,m){var h=this.levels;if(!h||this.state!==S.State.IDLE)return;var E=h[m.level];(!E.details||E.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(E.details))&&(this.state=S.State.WAITING_LEVEL)},y.onLevelLoaded=function(f,m){var h,E=this.levels,_=m.level,T=m.details,k=T.totalduration;if(!E){this.warn("Levels were reset while loading level "+_);return}this.log("Level "+_+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+k);var D=this.fragCurrent;D&&(this.state===S.State.FRAG_LOADING||this.state===S.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==m.level&&D.loader&&(this.state=S.State.IDLE,D.loader.abort()));var x=E[_],P=0;if(T.live||(h=x.details)!==null&&h!==void 0&&h.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;P=this.alignPlaylists(T,x.details)}if(x.details=T,this.levelLastLoaded=_,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:T,level:_}),this.state===S.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=S.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,P),this.tick()},y._handleFragmentLoadProgress=function(f){var m,h=f.frag,E=f.part,_=f.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var k=T[h.level],D=k.details;if(!D){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var x=k.videoCodec,P=D.PTSKnown||!D.live,H=(m=h.initSegment)===null||m===void 0?void 0:m.data,I=this._getAudioCodec(k),V=this.transmuxer=this.transmuxer||new u.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=E?E.index:-1,ge=$!==-1,te=new l.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,_.byteLength,$,ge),be=this.initPTS[h.cc];V.push(_,H,I,x,h,E,D.totalduration,P,te,be)},y.onAudioTrackSwitching=function(f,m){var h=this.altAudio,E=!!m.url,_=m.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var k=this.hls;h&&k.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),k.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:_})}},y.onAudioTrackSwitched=function(f,m){var h=m.id,E=!!this.hls.audioTracks[h].url;if(E){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=E,this.tick()},y.onBufferCreated=function(f,m){var h=m.tracks,E,_,T=!1;for(var k in h){var D=h[k];if(D.id==="main"){if(_=k,E=D,k==="video"){var x=h[k];x&&(this.videoBuffer=x.buffer)}}else T=!0}T&&E?(this.log("Alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},y.onFragBuffered=function(f,m){var h=m.frag,E=m.part;if(h&&h.type!==w.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(E?" p: "+E.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===S.State.PARSED&&(this.state=S.State.IDLE);return}var _=E?E.stats:h.stats;this.fragLastKbps=Math.round(8*_.total/(_.buffering.end-_.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,E)},y.onError=function(f,m){switch(m.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:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.MAIN,m);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==S.State.ERROR&&(m.fatal?(this.warn(""+m.details),this.state=S.State.ERROR):!m.levelRetry&&this.state===S.State.WAITING_LEVEL&&(this.state=S.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="main"&&(this.state===S.State.PARSING||this.state===S.State.PARSED)){var h=!0,E=this.getFwdBufferInfo(this.media,w.PlaylistLevelType.MAIN);E&&E.len>.5&&(h=!this.reduceMaxBufferLength(E.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},y.checkBuffer=function(){var f=this.media,m=this.gapController;if(!f||!m||!f.readyState)return;var h=B.BufferHelper.getBuffered(f);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):m.poll(this.lastCurrentTime),this.lastCurrentTime=f.currentTime},y.onFragLoadEmergencyAborted=function(){this.state=S.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},y.onBufferFlushed=function(f,m){var h=m.type;if(h!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(h===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,h,w.PlaylistLevelType.MAIN)}},y.onLevelsUpdated=function(f,m){this.levels=m.levels},y.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},y.seekToStartPos=function(){var f=this.media,m=f.currentTime,h=this.startPosition;if(h>=0&&m<h){if(f.seeking){o.logger.log("could not seek to "+h+", already seeking at "+m);return}var E=B.BufferHelper.getBuffered(f),_=E.length?E.start(0):0,T=_-h;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+T+" to match buffer start"),h+=T,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+m),f.currentTime=h}},y._getAudioCodec=function(f){var m=this.config.defaultAudioCodec||f.audioCodec;return this.audioCodecSwap&&m&&(this.log("Swapping audio codec"),m.indexOf("mp4a.40.5")!==-1?m="mp4a.40.2":m="mp4a.40.5"),m},y._loadBitrateTestFrag=function(f){var m=this;this._doFragLoad(f).then(function(h){var E=m.hls;if(!h||E.nextLoadLevel||m.fragContextChanged(f))return;m.fragLoadError=0,m.state=S.State.IDLE,m.startFragRequested=!1,m.bitrateTest=!1;var _=f.stats;_.parsing.start=_.parsing.end=_.buffering.start=_.buffering.end=self.performance.now(),E.trigger(F.Events.FRAG_LOADED,h)})},y._handleTransmuxComplete=function(f){var m,h="main",E=this.hls,_=f.remuxResult,T=f.chunkMeta,k=this.getCurrentContext(T);if(!k){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var D=k.frag,x=k.part,P=k.level,H=_.video,I=_.text,V=_.id3,$=_.initSegment,ge=this.altAudio?void 0:_.audio;if(this.fragContextChanged(D))return;if(this.state=S.State.PARSING,$){$.tracks&&(this._bufferInitSegment(P,$.tracks,D,T),E.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:h,tracks:$.tracks}));var te=$.initPTS,be=$.timescale;Object(N.isFiniteNumber)(te)&&(this.initPTS[D.cc]=te,E.trigger(F.Events.INIT_PTS_FOUND,{frag:D,id:h,initPTS:te,timescale:be}))}if(H&&_.independent!==!1){if(P.details){var ve=H.startPTS,oe=H.endPTS,le=H.startDTS,_e=H.endDTS;if(x)x.elementaryStreams[H.type]={startPTS:ve,endPTS:oe,startDTS:le,endDTS:_e};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var ee=this.getLoadPosition()+this.config.maxBufferHole;if(ee<ve){this.backtrack(D);return}D.setElementaryStreamInfo(H.type,D.start,oe,D.start,_e,!0)}D.setElementaryStreamInfo(H.type,ve,oe,le,_e),this.bufferFragmentData(H,D,x,T)}}else if(_.independent===!1){this.backtrack(D);return}if(ge){var L=ge.startPTS,A=ge.endPTS,C=ge.startDTS,U=ge.endDTS;x&&(x.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:L,endPTS:A,startDTS:C,endDTS:U}),D.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,L,A,C,U),this.bufferFragmentData(ge,D,x,T)}if(V!=null&&(m=V.samples)!==null&&m!==void 0&&m.length){var K={frag:D,id:h,samples:V.samples};E.trigger(F.Events.FRAG_PARSING_METADATA,K)}if(I){var M={frag:D,id:h,samples:I.samples};E.trigger(F.Events.FRAG_PARSING_USERDATA,M)}},y._bufferInitSegment=function(f,m,h,E){var _=this;if(this.state!==S.State.PARSING)return;this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var T=m.audio,k=m.video,D=m.audiovideo;if(T){var x=f.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),T.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(x="mp4a.40.5")),P.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),f.audioCodec&&f.audioCodec!==x&&this.log('Swapping manifest audio codec "'+f.audioCodec+'" for "'+x+'"'),T.levelCodec=x,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(f.audioCodec||"")+"/"+T.codec+"]")}k&&(k.levelCodec=f.videoCodec,k.id="main",this.log("Init video buffer, container:"+k.container+", codecs[level/parsed]=["+(f.videoCodec||"")+"/"+k.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(f.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(H){var I=m[H],V=I.initSegment;V!=null&&V.byteLength&&_.hls.trigger(F.Events.BUFFER_APPENDING,{type:H,data:V,frag:h,part:null,chunkMeta:E,parent:h.type})}),this.tick()},y.backtrack=function(f){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(f);var m=this.fragmentTracker.backtrack(f);this.fragPrevious=null,this.nextLoadPosition=f.start,m?this.resetFragmentLoading(f):this.state=S.State.BACKTRACKING},y.checkFragmentChanged=function(){var f=this.media,m=null;if(f&&f.readyState>1&&f.seeking===!1){var h=f.currentTime;if(B.BufferHelper.isBuffered(f,h)?m=this.getAppendedFrag(h):B.BufferHelper.isBuffered(f,h+.1)&&(m=this.getAppendedFrag(h+.1)),m){var E=this.fragPlaying,_=m.level;(!E||m.sn!==E.sn||E.level!==_||m.urlId!==E.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:m}),(!E||E.level!==_)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:_}),this.fragPlaying=m)}}},r(b,[{key:"nextLevel",get:function(){var f=this.nextBufferedFrag;return f?f.level:-1}},{key:"currentLevel",get:function(){var f=this.media;if(f){var m=this.getAppendedFrag(f.currentTime);if(m)return m.level}return-1}},{key:"nextBufferedFrag",get:function(){var f=this.media;if(f){var m=this.getAppendedFrag(f.currentTime);return this.followingBufferedFrag(m)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),b}(S.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"SubtitleStreamController",function(){return n});var N=R("./src/events.ts"),S=R("./src/utils/logger.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/controller/fragment-finders.ts"),B=R("./src/utils/discontinuities.ts"),e=R("./src/controller/level-helper.ts"),w=R("./src/controller/fragment-tracker.ts"),g=R("./src/controller/base-stream-controller.ts"),u=R("./src/types/loader.ts"),l=R("./src/types/level.ts");function s(t,v){for(var c=0;c<v.length;c++){var p=v[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(t,p.key,p)}}function i(t,v,c){return v&&s(t.prototype,v),c&&s(t,c),t}function o(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,a(t,v)}function a(t,v){return a=Object.setPrototypeOf||function(p,b){return p.__proto__=b,p},a(t,v)}var r=500,n=function(t){o(v,t);function v(p,b){var y;return y=t.call(this,p,b,"[subtitle-stream-controller]")||this,y.levels=[],y.currentTrackId=-1,y.tracksBuffered=[],y.mainDetails=null,y._registerListeners(),y}var c=v.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var b=this.hls;b.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(N.Events.ERROR,this.onError,this),b.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.on(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.on(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var b=this.hls;b.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(N.Events.ERROR,this.onError,this),b.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.off(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.off(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(r),this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},c.onLevelLoaded=function(b,y){this.mainDetails=y.details},c.onSubtitleFragProcessed=function(b,y){var d=y.frag,f=y.success;if(this.fragPrevious=d,this.state=g.State.IDLE,!f)return;var m=this.tracksBuffered[this.currentTrackId];if(!m)return;for(var h,E=d.start,_=0;_<m.length;_++)if(E>=m[_].start&&E<=m[_].end){h=m[_];break}var T=d.start+d.duration;h?h.end=T:(h={start:E,end:T},m.push(h)),this.fragmentTracker.fragBuffered(d)},c.onBufferFlushing=function(b,y){var d=y.startOffset,f=y.endOffset;if(d===0&&f!==Number.POSITIVE_INFINITY){var m=this.currentTrackId,h=this.levels;if(!h.length||!h[m]||!h[m].details)return;var E=h[m].details,_=E.targetduration,T=f-_;if(T<=0)return;y.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(k){for(var D=0;D<k.length;){if(k[D].end<=T){k.shift();continue}else if(k[D].start<T)k[D].start=T;else break;D++}}),this.fragmentTracker.removeFragmentsInRange(d,T,u.PlaylistLevelType.SUBTITLE)}},c.onError=function(b,y){var d,f=y.frag;if(!f||f.type!==u.PlaylistLevelType.SUBTITLE)return;(d=this.fragCurrent)!==null&&d!==void 0&&d.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},c.onSubtitleTracksUpdated=function(b,y){var d=this,f=y.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(m){return new l.Level(m)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(m){d.tracksBuffered[m.id]=[]}),this.mediaBuffer=null},c.onSubtitleTrackSwitch=function(b,y){if(this.currentTrackId=y.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var d=this.levels[this.currentTrackId];d!=null&&d.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,d&&this.setInterval(r)},c.onSubtitleTrackLoaded=function(b,y){var d,f=y.details,m=y.id,h=this.currentTrackId,E=this.levels;if(!E.length)return;var _=E[h];if(m>=E.length||m!==h||!_)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,f.live||(d=_.details)!==null&&d!==void 0&&d.live){var T=this.mainDetails;if(f.deltaUpdateFailed||!T)return;var k=T.fragments[0];if(!_.details)f.hasProgramDateTime&&T.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(f,T):k&&Object(e.addSliding)(f,k.start);else{var D=this.alignPlaylists(f,_.details);D===0&&k&&Object(e.addSliding)(f,k.start)}}if(_.details=f,this.levelLastLoaded=m,this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var x=Object(F.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),_.details=void 0)}},c._handleFragmentLoadComplete=function(b){var y=b.frag,d=b.payload,f=y.decryptdata,m=this.hls;if(this.fragContextChanged(y))return;if(d&&d.byteLength>0&&f&&f.key&&f.iv&&f.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(d),f.key.buffer,f.iv.buffer).then(function(E){var _=performance.now();m.trigger(N.Events.FRAG_DECRYPTED,{frag:y,payload:E,stats:{tstart:h,tdecrypt:_}})})}},c.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var b,y=this.currentTrackId,d=this.levels;if(!d.length||!d[y]||!d[y].details)return;var f=d[y].details,m=f.targetduration,h=this.config,E=this.media,_=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-m,h.maxBufferHole),T=_.end,k=_.len,D=this.getMaxBufferLength()+m;if(k>D)return;console.assert(f,"Subtitle track details are defined on idle subtitle stream controller tick");var x=f.fragments,P=x.length,H=f.edge,I,V=this.fragPrevious;if(T<H){var $=h.maxFragLookUpTolerance;V&&f.hasProgramDateTime&&(I=Object(F.findFragmentByPDT)(x,V.endProgramDateTime,$)),I||(I=Object(F.findFragmentByPTS)(V,x,T,$),!I&&V&&V.start<x[0].start&&(I=x[0]))}else I=x[P-1];(b=I)!==null&&b!==void 0&&b.encrypted?(S.logger.log("Loading key for "+I.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(N.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===w.FragmentState.NOT_LOADED&&this.loadFragment(I,f,T)}},c.loadFragment=function(b,y,d){this.fragCurrent=b,t.prototype.loadFragment.call(this,b,y,d)},i(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/texttrack-utils.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function B(s,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function e(s,i,o){return i&&B(s.prototype,i),o&&B(s,o),s}function w(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,g(s,i)}function g(s,i){return g=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},g(s,i)}var u=function(s){w(i,s);function i(a){var r;return r=s.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 o=i.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,s.prototype.destroy.call(this)},o.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(N.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(N.Events.ERROR,this.onError,this)},o.onMediaAttached=function(r,n){if(this.media=n.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)},o.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},o.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(n){Object(S.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},o.onSubtitleTrackLoaded=function(r,n){var t=n.id,v=n.details,c=this.trackId,p=this.tracksInGroup[c];if(!p){this.warn("Invalid subtitle track id "+t);return}var b=p.details;p.details=n.details,this.log("subtitle track "+t+" loaded ["+v.startSN+"-"+v.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,b))},o.onLevelLoading=function(r,n){this.switchLevel(n.level)},o.onLevelSwitching=function(r,n){this.switchLevel(n.level)},o.switchLevel=function(r){var n=this.hls.levels[r];if(!(n!=null&&n.textGroupIds))return;var t=n.textGroupIds[n.urlId];if(this.groupId!==t){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,c=this.tracks.filter(function(y){return!t||y.groupId===t});this.tracksInGroup=c;var p=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=t;var b={subtitleTracks:c};this.log("Updating subtitle tracks, "+c.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(N.Events.SUBTITLE_TRACKS_UPDATED,b),p!==-1&&this.setSubtitleTrack(p,v)}},o.findTrackId=function(r){for(var n=this.tracksInGroup,t=0;t<n.length;t++){var v=n[t];if((!this.selectDefaultTrack||v.default)&&(!r||r===v.name))return v.id}return-1},o.onError=function(r,n){if(s.prototype.onError.call(this,r,n),n.fatal||!n.context)return;n.context.type===F.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},o.loadPlaylist=function(r){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,v=n.groupId,c=n.url;if(r)try{c=r.addDirectives(c)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADING,{url:c,id:t,groupId:v,deliveryDirectives:r||null})}},o.toggleTrackModes=function(r){var n=this,t=this.media,v=this.subtitleDisplay,c=this.trackId;if(!t)return;var p=l(t.textTracks),b=p.filter(function(f){return f.groupId===n.groupId});if(r===-1)[].slice.call(p).forEach(function(f){f.mode="disabled"});else{var y=b[c];y&&(y.mode="disabled")}var d=b[r];d&&(d.mode=v?"showing":"hidden")},o.setSubtitleTrack=function(r,n){var t,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=v[r])!==null&&t!==void 0&&t.details)||r<-1||r>=v.length)return;this.clearTimer();var c=v[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,c){var p=c.id,b=c.groupId,y=b===void 0?"":b,d=c.name,f=c.type,m=c.url;this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:y,name:d,type:f,url:m});var h=this.switchParams(c.url,n==null?void 0:n.details);this.loadPlaylist(h)}else this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:r})},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=l(this.media.textTracks),t=0;t<n.length;t++)if(n[t].mode==="hidden")r=t;else if(n[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(i,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,n)}}]),i}(O.default);function l(s){for(var i=[],o=0;o<s.length;o++){var a=s[o];a.kind==="subtitles"&&a.label&&i.push(s[o])}return i}W.default=u},"./src/controller/timeline-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"TimelineController",function(){return l});var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/utils/cea-608-parser.ts"),F=R("./src/utils/output-filter.ts"),B=R("./src/utils/webvtt-parser.ts"),e=R("./src/utils/texttrack-utils.ts"),w=R("./src/utils/imsc1-ttml-parser.ts"),g=R("./src/types/loader.ts"),u=R("./src/utils/logger.ts"),l=function(){function a(n){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=o(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.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 F.default(this,"textTrack1"),v=new F.default(this,"textTrack2"),c=new F.default(this,"textTrack3"),p=new F.default(this,"textTrack4");this.cea608Parser1=new O.default(1,t,v),this.cea608Parser2=new O.default(3,c,p)}n.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(S.Events.FRAG_LOADING,this.onFragLoading,this),n.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(S.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(S.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(S.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=a.prototype;return r.destroy=function(){var t=this.hls;t.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(S.Events.FRAG_LOADING,this.onFragLoading,this),t.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(S.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(S.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(S.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,v,c,p,b){for(var y=!1,d=b.length;d--;){var f=b[d],m=i(f[0],f[1],v,c);if(m>=0&&(f[0]=Math.min(f[0],v),f[1]=Math.max(f[1],c),y=!0,m/(c-v)>.5))return}if(y||b.push([v,c]),this.config.renderTextTracksNatively){var h=this.captionsTracks[t];this.Cues.newCue(h,v,c,p)}else{var E=this.Cues.newCue(null,v,c,p);this.hls.trigger(S.Events.CUES_PARSED,{type:"captions",cues:E,track:t})}},r.onInitPtsFound=function(t,v){var c=this,p=v.frag,b=v.id,y=v.initPTS,d=v.timescale,f=this.unparsedVttFrags;b==="main"&&(this.initPTS[p.cc]=y,this.timescale[p.cc]=d),f.length&&(this.unparsedVttFrags=[],f.forEach(function(m){c.onFragLoaded(S.Events.FRAG_LOADED,m)}))},r.getExistingTrack=function(t){var v=this.media;if(v)for(var c=0;c<v.textTracks.length;c++){var p=v.textTracks[c];if(p[t])return p}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 v=this.captionsProperties,c=this.captionsTracks,p=this.media,b=v[t],y=b.label,d=b.languageCode,f=this.getExistingTrack(t);if(f)c[t]=f,Object(e.clearCurrentCues)(c[t]),Object(e.sendAddTrackEvent)(c[t],p);else{var m=this.createTextTrack("captions",y,d);m&&(m[t]=!0,c[t]=m)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var v=this.captionsProperties[t];if(!v)return;var c=v.label,p={_id:t,label:c,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[t]=p,this.hls.trigger(S.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},r.createTextTrack=function(t,v,c){var p=this.media;return p?p.addTextTrack(t,v,c):void 0},r.onMediaAttaching=function(t,v){this.media=v.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(v){Object(e.clearCurrentCues)(t[v]),delete t[v]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),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 v=t.textTracks;if(v)for(var c=0;c<v.length;c++)Object(e.clearCurrentCues)(v[c])},r.onSubtitleTracksUpdated=function(t,v){var c=this;this.textTracks=[];var p=v.subtitleTracks||[],b=p.some(function(m){return m.textCodec===w.IMSC1_CODEC});if(this.config.enableWebVTT||b&&this.config.enableIMSC1){var y=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var d=this.media?this.media.textTracks:[];this.tracks.forEach(function(m,h){var E;if(h<d.length){for(var _=null,T=0;T<d.length;T++)if(s(d[T],m)){_=d[T];break}_&&(E=_)}E?Object(e.clearCurrentCues)(E):(E=c.createTextTrack("subtitles",m.name,m.lang),E&&(E.mode="disabled")),E&&(E.groupId=m.groupId,c.textTracks.push(E))})}else if(!y&&this.tracks&&this.tracks.length){var f=this.tracks.map(function(m){return{label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}});this.hls.trigger(S.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:f})}}},r.onManifestLoaded=function(t,v){var c=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(p){var b=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!b)return;var y="textTrack"+b[1],d=c.captionsProperties[y];if(!d)return;d.label=p.name,p.lang&&(d.languageCode=p.lang),d.media=p})},r.onFragLoading=function(t,v){var c=this.cea608Parser1,p=this.cea608Parser2,b=this.lastSn,y=this.lastPartIndex;if(!this.enabled||!(c&&p))return;if(v.frag.type===g.PlaylistLevelType.MAIN){var d,f,m=v.frag.sn,h=(d=v==null||((f=v.part)===null||f===void 0)?void 0:f.index)!=null?d:-1;m===b+1||m===b&&h===y+1||(c.reset(),p.reset()),this.lastSn=m,this.lastPartIndex=h}},r.onFragLoaded=function(t,v){var c=v.frag,p=v.payload,b=this.initPTS,y=this.unparsedVttFrags;if(c.type===g.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(N.isFiniteNumber)(b[c.cc])){y.push(v),b.length&&this.hls.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Missing initial subtitle PTS")});return}var d=c.decryptdata;if(d==null||d.key==null||d.method!=="AES-128"){var f=this.tracks[c.level],m=this.vttCCs;m[c.cc]||(m[c.cc]={start:c.start,prevCC:this.prevCC,new:!0},this.prevCC=c.cc),f&&f.textCodec===w.IMSC1_CODEC?this._parseIMSC1(c,p):this._parseVTTs(c,p,m)}}else this.hls.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,v){var c=this,p=this.hls;Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(b){c._appendCues(b,t.level),p.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(b){u.logger.log("Failed to parse IMSC1: "+b),p.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},r._parseVTTs=function(t,v,c){var p=this,b=this.hls;Object(B.parseWebVTT)(v,this.initPTS[t.cc],this.timescale[t.cc],c,t.cc,t.start,function(y){p._appendCues(y,t.level),b.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(y){p._fallbackToIMSC1(t,v),u.logger.log("Failed to parse VTT cue: "+y),b.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:y})})},r._fallbackToIMSC1=function(t,v){var c=this,p=this.tracks[t.level];p.textCodec||Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(){p.textCodec=w.IMSC1_CODEC,c._parseIMSC1(t,v)},function(){p.textCodec="wvtt"})},r._appendCues=function(t,v){var c=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[v];if(p.mode==="disabled")return;t.forEach(function(d){return Object(e.addCueToTrack)(p,d)})}else{var b=this.tracks[v],y=b.default?"default":"subtitles"+v;c.trigger(S.Events.CUES_PARSED,{type:"subtitles",cues:t,track:y})}},r.onFragDecrypted=function(t,v){var c=v.frag;if(c.type===g.PlaylistLevelType.SUBTITLE){if(!Object(N.isFiniteNumber)(this.initPTS[c.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(S.Events.FRAG_LOADED,v)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,v){var c=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(c&&p))return;for(var b=0;b<v.samples.length;b++){var y=v.samples[b].bytes;if(y){var d=this.extractCea608Data(y);c.addData(v.samples[b].pts,d[0]),p.addData(v.samples[b].pts,d[1])}}},r.onBufferFlushing=function(t,v){var c=v.startOffset,p=v.endOffset,b=v.endOffsetSubtitles,y=v.type,d=this.media;if(!d||d.currentTime<p)return;if(!y||y==="video"){var f=this.captionsTracks;Object.keys(f).forEach(function(h){return Object(e.removeCuesInRange)(f[h],c,p)})}if(this.config.renderTextTracksNatively&&(c===0&&b!==void 0)){var m=this.textTracks;Object.keys(m).forEach(function(h){return Object(e.removeCuesInRange)(m[h],c,b)})}},r.extractCea608Data=function(t){for(var v=t[0]&31,c=2,p=[[],[]],b=0;b<v;b++){var y=t[c++],d=127&t[c++],f=127&t[c++],m=(4&y)!==0,h=3&y;if(d===0&&f===0)continue;m&&((h===0||h===1)&&(p[h].push(d),p[h].push(f)))}return p},a}();function s(a,r){return a&&a.label===r.name&&!(a.textTrack1||a.textTrack2)}function i(a,r,n,t){return Math.min(r,t)-Math.max(a,n)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,B){this.subtle=void 0,this.aesIV=void 0,this.subtle=F,this.aesIV=B}var O=S.prototype;return O.decrypt=function(B,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,B)},S}()},"./src/crypt/aes-decryptor.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"removePadding",function(){return S}),R.d(W,"default",function(){return O});var N=R("./src/utils/typed-array.ts");function S(F){var B=F.byteLength,e=B&&new DataView(F.buffer).getUint8(B-1);return e?Object(N.sliceUint8)(F,0,B-e):F}var O=function(){function F(){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 B=F.prototype;return B.uint8ArrayToUint32Array_=function(w){for(var g=new DataView(w),u=new Uint32Array(4),l=0;l<4;l++)u[l]=g.getUint32(l*4);return u},B.initTable=function(){var w=this.sBox,g=this.invSBox,u=this.subMix,l=u[0],s=u[1],i=u[2],o=u[3],a=this.invSubMix,r=a[0],n=a[1],t=a[2],v=a[3],c=new Uint32Array(256),p=0,b=0,y=0;for(y=0;y<256;y++)y<128?c[y]=y<<1:c[y]=y<<1^283;for(y=0;y<256;y++){var d=b^b<<1^b<<2^b<<3^b<<4;d=d>>>8^d&255^99,w[p]=d,g[d]=p;var f=c[p],m=c[f],h=c[m],E=c[d]*257^d*16843008;l[p]=E<<24|E>>>8,s[p]=E<<16|E>>>16,i[p]=E<<8|E>>>24,o[p]=E,E=h*16843009^m*65537^f*257^p*16843008,r[d]=E<<24|E>>>8,n[d]=E<<16|E>>>16,t[d]=E<<8|E>>>24,v[d]=E,p?(p=f^c[c[c[h^f]]],b^=c[c[b]]):p=b=1}},B.expandKey=function(w){for(var g=this.uint8ArrayToUint32Array_(w),u=!0,l=0;l<g.length&&u;)u=g[l]===this.key[l],l++;if(u)return;this.key=g;var s=this.keySize=g.length;if(s!==4&&s!==6&&s!==8)throw new Error("Invalid aes key size="+s);var i=this.ksRows=(s+6+1)*4,o,a,r=this.keySchedule=new Uint32Array(i),n=this.invKeySchedule=new Uint32Array(i),t=this.sBox,v=this.rcon,c=this.invSubMix,p=c[0],b=c[1],y=c[2],d=c[3],f,m;for(o=0;o<i;o++){if(o<s){f=r[o]=g[o];continue}m=f,o%s===0?(m=m<<8|m>>>24,m=t[m>>>24]<<24|t[m>>>16&255]<<16|t[m>>>8&255]<<8|t[m&255],m^=v[o/s|0]<<24):s>6&&o%s===4&&(m=t[m>>>24]<<24|t[m>>>16&255]<<16|t[m>>>8&255]<<8|t[m&255]),r[o]=f=(r[o-s]^m)>>>0}for(a=0;a<i;a++)o=i-a,a&3?m=r[o]:m=r[o-4],a<4||o<=4?n[a]=m:n[a]=p[t[m>>>24]]^b[t[m>>>16&255]]^y[t[m>>>8&255]]^d[t[m&255]],n[a]=n[a]>>>0},B.networkToHostOrderSwap=function(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},B.decrypt=function(w,g,u){for(var l=this.keySize+6,s=this.invKeySchedule,i=this.invSBox,o=this.invSubMix,a=o[0],r=o[1],n=o[2],t=o[3],v=this.uint8ArrayToUint32Array_(u),c=v[0],p=v[1],b=v[2],y=v[3],d=new Int32Array(w),f=new Int32Array(d.length),m,h,E,_,T,k,D,x,P,H,I,V,$,ge,te=this.networkToHostOrderSwap;g<d.length;){for(P=te(d[g]),H=te(d[g+1]),I=te(d[g+2]),V=te(d[g+3]),T=P^s[0],k=V^s[1],D=I^s[2],x=H^s[3],$=4,ge=1;ge<l;ge++)m=a[T>>>24]^r[k>>16&255]^n[D>>8&255]^t[x&255]^s[$],h=a[k>>>24]^r[D>>16&255]^n[x>>8&255]^t[T&255]^s[$+1],E=a[D>>>24]^r[x>>16&255]^n[T>>8&255]^t[k&255]^s[$+2],_=a[x>>>24]^r[T>>16&255]^n[k>>8&255]^t[D&255]^s[$+3],T=m,k=h,D=E,x=_,$=$+4;m=i[T>>>24]<<24^i[k>>16&255]<<16^i[D>>8&255]<<8^i[x&255]^s[$],h=i[k>>>24]<<24^i[D>>16&255]<<16^i[x>>8&255]<<8^i[T&255]^s[$+1],E=i[D>>>24]<<24^i[x>>16&255]<<16^i[T>>8&255]<<8^i[k&255]^s[$+2],_=i[x>>>24]<<24^i[T>>16&255]<<16^i[k>>8&255]<<8^i[D&255]^s[$+3],f[g]=te(m^c),f[g+1]=te(_^p),f[g+2]=te(E^b),f[g+3]=te(h^y),c=P,p=H,b=I,y=V,g=g+4}return f.buffer},F}()},"./src/crypt/decrypter.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return g});var N=R("./src/crypt/aes-crypto.ts"),S=R("./src/crypt/fast-aes-key.ts"),O=R("./src/crypt/aes-decryptor.ts"),F=R("./src/utils/logger.ts"),B=R("./src/utils/mp4-tools.ts"),e=R("./src/utils/typed-array.ts"),w=16,g=function(){function u(s,i,o){var a=o===void 0?{}:o,r=a.removePKCS7Padding,n=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=s,this.config=i,this.removePKCS7Padding=n,n)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var l=u.prototype;return l.destroy=function(){this.observer=null},l.isSync=function(){return this.config.enableSoftwareAES},l.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var o=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(o):o},l.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},l.decrypt=function(i,o,a,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),o,a);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),o,a).then(r)},l.softwareDecrypt=function(i,o,a){var r=this.currentIV,n=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(B.appendUint8Array)(t,i),this.remainderData=null);var v=this.getValidChunk(i);if(!v.length)return null;r&&(a=r);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new O.default),c.expandKey(o);var p=n;return this.currentResult=c.decrypt(v.buffer,0,a),this.currentIV=Object(e.sliceUint8)(v,-16).buffer,p||null},l.webCryptoDecrypt=function(i,o,a){var r=this,n=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new S.default(n,o)),this.fastAesKey.expandKey().then(function(t){if(!n)return Promise.reject(new Error("web crypto not initialized"));var v=new N.default(n,a);return v.decrypt(i.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,i,o,a)})},l.onWebCryptoError=function(i,o,a,r){return F.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,a,r)},l.getValidChunk=function(i){var o=i,a=i.length-i.length%w;return a!==i.length&&(o=Object(e.sliceUint8)(i,0,a),this.remainderData=Object(e.sliceUint8)(i,a)),o},l.logOnce=function(i){if(!this.logEnabled)return;F.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},u}()},"./src/crypt/fast-aes-key.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,B){this.subtle=void 0,this.key=void 0,this.subtle=F,this.key=B}var O=S.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},S}()},"./src/demux/aacdemuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/demux/base-audio-demuxer.ts"),S=R("./src/demux/adts.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/id3.ts");function B(g,u){g.prototype=Object.create(u.prototype),g.prototype.constructor=g,e(g,u)}function e(g,u){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(g,u)}var w=function(g){B(u,g);function u(s,i){var o;return o=g.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=s,o.config=i,o}var l=u.prototype;return l.resetInitSegment=function(i,o,a){g.prototype.resetInitSegment.call(this,i,o,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},u.probe=function(i){if(!i)return!1;for(var o=F.getID3Data(i,0)||[],a=o.length,r=i.length;a<r;a++)if(S.probe(i,a))return O.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(i,o){return S.canParse(i,o)},l.appendFrame=function(i,o,a){S.initTrackConfig(i,this.observer,o,a,i.manifestCodec);var r=S.appendFrame(i,o,a,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},u}(N.default);w.minProbeByteLength=9,W.default=w},"./src/demux/adts.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"getAudioConfig",function(){return F}),R.d(W,"isHeaderPattern",function(){return B}),R.d(W,"getHeaderLength",function(){return e}),R.d(W,"getFullFrameLength",function(){return w}),R.d(W,"canGetFrameLength",function(){return g}),R.d(W,"isHeader",function(){return u}),R.d(W,"canParse",function(){return l}),R.d(W,"probe",function(){return s}),R.d(W,"initTrackConfig",function(){return i}),R.d(W,"getFrameDuration",function(){return o}),R.d(W,"parseFrameHeader",function(){return a}),R.d(W,"appendFrame",function(){return r});var N=R("./src/utils/logger.ts"),S=R("./src/errors.ts"),O=R("./src/events.ts");function F(n,t,v,c){var p,b,y,d,f=navigator.userAgent.toLowerCase(),m=c,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((t[v+2]&192)>>>6)+1;var E=(t[v+2]&60)>>>2;if(E>h.length-1){n.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return y=(t[v+2]&1)<<2,y|=(t[v+3]&192)>>>6,N.logger.log("manifest codec:"+c+", ADTS type:"+p+", samplingIndex:"+E),/firefox/i.test(f)?E>=6?(p=5,d=new Array(4),b=E-3):(p=2,d=new Array(2),b=E):f.indexOf("android")!==-1?(p=2,d=new Array(2),b=E):(p=5,d=new Array(4),c&&(c.indexOf("mp4a.40.29")!==-1||c.indexOf("mp4a.40.5")!==-1)||!c&&E>=6?b=E-3:((c&&c.indexOf("mp4a.40.2")!==-1&&(E>=6&&y===1||/vivaldi/i.test(f))||!c&&y===1)&&(p=2,d=new Array(2)),b=E)),d[0]=p<<3,d[0]|=(E&14)>>1,d[1]|=(E&1)<<7,d[1]|=y<<3,p===5&&(d[1]|=(b&14)>>1,d[2]=(b&1)<<7,d[2]|=2<<2,d[3]=0),{config:d,samplerate:h[E],channelCount:y,codec:"mp4a.40."+p,manifestCodec:m}}function B(n,t){return n[t]===255&&(n[t+1]&246)===240}function e(n,t){return n[t+1]&1?7:9}function w(n,t){return(n[t+3]&3)<<11|n[t+4]<<3|(n[t+5]&224)>>>5}function g(n,t){return t+5<n.length}function u(n,t){return t+1<n.length&&B(n,t)}function l(n,t){return g(n,t)&&B(n,t)&&w(n,t)<=n.length-t}function s(n,t){if(u(n,t)){var v=e(n,t);if(t+v>=n.length)return!1;var c=w(n,t);if(c<=v)return!1;var p=t+c;return p===n.length||u(n,p)}return!1}function i(n,t,v,c,p){if(!n.samplerate){var b=F(t,v,c,p);if(!b)return;n.config=b.config,n.samplerate=b.samplerate,n.channelCount=b.channelCount,n.codec=b.codec,n.manifestCodec=b.manifestCodec,N.logger.log("parsed codec:"+n.codec+", rate:"+b.samplerate+", channels:"+b.channelCount)}}function o(n){return 1024*9e4/n}function a(n,t,v,c,p){var b=e(n,t),y=w(n,t);if(y-=b,y>0){var d=v+c*p;return{headerLength:b,frameLength:y,stamp:d}}}function r(n,t,v,c,p){var b=o(n.samplerate),y=a(t,v,c,p,b);if(y){var d=y.frameLength,f=y.headerLength,m=y.stamp,h=f+d,E=Math.max(0,v+h-t.length),_;E?(_=new Uint8Array(h-f),_.set(t.subarray(v+f,t.length),0)):_=t.subarray(v+f,v+h);var T={unit:_,pts:m};return E||n.samples.push(T),{sample:T,length:h,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"initPTSFn",function(){return w});var N=R("./src/polyfills/number.ts"),S=R("./src/demux/id3.ts"),O=R("./src/demux/dummy-demuxed-track.ts"),F=R("./src/utils/mp4-tools.ts"),B=R("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var u=g.prototype;return u.resetInitSegment=function(s,i,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},u.resetTimeStamp=function(){},u.resetContiguity=function(){},u.canParse=function(s,i){return!1},u.appendFrame=function(s,i,o){},u.demux=function(s,i){this.cachedData&&(s=Object(F.appendUint8Array)(this.cachedData,s),this.cachedData=null);var o=S.getID3Data(s,0),a=o?o.length:0,r,n,t=this._audioTrack,v=this._id3Track,c=o?S.getTimeStamp(o):void 0,p=s.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=w(c,i)),o&&o.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),n=this.initPTS;a<p;){if(this.canParse(s,a)){var b=this.appendFrame(t,s,a);b?(this.frameIndex++,n=b.sample.pts,a+=b.length,r=a):a=p}else S.canParse(s,a)?(o=S.getID3Data(s,a),v.samples.push({pts:n,dts:n,data:o}),a+=o.length,r=a):a++;if(a===p&&r!==p){var y=Object(B.sliceUint8)(s,r);this.cachedData?this.cachedData=Object(F.appendUint8Array)(this.cachedData,y):this.cachedData=y}}return{audioTrack:t,avcTrack:Object(O.dummyTrack)(),id3Track:v,textTrack:Object(O.dummyTrack)()}},u.demuxSampleAes=function(s,i,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},u.flush=function(s){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},u.destroy=function(){},g}(),w=function(u,l){return Object(N.isFiniteNumber)(u)?u*90:l*9e4};W.default=e},"./src/demux/chunk-cache.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function O(){this.chunks=[],this.dataLength=0}var F=O.prototype;return F.push=function(e){this.chunks.push(e),this.dataLength+=e.length},F.flush=function(){var e=this.chunks,w=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=S(e,w);else return new Uint8Array(0);return this.reset(),g},F.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function S(O,F){for(var B=new Uint8Array(F),e=0,w=0;w<O.length;w++){var g=O[w];B.set(g,e),e+=g.length}return B}},"./src/demux/dummy-demuxed-track.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"dummyTrack",function(){return N});function N(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/logger.ts"),S=function(){function O(B){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=B,this.bytesAvailable=B.byteLength,this.word=0,this.bitsAvailable=0}var F=O.prototype;return F.loadWord=function(){var e=this.data,w=this.bytesAvailable,g=e.byteLength-w,u=new Uint8Array(4),l=Math.min(4,w);if(l===0)throw new Error("no bytes available");u.set(e.subarray(g,g+l)),this.word=new DataView(u.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l},F.skipBits=function(e){var w;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,w=e>>3,e-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},F.readBits=function(e){var w=Math.min(this.bitsAvailable,e),g=this.word>>>32-w;return e>32&&N.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=e-w,w>0&&this.bitsAvailable?g<<w|this.readBits(w):g},F.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()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},F.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(e){for(var w=8,g=8,u,l=0;l<e;l++)g!==0&&(u=this.readEG(),g=(w+u+256)%256),w=g===0?w:g},F.readSPS=function(){var e=0,w=0,g=0,u=0,l,s,i,o=this.readUByte.bind(this),a=this.readBits.bind(this),r=this.readUEG.bind(this),n=this.readBoolean.bind(this),t=this.skipBits.bind(this),v=this.skipEG.bind(this),c=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);o();var b=o();if(a(5),t(3),o(),c(),b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128){var y=r();if(y===3&&t(1),c(),c(),t(1),n())for(s=y!==3?8:12,i=0;i<s;i++)n()&&(i<6?p(16):p(64))}c();var d=r();if(d===0)r();else if(d===1)for(t(1),v(),v(),l=r(),i=0;i<l;i++)v();c(),t(1);var f=r(),m=r(),h=a(1);h===0&&t(1),t(1),n()&&(e=r(),w=r(),g=r(),u=r());var E=[1,1];if(n()&&n()){var _=o();switch(_){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((f+1)*16-e*2-w*2),height:(2-h)*(m+1)*16-(h?2:4)*(g+u),pixelRatio:E}},F.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();W.default=S},"./src/demux/id3.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isHeader",function(){return N}),R.d(W,"isFooter",function(){return S}),R.d(W,"getID3Data",function(){return O}),R.d(W,"canParse",function(){return B}),R.d(W,"getTimeStamp",function(){return e}),R.d(W,"isTimeStampFrame",function(){return w}),R.d(W,"getID3Frames",function(){return u}),R.d(W,"decodeFrame",function(){return l}),R.d(W,"utf8ArrayToStr",function(){return r}),R.d(W,"testables",function(){return n});var N=function(p,b){return b+10<=p.length&&(p[b]===73&&p[b+1]===68&&p[b+2]===51&&(p[b+3]<255&&p[b+4]<255&&(p[b+6]<128&&p[b+7]<128&&p[b+8]<128&&p[b+9]<128)))},S=function(p,b){return b+10<=p.length&&(p[b]===51&&p[b+1]===68&&p[b+2]===73&&(p[b+3]<255&&p[b+4]<255&&(p[b+6]<128&&p[b+7]<128&&p[b+8]<128&&p[b+9]<128)))},O=function(p,b){for(var y=b,d=0;N(p,b);){d+=10;var f=F(p,b+6);d+=f,S(p,b+10)&&(d+=10),b+=d}return d>0?p.subarray(y,y+d):void 0},F=function(p,b){var y=0;return y=(p[b]&127)<<21,y|=(p[b+1]&127)<<14,y|=(p[b+2]&127)<<7,y|=p[b+3]&127,y},B=function(p,b){return N(p,b)&&F(p,b+6)+10<=p.length-b},e=function(p){for(var b=u(p),y=0;y<b.length;y++){var d=b[y];if(w(d))return a(d)}return},w=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},g=function(p){var b=String.fromCharCode(p[0],p[1],p[2],p[3]),y=F(p,4),d=10;return{type:b,size:y,data:p.subarray(d,d+y)}},u=function(p){for(var b=0,y=[];N(p,b);){var d=F(p,b+6);b+=10;for(var f=b+d;b+8<f;){var m=g(p.subarray(b)),h=l(m);h&&y.push(h),b+=m.size+10}S(p,b)&&(b+=10)}return y},l=function(p){return p.type==="PRIV"?s(p):p.type[0]==="W"?o(p):i(p)},s=function(p){if(p.size<2)return;var b=r(p.data,!0),y=new Uint8Array(p.data.subarray(b.length+1));return{key:p.type,info:b,data:y.buffer}},i=function(p){if(p.size<2)return;if(p.type==="TXXX"){var b=1,y=r(p.data.subarray(b),!0);b+=y.length+1;var d=r(p.data.subarray(b));return{key:p.type,info:y,data:d}}var f=r(p.data.subarray(1));return{key:p.type,data:f}},o=function(p){if(p.type==="WXXX"){if(p.size<2)return;var b=1,y=r(p.data.subarray(b),!0);b+=y.length+1;var d=r(p.data.subarray(b));return{key:p.type,info:y,data:d}}var f=r(p.data);return{key:p.type,data:f}},a=function(p){if(p.data.byteLength===8){var b=new Uint8Array(p.data),y=b[3]&1,d=(b[4]<<23)+(b[5]<<15)+(b[6]<<7)+b[7];return d/=45,y&&(d+=4772185884e-2),Math.round(d)}return},r=function(p,b){b===void 0&&(b=!1);var y=v();if(y){var d=y.decode(p);if(b){var f=d.indexOf("\0");return f!==-1?d.substring(0,f):d}return d.replace(/\0/g,"")}for(var m=p.length,h,E,_,T="",k=0;k<m;){if(h=p[k++],h===0&&b)return T;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:T+=String.fromCharCode(h);break;case 12:case 13:E=p[k++],T+=String.fromCharCode((h&31)<<6|E&63);break;case 14:E=p[k++],_=p[k++],T+=String.fromCharCode((h&15)<<12|(E&63)<<6|(_&63)<<0);break;default:}}return T},n={decodeTextFrame:i},t;function v(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/demux/base-audio-demuxer.ts"),S=R("./src/demux/id3.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/mpegaudio.ts");function B(g,u){g.prototype=Object.create(u.prototype),g.prototype.constructor=g,e(g,u)}function e(g,u){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(g,u)}var w=function(g){B(u,g);function u(){return g.apply(this,arguments)||this}var l=u.prototype;return l.resetInitSegment=function(i,o,a){g.prototype.resetInitSegment.call(this,i,o,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},u.probe=function(i){if(!i)return!1;for(var o=S.getID3Data(i,0)||[],a=o.length,r=i.length;a<r;a++)if(F.probe(i,a))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(i,o){return F.canParse(i,o)},l.appendFrame=function(i,o,a){return this.initPTS===null?void 0:F.appendFrame(i,o,a,this.initPTS,this.frameIndex)},u}(N.default);w.minProbeByteLength=4,W.default=w},"./src/demux/mp4demuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/mp4-tools.ts"),S=R("./src/demux/dummy-demuxed-track.ts"),O=function(){function F(e,w){this.remainderData=null,this.config=void 0,this.config=w}var B=F.prototype;return B.resetTimeStamp=function(){},B.resetInitSegment=function(){},B.resetContiguity=function(){},F.probe=function(w){return Object(N.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},B.demux=function(w){var g=w,u=Object(S.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(N.appendUint8Array)(this.remainderData,w));var l=Object(N.segmentValidRange)(g);this.remainderData=l.remainder,u.samples=l.valid||new Uint8Array}else u.samples=g;return{audioTrack:Object(S.dummyTrack)(),avcTrack:u,id3Track:Object(S.dummyTrack)(),textTrack:Object(S.dummyTrack)()}},B.flush=function(){var w=Object(S.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(S.dummyTrack)(),avcTrack:w,id3Track:Object(S.dummyTrack)(),textTrack:Object(S.dummyTrack)()}},B.demuxSampleAes=function(w,g,u){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},F}();O.minProbeByteLength=1024,W.default=O},"./src/demux/mpegaudio.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"appendFrame",function(){return e}),R.d(W,"parseHeader",function(){return w}),R.d(W,"isHeaderPattern",function(){return g}),R.d(W,"isHeader",function(){return u}),R.d(W,"canParse",function(){return l}),R.d(W,"probe",function(){return s});var N=null,S=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function e(i,o,a,r,n){if(a+24>o.length)return;var t=w(o,a);if(t&&a+t.frameLength<=o.length){var v=t.samplesPerFrame*9e4/t.sampleRate,c=r+n*v,p={unit:o.subarray(a,a+t.frameLength),pts:c,dts:c};return i.config=[],i.channelCount=t.channelCount,i.samplerate=t.sampleRate,i.samples.push(p),{sample:p,length:t.frameLength,missing:0}}}function w(i,o){var a=i[o+1]>>3&3,r=i[o+1]>>1&3,n=i[o+2]>>4&15,t=i[o+2]>>2&3;if(a!==1&&n!==0&&n!==15&&t!==3){var v=i[o+2]>>1&1,c=i[o+3]>>6,p=a===3?3-r:r===3?3:4,b=S[p*14+n-1]*1e3,y=a===3?0:a===2?1:2,d=O[y*3+t],f=c===3?1:2,m=F[a][r],h=B[r],E=m*8*h,_=Math.floor(m*b/d+v)*h;if(N===null){var T=navigator.userAgent||"",k=T.match(/Chrome\/(\d+)/i);N=k?parseInt(k[1]):0}var D=!!N&&N<=87;return D&&r===2&&b>=224e3&&c===0&&(i[o+3]=i[o+3]|128),{sampleRate:d,channelCount:f,frameLength:_,samplesPerFrame:E}}}function g(i,o){return i[o]===255&&(i[o+1]&224)===224&&(i[o+1]&6)!==0}function u(i,o){return o+1<i.length&&g(i,o)}function l(i,o){var a=4;return g(i,o)&&a<=i.length-o}function s(i,o){if(o+1<i.length&&g(i,o)){var a=4,r=w(i,o),n=a;r!=null&&r.frameLength&&(n=r.frameLength);var t=o+n;return t===i.length||u(i,t)}return!1}},"./src/demux/sample-aes.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/crypt/decrypter.ts"),S=R("./src/demux/tsdemuxer.ts"),O=function(){function F(e,w,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new N.default(e,w,{removePKCS7Padding:!1})}var B=F.prototype;return B.decryptBuffer=function(w,g){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,g)},B.decryptAacSample=function(w,g,u,l){var s=w[g].unit,i=s.subarray(16,s.length-s.length%16),o=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),a=this;this.decryptBuffer(o,function(r){var n=new Uint8Array(r);s.set(n,16),l||a.decryptAacSamples(w,g+1,u)})},B.decryptAacSamples=function(w,g,u){for(;;g++){if(g>=w.length){u();return}if(w[g].unit.length<32)continue;var l=this.decrypter.isSync();if(this.decryptAacSample(w,g,u,l),!l)return}},B.getAvcEncryptedData=function(w){for(var g=Math.floor((w.length-48)/160)*16+16,u=new Int8Array(g),l=0,s=32;s<=w.length-16;s+=160,l+=16)u.set(w.subarray(s,s+16),l);return u},B.getAvcDecryptedUnit=function(w,g){for(var u=new Uint8Array(g),l=0,s=32;s<=w.length-16;s+=160,l+=16)w.set(u.subarray(l,l+16),s);return w},B.decryptAvcSample=function(w,g,u,l,s,i){var o=Object(S.discardEPB)(s.data),a=this.getAvcEncryptedData(o),r=this;this.decryptBuffer(a.buffer,function(n){s.data=r.getAvcDecryptedUnit(o,n),i||r.decryptAvcSamples(w,g,u+1,l)})},B.decryptAvcSamples=function(w,g,u,l){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,u=0){if(g>=w.length){l();return}for(var s=w[g].units;!(u>=s.length);u++){var i=s[u];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(w,g,u,l,i,o),!o)return}}},F}();W.default=O},"./src/demux/transmuxer-interface.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s});var N=R("./node_modules/webworkify-webpack/index.js"),S=R.n(N),O=R("./src/events.ts"),F=R("./src/demux/transmuxer.ts"),B=R("./src/utils/logger.ts"),e=R("./src/errors.ts"),w=R("./src/utils/mediasource-helper.ts"),g=R("./node_modules/eventemitter3/index.js"),u=R.n(g),l=Object(w.getMediaSource)()||{isTypeSupported:function(){return!1}},s=function(){function i(a,r,n,t){var v=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=n,this.onFlush=t;var c=a.config,p=function(m,h){h=h||{},h.frag=v.frag,h.id=v.id,a.trigger(m,h)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,p),this.observer.on(O.Events.ERROR,p);var b={mp4:l.isTypeSupported("video/mp4"),mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"')},y=navigator.vendor;if(c.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var d;try{d=this.worker=N("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),d.addEventListener("message",this.onwmsg),d.onerror=function(f){a.trigger(O.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(f.message+" ("+f.filename+":"+f.lineno+")")})},d.postMessage({cmd:"init",typeSupported:b,vendor:y,id:r,config:JSON.stringify(c)})}catch(f){B.logger.warn("Error in worker:",f),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),d&&self.URL.revokeObjectURL(d.objectURL),this.transmuxer=new F.default(this.observer,b,c,y,r),this.worker=null}}else this.transmuxer=new F.default(this.observer,b,c,y,r)}var o=i.prototype;return o.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},o.push=function(r,n,t,v,c,p,b,y,d,f){var m=this;d.transmuxing.start=self.performance.now();var h=this.transmuxer,E=this.worker,_=p?p.start:c.start,T=c.decryptdata,k=this.frag,D=!(k&&c.cc===k.cc),x=!(k&&d.level===k.level),P=k?d.sn-k.sn:-1,H=this.part?d.part-this.part.index:1,I=!x&&(P===1||P===0&&H===1),V=self.performance.now();(x||P||c.stats.parsing.start===0)&&(c.stats.parsing.start=V),p&&(H||!I)&&(p.stats.parsing.start=V);var $=new F.TransmuxState(D,I,y,x,_);if(!I||D){B.logger.log("[transmuxer-interface, "+c.type+"]: Starting new transmux session for sn: "+d.sn+" p: "+d.part+" level: "+d.level+" id: "+d.id+`
|
|
discontinuity: `+D+`
|
|
trackSwitch: `+x+`
|
|
contiguous: `+I+`
|
|
accurateTimeOffset: `+y+`
|
|
timeOffset: `+_);var ge=new F.TransmuxConfig(t,v,n,b,f);this.configureTransmuxer(ge)}if(this.frag=c,this.part=p,E)E.postMessage({cmd:"demux",data:r,decryptdata:T,chunkMeta:d,state:$},r instanceof ArrayBuffer?[r]:[]);else if(h){var te=h.push(r,T,d,$);Object(F.isPromise)(te)?te.then(function(be){m.handleTransmuxComplete(be)}):this.handleTransmuxComplete(te)}},o.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:r});else if(t){var c=t.flush(r);Object(F.isPromise)(c)?c.then(function(p){n.handleFlushResult(p,r)}):this.handleFlushResult(c,r)}},o.handleFlushResult=function(r,n){var t=this;r.forEach(function(v){t.handleTransmuxComplete(v)}),this.onFlush(n)},o.onWorkerMessage=function(r){var n=r.data,t=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,t.trigger(n.event,n.data);break}}},o.configureTransmuxer=function(r){var n=this.worker,t=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},o.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},i}()},"./src/demux/transmuxer-worker.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/demux/transmuxer.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./node_modules/eventemitter3/index.js"),B=R.n(F);function e(s){var i=new F.EventEmitter,o=function(r,n){s.postMessage({event:r,data:n})};i.on(S.Events.FRAG_DECRYPTED,o),i.on(S.Events.ERROR,o),s.addEventListener("message",function(a){var r=a.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);s.transmuxer=new N.default(i,r.typeSupported,n,r.vendor,r.id),Object(O.enableLogs)(n.debug),o("init",null);break}case"configure":{s.transmuxer.configure(r.config);break}case"demux":{var t=s.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(N.isPromise)(t)?t.then(function(p){w(s,p)}):w(s,t);break}case"flush":{var v=r.chunkMeta,c=s.transmuxer.flush(v);Object(N.isPromise)(c)?c.then(function(p){u(s,p,v)}):u(s,c,v);break}default:break}})}function w(s,i){if(l(i.remuxResult))return;var o=[],a=i.remuxResult,r=a.audio,n=a.video;r&&g(o,r),n&&g(o,n),s.postMessage({event:"transmuxComplete",data:i},o)}function g(s,i){i.data1&&s.push(i.data1.buffer),i.data2&&s.push(i.data2.buffer)}function u(s,i,o){i.forEach(function(a){w(s,a)}),s.postMessage({event:"flush",data:o})}function l(s){return!s.audio&&!s.video&&!s.text&&!s.id3&&!s.initSegment}},"./src/demux/transmuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n}),R.d(W,"isPromise",function(){return c}),R.d(W,"TransmuxConfig",function(){return p}),R.d(W,"TransmuxState",function(){return b});var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/crypt/decrypter.ts"),F=R("./src/demux/aacdemuxer.ts"),B=R("./src/demux/mp4demuxer.ts"),e=R("./src/demux/tsdemuxer.ts"),w=R("./src/demux/mp3demuxer.ts"),g=R("./src/remux/mp4-remuxer.ts"),u=R("./src/remux/passthrough-remuxer.ts"),l=R("./src/demux/chunk-cache.ts"),s=R("./src/utils/mp4-tools.ts"),i=R("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(y){i.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var a=[{demux:e.default,remux:g.default},{demux:B.default,remux:u.default},{demux:F.default,remux:g.default},{demux:w.default,remux:g.default}],r=1024;a.forEach(function(y){var d=y.demux;r=Math.max(r,d.minProbeByteLength)});var n=function(){function y(f,m,h,E,_){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=f,this.typeSupported=m,this.config=h,this.vendor=E,this.id=_}var d=y.prototype;return d.configure=function(m){this.transmuxConfig=m,this.decrypter&&this.decrypter.reset()},d.push=function(m,h,E,_){var T=this,k=E.transmuxing;k.executeStart=o();var D=new Uint8Array(m),x=this.cache,P=this.config,H=this.currentTransmuxState,I=this.transmuxConfig;_&&(this.currentTransmuxState=_);var V=t(D,h);if(V&&V.method==="AES-128"){var $=this.getDecrypter();if(P.enableSoftwareAES){var ge=$.softwareDecrypt(D,V.key.buffer,V.iv.buffer);if(!ge)return k.executeEnd=o(),v(E);D=new Uint8Array(ge)}else return this.decryptionPromise=$.webCryptoDecrypt(D,V.key.buffer,V.iv.buffer).then(function(Ee){var Oe=T.push(Ee,null,E);return T.decryptionPromise=null,Oe}),this.decryptionPromise}var te=_||H,be=te.contiguous,ve=te.discontinuity,oe=te.trackSwitch,le=te.accurateTimeOffset,_e=te.timeOffset,ee=I.audioCodec,L=I.videoCodec,A=I.defaultInitPts,C=I.duration,U=I.initSegmentData;if((ve||oe)&&this.resetInitSegment(U,ee,L,C),ve&&this.resetInitialTimestamp(A),be||this.resetContiguity(),this.needsProbing(D,ve,oe)){if(x.dataLength){var K=x.flush();D=Object(s.appendUint8Array)(K,D)}this.configureTransmuxer(D,I)}var M=this.transmux(D,V,_e,le,E),ie=this.currentTransmuxState;return ie.contiguous=!0,ie.discontinuity=!1,ie.trackSwitch=!1,k.executeEnd=o(),M},d.flush=function(m){var h=this,E=m.transmuxing;E.executeStart=o();var _=this.decrypter,T=this.cache,k=this.currentTransmuxState,D=this.decryptionPromise;if(D)return D.then(function(){return h.flush(m)});var x=[],P=k.timeOffset;if(_){var H=_.flush();H&&x.push(this.push(H,null,m))}var I=T.dataLength;T.reset();var V=this.demuxer,$=this.remuxer;if(!V||!$)return I>=r&&this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=o(),[v(m)];var ge=V.flush(P);return c(ge)?ge.then(function(te){return h.flushRemux(x,te,m),x}):(this.flushRemux(x,ge,m),x)},d.flushRemux=function(m,h,E){var _=h.audioTrack,T=h.avcTrack,k=h.id3Track,D=h.textTrack,x=this.currentTransmuxState,P=x.accurateTimeOffset,H=x.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var I=this.remuxer.remux(_,T,k,D,H,P,!0,this.id);m.push({remuxResult:I,chunkMeta:E}),E.transmuxing.executeEnd=o()},d.resetInitialTimestamp=function(m){var h=this.demuxer,E=this.remuxer;if(!h||!E)return;h.resetTimeStamp(m),E.resetTimeStamp(m)},d.resetContiguity=function(){var m=this.demuxer,h=this.remuxer;if(!m||!h)return;m.resetContiguity(),h.resetNextTimestamp()},d.resetInitSegment=function(m,h,E,_){var T=this.demuxer,k=this.remuxer;if(!T||!k)return;T.resetInitSegment(h,E,_),k.resetInitSegment(m,h,E)},d.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},d.transmux=function(m,h,E,_,T){var k;return h&&h.method==="SAMPLE-AES"?k=this.transmuxSampleAes(m,h,E,_,T):k=this.transmuxUnencrypted(m,E,_,T),k},d.transmuxUnencrypted=function(m,h,E,_){var T=this.demuxer.demux(m,h,!1,!this.config.progressive),k=T.audioTrack,D=T.avcTrack,x=T.id3Track,P=T.textTrack,H=this.remuxer.remux(k,D,x,P,h,E,!1,this.id);return{remuxResult:H,chunkMeta:_}},d.transmuxSampleAes=function(m,h,E,_,T){var k=this;return this.demuxer.demuxSampleAes(m,h,E).then(function(D){var x=k.remuxer.remux(D.audioTrack,D.avcTrack,D.id3Track,D.textTrack,E,_,!1,k.id);return{remuxResult:x,chunkMeta:T}})},d.configureTransmuxer=function(m,h){for(var E=this.config,_=this.observer,T=this.typeSupported,k=this.vendor,D=h.audioCodec,x=h.defaultInitPts,P=h.duration,H=h.initSegmentData,I=h.videoCodec,V,$=0,ge=a.length;$<ge;$++)if(a[$].demux.probe(m)){V=a[$];break}V||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:B.default,remux:u.default});var te=this.demuxer,be=this.remuxer,ve=V.remux,oe=V.demux;(!be||!(be instanceof ve))&&(this.remuxer=new ve(_,E,T,k)),(!te||!(te instanceof oe))&&(this.demuxer=new oe(_,E,T),this.probe=oe.probe),this.resetInitSegment(H,D,I,P),this.resetInitialTimestamp(x)},d.needsProbing=function(m,h,E){return!this.demuxer||!this.remuxer||h||E},d.getDecrypter=function(){var m=this.decrypter;return m||(m=this.decrypter=new O.default(this.observer,this.config)),m},y}();function t(y,d){var f=null;return y.byteLength>0&&d!=null&&d.key!=null&&d.iv!==null&&d.method!=null&&(f=d),f}var v=function(d){return{remuxResult:{},chunkMeta:d}};function c(y){return"then"in y&&y.then instanceof Function}var p=function(d,f,m,h,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=d,this.videoCodec=f,this.initSegmentData=m,this.duration=h,this.defaultInitPts=E},b=function(d,f,m,h,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=d,this.contiguous=f,this.accurateTimeOffset=m,this.trackSwitch=h,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"discardEPB",function(){return v});var N=R("./src/demux/adts.ts"),S=R("./src/demux/mpegaudio.ts"),O=R("./src/demux/exp-golomb.ts"),F=R("./src/demux/id3.ts"),B=R("./src/demux/sample-aes.ts"),e=R("./src/events.ts"),w=R("./src/utils/mp4-tools.ts"),g=R("./src/utils/logger.ts"),u=R("./src/errors.ts"),l={video:1,audio:2,id3:3,text:4},s=function(){function c(b,y,d){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=b,this.config=y,this.typeSupported=d}c.probe=function(y){var d=c.syncOffset(y);return d<0?!1:(d&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+d+", junk ahead ?"),!0)},c.syncOffset=function(y){for(var d=Math.min(1e3,y.length-3*188),f=0;f<d;){if(y[f]===71&&y[f+188]===71&&y[f+2*188]===71)return f;f++}return-1},c.createTrack=function(y,d){return{container:y==="video"||y==="audio"?"video/mp2t":void 0,type:y,id:l[y],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:y==="audio"?d:void 0}};var p=c.prototype;return p.resetInitSegment=function(y,d,f){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=c.createTrack("video",f),this._audioTrack=c.createTrack("audio",f),this._id3Track=c.createTrack("id3",f),this._txtTrack=c.createTrack("text",f),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=y,this.videoCodec=d,this._duration=f},p.resetTimeStamp=function(){},p.resetContiguity=function(){var y=this._audioTrack,d=this._avcTrack,f=this._id3Track;y&&(y.pesData=null),d&&(d.pesData=null),f&&(f.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(y,d,f,m){f===void 0&&(f=!1),m===void 0&&(m=!1),f||(this.sampleAes=null);var h,E=this._avcTrack,_=this._audioTrack,T=this._id3Track,k=E.pid,D=E.pesData,x=_.pid,P=T.pid,H=_.pesData,I=T.pesData,V=!1,$=this.pmtParsed,ge=this._pmtId,te=y.length;if(this.remainderData&&(y=Object(w.appendUint8Array)(this.remainderData,y),te=y.length,this.remainderData=null),te<188&&!m)return this.remainderData=y,{audioTrack:_,avcTrack:E,id3Track:T,textTrack:this._txtTrack};var be=Math.max(0,c.syncOffset(y));te-=(te+be)%188,te<y.byteLength&&!m&&(this.remainderData=new Uint8Array(y.buffer,te,y.buffer.byteLength-te));for(var ve=be;ve<te;ve+=188)if(y[ve]===71){var oe=!!(y[ve+1]&64),le=((y[ve+1]&31)<<8)+y[ve+2],_e=(y[ve+3]&48)>>4,ee=void 0;if(_e>1){if(ee=ve+5+y[ve+4],ee===ve+188)continue}else ee=ve+4;switch(le){case k:oe&&(D&&(h=r(D))&&this.parseAVCPES(h,!1),D={data:[],size:0}),D&&(D.data.push(y.subarray(ee,ve+188)),D.size+=ve+188-ee);break;case x:oe&&(H&&(h=r(H))&&(_.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),H={data:[],size:0}),H&&(H.data.push(y.subarray(ee,ve+188)),H.size+=ve+188-ee);break;case P:oe&&(I&&(h=r(I))&&this.parseID3PES(h),I={data:[],size:0}),I&&(I.data.push(y.subarray(ee,ve+188)),I.size+=ve+188-ee);break;case 0:oe&&(ee+=y[ee]+1),ge=this._pmtId=o(y,ee);break;case ge:{oe&&(ee+=y[ee]+1);var L=a(y,ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,f);k=L.avc,k>0&&(E.pid=k),x=L.audio,x>0&&(_.pid=x,_.isAAC=L.isAAC),P=L.id3,P>0&&(T.pid=P),V&&!$&&(g.logger.log("reparse from beginning"),V=!1,ve=be-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=D,_.pesData=H,T.pesData=I;var A={audioTrack:_,avcTrack:E,id3Track:T,textTrack:this._txtTrack};return m&&this.extractRemainingSamples(A),A},p.flush=function(){var y=this.remainderData;this.remainderData=null;var d;return y?d=this.demux(y,-1,!1,!0):d={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(d),this.sampleAes?this.decrypt(d,this.sampleAes):d},p.extractRemainingSamples=function(y){var d=y.audioTrack,f=y.avcTrack,m=y.id3Track,h=f.pesData,E=d.pesData,_=m.pesData,T;h&&(T=r(h))?(this.parseAVCPES(T,!0),f.pesData=null):f.pesData=h,E&&(T=r(E))?(d.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),d.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),d.pesData=E),_&&(T=r(_))?(this.parseID3PES(T),m.pesData=null):m.pesData=_},p.demuxSampleAes=function(y,d,f){var m=this.demux(y,f,!0,!this.config.progressive),h=this.sampleAes=new B.default(this.observer,this.config,d);return this.decrypt(m,h)},p.decrypt=function(y,d){return new Promise(function(f){var m=y.audioTrack,h=y.avcTrack;m.samples&&m.isAAC?d.decryptAacSamples(m.samples,0,function(){h.samples?d.decryptAvcSamples(h.samples,0,0,function(){f(y)}):f(y)}):h.samples&&d.decryptAvcSamples(h.samples,0,0,function(){f(y)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(y,d){var f=this,m=this._avcTrack,h=this.parseAVCNALu(y.data),E=!1,_=this.avcSample,T,k=!1;y.data=null,_&&h.length&&!m.audFound&&(n(_,m),_=this.avcSample=i(!1,y.pts,y.dts,"")),h.forEach(function(D){switch(D.type){case 1:{T=!0,_||(_=f.avcSample=i(!0,y.pts,y.dts,"")),E&&(_.debug+="NDR "),_.frame=!0;var x=D.data;if(k&&x.length>4){var P=new O.default(x).readSliceType();(P===2||P===4||P===7||P===9)&&(_.key=!0)}break}case 5:T=!0,_||(_=f.avcSample=i(!0,y.pts,y.dts,"")),E&&(_.debug+="IDR "),_.key=!0,_.frame=!0;break;case 6:{T=!0,E&&_&&(_.debug+="SEI ");var H=new O.default(v(D.data));H.readUByte();for(var I=0,V=0,$=!1,ge=0;!$&&H.bytesAvailable>1;){I=0;do ge=H.readUByte(),I+=ge;while(ge===255);V=0;do ge=H.readUByte(),V+=ge;while(ge===255);if(I===4&&H.bytesAvailable!==0){$=!0;var te=H.readUByte();if(te===181){var be=H.readUShort();if(be===49){var ve=H.readUInt();if(ve===1195456820){var oe=H.readUByte();if(oe===3){for(var le=H.readUByte(),_e=H.readUByte(),ee=31&le,L=[le,_e],A=0;A<ee;A++)L.push(H.readUByte()),L.push(H.readUByte()),L.push(H.readUByte());t(f._txtTrack.samples,{type:3,pts:y.pts,bytes:L})}}}}}else if(I===5&&H.bytesAvailable!==0){if($=!0,V>16){for(var C=[],U=0;U<16;U++)C.push(H.readUByte().toString(16)),(U===3||U===5||U===7||U===9)&&C.push("-");for(var K=V-16,M=new Uint8Array(K),ie=0;ie<K;ie++)M[ie]=H.readUByte();t(f._txtTrack.samples,{pts:y.pts,payloadType:I,uuid:C.join(""),userData:Object(F.utf8ArrayToStr)(M),userDataBytes:M})}}else if(V<H.bytesAvailable)for(var Ee=0;Ee<V;Ee++)H.readUByte()}break}case 7:if(T=!0,k=!0,E&&_&&(_.debug+="SPS "),!m.sps){var Oe=new O.default(D.data),q=Oe.readSPS();m.width=q.width,m.height=q.height,m.pixelRatio=q.pixelRatio,m.sps=[D.data],m.duration=f._duration;for(var ce=D.data.subarray(1,4),Se="avc1.",Ce=0;Ce<3;Ce++){var Pe=ce[Ce].toString(16);Pe.length<2&&(Pe="0"+Pe),Se+=Pe}m.codec=Se}break;case 8:T=!0,E&&_&&(_.debug+="PPS "),m.pps||(m.pps=[D.data]);break;case 9:T=!1,m.audFound=!0,_&&n(_,m),_=f.avcSample=i(!1,y.pts,y.dts,E?"AUD ":"");break;case 12:T=!1;break;default:T=!1,_&&(_.debug+="unknown NAL "+D.type+" ");break}if(_&&T){var Ne=_.units;Ne.push(D)}}),d&&_&&(n(_,m),this.avcSample=null)},p.getLastNalUnit=function(){var y,d=this.avcSample,f;if(!d||d.units.length===0){var m=this._avcTrack.samples;d=m[m.length-1]}if((y=d)!==null&&y!==void 0&&y.units){var h=d.units;f=h[h.length-1]}return f},p.parseAVCNALu=function(y){var d=y.byteLength,f=this._avcTrack,m=f.naluState||0,h=m,E=[],_=0,T,k,D,x=-1,P=0;for(m===-1&&(x=0,P=y[0]&31,m=0,_=1);_<d;){if(T=y[_++],!m){m=T?0:1;continue}if(m===1){m=T?0:2;continue}if(!T)m=3;else if(T===1){if(x>=0){var H={data:y.subarray(x,_-m-1),type:P};E.push(H)}else{var I=this.getLastNalUnit();if(I&&(h&&_<=4-h&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-h))),k=_-m-1,k>0)){var V=new Uint8Array(I.data.byteLength+k);V.set(I.data,0),V.set(y.subarray(0,k),I.data.byteLength),I.data=V,I.state=0}}_<d?(D=y[_]&31,x=_,P=D,m=0):m=-1}else m=0}if(x>=0&&m>=0){var $={data:y.subarray(x,d),type:P,state:m};E.push($)}if(E.length===0){var ge=this.getLastNalUnit();if(ge){var te=new Uint8Array(ge.data.byteLength+y.byteLength);te.set(ge.data,0),te.set(y,ge.data.byteLength),ge.data=te}}return f.naluState=m,E},p.parseAACPES=function(y){var d=0,f=this._audioTrack,m=this.aacOverFlow,h=y.data;if(m){this.aacOverFlow=null;var E=m.sample.unit.byteLength,_=Math.min(m.missing,E),T=E-_;m.sample.unit.set(h.subarray(0,_),T),f.samples.push(m.sample),d=m.missing}var k,D;for(k=d,D=h.length;k<D-1&&!N.isHeader(h,k);k++);if(k!==d){var x,P;if(k<D-1?(x="AAC PES did not start with ADTS header,offset:"+k,P=!1):(x="no ADTS header found in AAC PES",P=!0),g.logger.warn("parsing error:"+x),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:x}),P)return}N.initTrackConfig(f,this.observer,h,k,this.audioCodec);var H;if(y.pts!==void 0)H=y.pts;else if(m){var I=N.getFrameDuration(f.samplerate);H=m.sample.pts+I}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;k<D;)if(N.isHeader(h,k)){if(k+5<D){var $=N.appendFrame(f,h,k,H,V);if($)if($.missing)this.aacOverFlow=$;else{k+=$.length,V++;continue}}break}else k++},p.parseMPEGPES=function(y){var d=y.data,f=d.length,m=0,h=0,E=y.pts;if(E===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<f;)if(S.isHeader(d,h)){var _=S.appendFrame(this._audioTrack,d,h,E,m);if(_)h+=_.length,m++;else break}else h++},p.parseID3PES=function(y){if(y.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(y)},c}();s.minProbeByteLength=188;function i(c,p,b,y){return{key:c,frame:!1,pts:p,dts:b,units:[],debug:y,length:0}}function o(c,p){return(c[p+10]&31)<<8|c[p+11]}function a(c,p,b,y){var d={audio:-1,avc:-1,id3:-1,isAAC:!0},f=(c[p+1]&15)<<8|c[p+2],m=p+3+f-4,h=(c[p+10]&15)<<8|c[p+11];for(p+=12+h;p<m;){var E=(c[p+1]&31)<<8|c[p+2];switch(c[p]){case 207:if(!y){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:d.audio===-1&&(d.audio=E);break;case 21:d.id3===-1&&(d.id3=E);break;case 219:if(!y){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:d.avc===-1&&(d.avc=E);break;case 3:case 4:b?d.audio===-1&&(d.audio=E,d.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((c[p+3]&15)<<8|c[p+4])+5}return d}function r(c){var p=0,b,y,d,f,m,h=c.data;if(!c||c.size===0)return null;for(;h[0].length<19&&h.length>1;){var E=new Uint8Array(h[0].length+h[1].length);E.set(h[0]),E.set(h[1],h[0].length),h[0]=E,h.splice(1,1)}b=h[0];var _=(b[0]<<16)+(b[1]<<8)+b[2];if(_===1){if(y=(b[4]<<8)+b[5],y&&y>c.size-6)return null;var T=b[7];T&192&&(f=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2,T&64?(m=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,f-m>60*9e4&&(g.logger.warn(Math.round((f-m)/9e4)+"s delta between PTS and DTS, align them"),f=m)):m=f),d=b[8];var k=d+9;if(c.size<=k)return null;c.size-=k;for(var D=new Uint8Array(c.size),x=0,P=h.length;x<P;x++){b=h[x];var H=b.byteLength;if(k)if(k>H){k-=H;continue}else b=b.subarray(k),H-=k,k=0;D.set(b,p),p+=H}return y&&(y-=d+3),{data:D,pts:f,dts:m,len:y}}return null}function n(c,p){if(c.units.length&&c.frame){if(c.pts===void 0){var b=p.samples,y=b.length;if(y){var d=b[y-1];c.pts=d.pts,c.dts=d.dts}else{p.dropped++;return}}p.samples.push(c)}c.debug.length&&g.logger.log(c.pts+"/"+c.dts+":"+c.debug)}function t(c,p){var b=c.length;if(b>0){if(p.pts>=c[b-1].pts)c.push(p);else for(var y=b-1;y>=0;y--)if(p.pts<c[y].pts){c.splice(y,0,p);break}}else c.push(p)}function v(c){for(var p=c.byteLength,b=[],y=1;y<p-2;)c[y]===0&&c[y+1]===0&&c[y+2]===3?(b.push(y+2),y+=2):y++;if(b.length===0)return c;var d=p-b.length,f=new Uint8Array(d),m=0;for(y=0;y<d;m++,y++)m===b[0]&&(m++,b.shift()),f[y]=c[m];return f}W.default=s},"./src/errors.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ErrorTypes",function(){return N}),R.d(W,"ErrorDetails",function(){return S});var N;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(N||(N={}));var S;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(S||(S={}))},"./src/events.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"Events",function(){return N});var N;(function(S){S.MEDIA_ATTACHING="hlsMediaAttaching",S.MEDIA_ATTACHED="hlsMediaAttached",S.MEDIA_DETACHING="hlsMediaDetaching",S.MEDIA_DETACHED="hlsMediaDetached",S.BUFFER_RESET="hlsBufferReset",S.BUFFER_CODECS="hlsBufferCodecs",S.BUFFER_CREATED="hlsBufferCreated",S.BUFFER_APPENDING="hlsBufferAppending",S.BUFFER_APPENDED="hlsBufferAppended",S.BUFFER_EOS="hlsBufferEos",S.BUFFER_FLUSHING="hlsBufferFlushing",S.BUFFER_FLUSHED="hlsBufferFlushed",S.MANIFEST_LOADING="hlsManifestLoading",S.MANIFEST_LOADED="hlsManifestLoaded",S.MANIFEST_PARSED="hlsManifestParsed",S.LEVEL_SWITCHING="hlsLevelSwitching",S.LEVEL_SWITCHED="hlsLevelSwitched",S.LEVEL_LOADING="hlsLevelLoading",S.LEVEL_LOADED="hlsLevelLoaded",S.LEVEL_UPDATED="hlsLevelUpdated",S.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",S.LEVELS_UPDATED="hlsLevelsUpdated",S.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",S.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",S.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",S.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",S.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",S.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",S.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",S.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",S.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",S.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",S.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",S.CUES_PARSED="hlsCuesParsed",S.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",S.INIT_PTS_FOUND="hlsInitPtsFound",S.FRAG_LOADING="hlsFragLoading",S.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",S.FRAG_LOADED="hlsFragLoaded",S.FRAG_DECRYPTED="hlsFragDecrypted",S.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",S.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",S.FRAG_PARSING_METADATA="hlsFragParsingMetadata",S.FRAG_PARSED="hlsFragParsed",S.FRAG_BUFFERED="hlsFragBuffered",S.FRAG_CHANGED="hlsFragChanged",S.FPS_DROP="hlsFpsDrop",S.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",S.ERROR="hlsError",S.DESTROYING="hlsDestroying",S.KEY_LOADING="hlsKeyLoading",S.KEY_LOADED="hlsKeyLoaded",S.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",S.BACK_BUFFER_REACHED="hlsBackBufferReached"})(N||(N={}))},"./src/hls.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return c});var N=R("./node_modules/url-toolkit/src/url-toolkit.js"),S=R.n(N),O=R("./src/loader/playlist-loader.ts"),F=R("./src/loader/key-loader.ts"),B=R("./src/controller/id3-track-controller.ts"),e=R("./src/controller/latency-controller.ts"),w=R("./src/controller/level-controller.ts"),g=R("./src/controller/fragment-tracker.ts"),u=R("./src/controller/stream-controller.ts"),l=R("./src/is-supported.ts"),s=R("./src/utils/logger.ts"),i=R("./src/config.ts"),o=R("./node_modules/eventemitter3/index.js"),a=R.n(o),r=R("./src/events.ts"),n=R("./src/errors.ts");function t(p,b){for(var y=0;y<b.length;y++){var d=b[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function v(p,b,y){return b&&t(p.prototype,b),y&&t(p,y),p}var c=function(){p.isSupported=function(){return Object(l.isSupported)()};function p(y){y===void 0&&(y={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.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 d=this.config=Object(i.mergeConfig)(p.DefaultConfig,y);this.userConfig=y,Object(s.enableLogs)(d.debug),this._autoLevelCapping=-1,d.progressive&&Object(i.enableStreamingMode)(d);var f=d.abrController,m=d.bufferController,h=d.capLevelController,E=d.fpsController,_=this.abrController=new f(this),T=this.bufferController=new m(this),k=this.capLevelController=new h(this),D=new E(this),x=new O.default(this),P=new F.default(this),H=new B.default(this),I=this.levelController=new w.default(this),V=new g.FragmentTracker(this),$=this.streamController=new u.default(this,V);k.setStreamController($),D.setStreamController($);var ge=[I,$];this.networkControllers=ge;var te=[x,P,_,T,k,D,H,V];this.audioTrackController=this.createController(d.audioTrackController,null,ge),this.createController(d.audioStreamController,V,ge),this.subtitleTrackController=this.createController(d.subtitleTrackController,null,ge),this.createController(d.subtitleStreamController,V,ge),this.createController(d.timelineController,null,te),this.emeController=this.createController(d.emeController,null,te),this.cmcdController=this.createController(d.cmcdController,null,te),this.latencyController=this.createController(e.default,null,te),this.coreComponents=te}var b=p.prototype;return b.createController=function(d,f,m){if(d){var h=f?new d(this,f):new d(this);return m&&m.push(h),h}return null},b.on=function(d,f,m){m===void 0&&(m=this),this._emitter.on(d,f,m)},b.once=function(d,f,m){m===void 0&&(m=this),this._emitter.once(d,f,m)},b.removeAllListeners=function(d){this._emitter.removeAllListeners(d)},b.off=function(d,f,m,h){m===void 0&&(m=this),this._emitter.off(d,f,m,h)},b.listeners=function(d){return this._emitter.listeners(d)},b.emit=function(d,f,m){return this._emitter.emit(d,f,m)},b.trigger=function(d,f){if(this.config.debug)return this.emit(d,d,f);try{return this.emit(d,d,f)}catch(m){s.logger.error("An internal error happened while handling event "+d+'. Error message: "'+m.message+'". Here is a stacktrace:',m),this.trigger(r.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:d,error:m})}return!1},b.listenerCount=function(d){return this._emitter.listenerCount(d)},b.destroy=function(){s.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(d){return d.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(d){return d.destroy()}),this.coreComponents.length=0},b.attachMedia=function(d){s.logger.log("attachMedia"),this._media=d,this.trigger(r.Events.MEDIA_ATTACHING,{media:d})},b.detachMedia=function(){s.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(d){this.stopLoad();var f=this.media,m=this.url,h=this.url=N.buildAbsoluteURL(self.location.href,d,{alwaysNormalize:!0});s.logger.log("loadSource:"+h),f&&m&&m!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(f)),this.trigger(r.Events.MANIFEST_LOADING,{url:d})},b.startLoad=function(d){d===void 0&&(d=-1),s.logger.log("startLoad("+d+")"),this.networkControllers.forEach(function(f){f.startLoad(d)})},b.stopLoad=function(){s.logger.log("stopLoad"),this.networkControllers.forEach(function(d){d.stopLoad()})},b.swapAudioCodec=function(){s.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){s.logger.log("recoverMediaError");var d=this._media;this.detachMedia(),d&&this.attachMedia(d)},b.removeLevel=function(d,f){f===void 0&&(f=0),this.levelController.removeLevel(d,f)},v(p,[{key:"levels",get:function(){var d=this.levelController.levels;return d||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(d){s.logger.log("set currentLevel:"+d),this.loadLevel=d,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(d){s.logger.log("set nextLevel:"+d),this.levelController.manualLevel=d,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(d){s.logger.log("set loadLevel:"+d),this.levelController.manualLevel=d}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(d){this.levelController.nextLoadLevel=d}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(d){s.logger.log("set firstLevel:"+d),this.levelController.firstLevel=d}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(d){s.logger.log("set startLevel:"+d),d!==-1&&(d=Math.max(d,this.minAutoLevel)),this.levelController.startLevel=d}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(d){var f=!!d;f!==this.config.capLevelToPlayerSize&&(f?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=f)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(d){this._autoLevelCapping!==d&&(s.logger.log("set autoLevelCapping:"+d),this._autoLevelCapping=d)}},{key:"bandwidthEstimate",get:function(){var d=this.abrController.bwEstimator;return d?d.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var d=this.levels,f=this.config.minAutoBitrate;if(!d)return 0;for(var m=d.length,h=0;h<m;h++)if(d[h].maxBitrate>f)return h;return 0}},{key:"maxAutoLevel",get:function(){var d=this.levels,f=this.autoLevelCapping,m;return f===-1&&d&&d.length?m=d.length-1:m=f,m}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(d){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,d)}},{key:"audioTracks",get:function(){var d=this.audioTrackController;return d?d.audioTracks:[]}},{key:"audioTrack",get:function(){var d=this.audioTrackController;return d?d.audioTrack:-1},set:function(d){var f=this.audioTrackController;f&&(f.audioTrack=d)}},{key:"subtitleTracks",get:function(){var d=this.subtitleTrackController;return d?d.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var d=this.subtitleTrackController;return d?d.subtitleTrack:-1},set:function(d){var f=this.subtitleTrackController;f&&(f.subtitleTrack=d)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var d=this.subtitleTrackController;return d?d.subtitleDisplay:!1},set:function(d){var f=this.subtitleTrackController;f&&(f.subtitleDisplay=d)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(d){this.config.lowLatencyMode=d}},{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 n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:i.hlsDefaultConfig},set:function(d){p.defaultConfig=d}}]),p}();c.defaultConfig=void 0},"./src/is-supported.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isSupported",function(){return O}),R.d(W,"changeTypeSupported",function(){return F});var N=R("./src/utils/mediasource-helper.ts");function S(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var B=Object(N.getMediaSource)();if(!B)return!1;var e=S(),w=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!w&&!!g}function F(){var B,e=S();return typeof(e==null||((B=e.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s}),R.d(W,"LoadError",function(){return o});var N=R("./src/polyfills/number.ts"),S=R("./src/errors.ts");function O(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,g(a,r)}function F(a){var r=typeof Map=="function"?new Map:void 0;return F=function(t){if(t===null||!w(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,v)}function v(){return B(t,arguments,u(this).constructor)}return v.prototype=Object.create(t.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g(v,t)},F(a)}function B(a,r,n){return e()?B=Reflect.construct:B=function(v,c,p){var b=[null];b.push.apply(b,c);var y=Function.bind.apply(v,b),d=new y;return p&&g(d,p.prototype),d},B.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 w(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function g(a,r){return g=Object.setPrototypeOf||function(t,v){return t.__proto__=v,t},g(a,r)}function u(a){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},u(a)}var l=Math.pow(2,17),s=function(){function a(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}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,v){var c=this,p=t.url;if(!p)return Promise.reject(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var b=this.config,y=b.fLoader,d=b.loader;return new Promise(function(f,m){c.loader&&c.loader.destroy();var h=c.loader=t.loader=y?new y(b):new d(b),E=i(t),_={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:l};t.stats=h.stats,h.load(E,_,{onSuccess:function(k,D,x,P){c.resetLoader(t,h),f({frag:t,part:null,payload:k.data,networkDetails:P})},onError:function(k,D,x){c.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:k,networkDetails:x}))},onAbort:function(k,D,x){c.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:x}))},onTimeout:function(k,D,x){c.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:x}))},onProgress:function(k,D,x,P){v&&v({frag:t,part:null,payload:x,networkDetails:P})}})})},r.loadPart=function(t,v,c){var p=this;this.abort();var b=this.config,y=b.fLoader,d=b.loader;return new Promise(function(f,m){p.loader&&p.loader.destroy();var h=p.loader=t.loader=y?new y(b):new d(b),E=i(t,v),_={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:l};v.stats=h.stats,h.load(E,_,{onSuccess:function(k,D,x,P){p.resetLoader(t,h),p.updateStatsFromPart(t,v);var H={frag:t,part:v,payload:k.data,networkDetails:P};c(H),f(H)},onError:function(k,D,x){p.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:v,response:k,networkDetails:x}))},onAbort:function(k,D,x){t.stats.aborted=v.stats.aborted,p.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:v,networkDetails:x}))},onTimeout:function(k,D,x){p.resetLoader(t,h),m(new o({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:v,networkDetails:x}))}})})},r.updateStatsFromPart=function(t,v){var c=t.stats,p=v.stats,b=p.total;if(c.loaded+=p.loaded,b){var y=Math.round(t.duration/v.duration),d=Math.min(Math.round(c.loaded/b),y),f=y-d,m=f*Math.round(c.loaded/d);c.total=c.loaded+m}else c.total=Math.max(c.loaded,c.total);var h=c.loading,E=p.loading;h.start?h.first+=E.first-E.start:(h.start=E.start,h.first=E.first),h.end=E.end},r.resetLoader=function(t,v){t.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},a}();function i(a,r){r===void 0&&(r=null);var n=r||a,t={frag:a,part:r,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},v=n.byteRangeStartOffset,c=n.byteRangeEndOffset;return Object(N.isFiniteNumber)(v)&&Object(N.isFiniteNumber)(c)&&(t.rangeStart=v,t.rangeEnd=c),t}var o=function(a){O(r,a);function r(n){for(var t,v=arguments.length,c=new Array(v>1?v-1:0),p=1;p<v;p++)c[p-1]=arguments[p];return t=a.call.apply(a,[this].concat(c))||this,t.data=void 0,t.data=n,t}return r}(F(Error))},"./src/loader/fragment.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ElementaryStreamTypes",function(){return s}),R.d(W,"BaseSegment",function(){return i}),R.d(W,"Fragment",function(){return o}),R.d(W,"Part",function(){return a});var N=R("./src/polyfills/number.ts"),S=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(S),F=R("./src/utils/logger.ts"),B=R("./src/loader/level-key.ts"),e=R("./src/loader/load-stats.ts");function w(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,g(r,n)}function g(r,n){return g=Object.setPrototypeOf||function(v,c){return v.__proto__=c,v},g(r,n)}function u(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function l(r,n,t){return n&&u(r.prototype,n),t&&u(r,t),r}var s;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(s||(s={}));var i=function(){function r(t){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[s.AUDIO]=null,v[s.VIDEO]=null,v[s.AUDIOVIDEO]=null,v),this.baseurl=t}var n=r.prototype;return n.setByteRange=function(v,c){var p=v.split("@",2),b=[];p.length===1?b[0]=c?c.byteRangeEndOffset:0:b[0]=parseInt(p[1]),b[1]=parseInt(p[0])+b[0],this._byteRange=b},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(S.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),r}(),o=function(r){w(n,r);function n(v,c){var p;return p=r.call(this,c)||this,p._decryptdata=null,p.rawProgramDateTime=null,p.programDateTime=null,p.tagList=[],p.duration=0,p.sn=0,p.levelkey=void 0,p.type=void 0,p.loader=null,p.level=-1,p.cc=0,p.startPTS=void 0,p.endPTS=void 0,p.appendedPTS=void 0,p.startDTS=void 0,p.endDTS=void 0,p.start=0,p.deltaPTS=void 0,p.maxStartPTS=void 0,p.minEndPTS=void 0,p.stats=new e.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=v,p}var t=n.prototype;return t.createInitializationVector=function(c){for(var p=new Uint8Array(16),b=12;b<16;b++)p[b]=c>>8*(15-b)&255;return p},t.setDecryptDataFromLevelKey=function(c,p){var b=c;return(c==null?void 0:c.method)==="AES-128"&&c.uri&&!c.iv&&(b=B.LevelKey.fromURI(c.uri),b.method=c.method,b.iv=this.createInitializationVector(p),b.keyFormat="identity"),b},t.setElementaryStreamInfo=function(c,p,b,y,d,f){f===void 0&&(f=!1);var m=this.elementaryStreams,h=m[c];if(!h){m[c]={startPTS:p,endPTS:b,startDTS:y,endDTS:d,partial:f};return}h.startPTS=Math.min(h.startPTS,p),h.endPTS=Math.max(h.endPTS,b),h.startDTS=Math.min(h.startDTS,y),h.endDTS=Math.max(h.endDTS,d)},t.clearElementaryStreamInfo=function(){var c=this.elementaryStreams;c[s.AUDIO]=null,c[s.VIDEO]=null,c[s.AUDIOVIDEO]=null},l(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var c=this.sn;typeof c!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&F.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),c=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,c)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(N.isFiniteNumber)(this.programDateTime))return null;var c=Object(N.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+c*1e3}},{key:"encrypted",get:function(){var c;return!!((c=this.decryptdata)!==null&&c!==void 0&&c.keyFormat&&this.decryptdata.uri)}}]),n}(i),a=function(r){w(n,r);function n(t,v,c,p,b){var y;y=r.call(this,c)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new e.LoadStats,y.duration=t.decimalFloatingPoint("DURATION"),y.gap=t.bool("GAP"),y.independent=t.bool("INDEPENDENT"),y.relurl=t.enumeratedString("URI"),y.fragment=v,y.index=p;var d=t.enumeratedString("BYTERANGE");return d&&y.setByteRange(d,b),b&&(y.fragOffset=b.fragOffset+b.duration),y}return l(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),n}(i)},"./src/loader/key-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=function(){function B(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var e=B.prototype;return e._registerListeners=function(){this.hls.on(N.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(N.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var u=this.loaders[g];u&&u.destroy()}this.loaders={}},e.onKeyLoading=function(g,u){var l=u.frag,s=l.type,i=this.loaders[s];if(!l.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=l.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(i&&(O.logger.warn("abort previous key loader for type:"+s),i.abort()),!o){O.logger.warn("key uri is falsy");return}var r=a.loader,n=l.loader=this.loaders[s]=new r(a);this.decrypturl=o,this.decryptkey=null;var t={url:o,frag:l,responseType:"arraybuffer"},v={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(t,v,c)}else this.decryptkey&&(l.decryptdata.key=this.decryptkey,this.hls.trigger(N.Events.KEY_LOADED,{frag:l}))},e.loadsuccess=function(g,u,l){var s=l.frag;if(!s.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=s.decryptdata.key=new Uint8Array(g.data),s.loader=null,delete this.loaders[s.type],this.hls.trigger(N.Events.KEY_LOADED,{frag:s})},e.loaderror=function(g,u){var l=u.frag,s=l.loader;s&&s.abort(),delete this.loaders[l.type],this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:g})},e.loadtimeout=function(g,u){var l=u.frag,s=l.loader;s&&s.abort(),delete this.loaders[l.type],this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},B}()},"./src/loader/level-details.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LevelDetails",function(){return B});var N=R("./src/polyfills/number.ts");function S(e,w){for(var g=0;g<w.length;g++){var u=w[g];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function O(e,w,g){return w&&S(e.prototype,w),g&&S(e,g),e}var F=10,B=function(){function e(g){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=g}var w=e.prototype;return w.reloaded=function(u){if(!u){this.advanced=!0,this.updated=!0;return}var l=this.lastPartSn-u.lastPartSn,s=this.lastPartIndex-u.lastPartIndex;this.updated=this.endSN!==u.endSN||!!s||!!l,this.advanced=this.endSN>u.endSN||l>0||l===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(u.misses*.6):this.misses=u.misses+1,this.availabilityDelay=u.availabilityDelay},O(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(N.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var u=this.driftEndTime-this.driftStartTime;if(u>0){var l=this.driftEnd-this.driftStart;return l*1e3/u}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var u;return(u=this.fragments)!==null&&u!==void 0&&u.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 u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LevelKey",function(){return B});var N=R("./node_modules/url-toolkit/src/url-toolkit.js"),S=R.n(N);function O(e,w){for(var g=0;g<w.length;g++){var u=w[g];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}function F(e,w,g){return w&&O(e.prototype,w),g&&O(e,g),e}var B=function(){e.fromURL=function(g,u){return new e(g,u)},e.fromURI=function(g){return new e(g)};function e(w,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(N.buildAbsoluteURL)(w,g,{alwaysNormalize:!0}):this._uri=w}return F(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LoadStats",function(){return N});var N=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(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n});var N=R("./src/polyfills/number.ts"),S=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(S),F=R("./src/loader/fragment.ts"),B=R("./src/loader/level-details.ts"),e=R("./src/loader/level-key.ts"),w=R("./src/utils/attr-list.ts"),g=R("./src/utils/logger.ts"),u=R("./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,s=/#EXT-X-MEDIA:(.*)/g,i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=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(b){var y,d;return a.test((y=(d=S.parseURL(b))===null||d===void 0?void 0:d.path)!=null?y:"")}var n=function(){function b(){}return b.findGroup=function(d,f){for(var m=0;m<d.length;m++){var h=d[m];if(h.id===f)return h}},b.convertAVC1ToAVCOTI=function(d){var f=d.split(".");if(f.length>2){var m=f.shift()+".";return m+=parseInt(f.shift()).toString(16),m+=("000"+parseInt(f.shift()).toString(16)).substr(-4),m}return d},b.resolve=function(d,f){return S.buildAbsoluteURL(f,d,{alwaysNormalize:!0})},b.parseMasterPlaylist=function(d,f){var m=[],h={},E=!1;l.lastIndex=0;for(var _;(_=l.exec(d))!=null;)if(_[1]){var T=new w.AttrList(_[1]),k={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:b.resolve(_[2],f)},D=T.decimalResolution("RESOLUTION");D&&(k.width=D.width,k.height=D.height),t((T.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),k),k.videoCodec&&k.videoCodec.indexOf("avc1")!==-1&&(k.videoCodec=b.convertAVC1ToAVCOTI(k.videoCodec)),m.push(k)}else if(_[3]){var x=new w.AttrList(_[3]);x["DATA-ID"]&&(E=!0,h[x["DATA-ID"]]=x)}return{levels:m,sessionData:E?h:null}},b.parseMasterPlaylistMedia=function(d,f,m,h){h===void 0&&(h=[]);var E,_=[],T=0;for(s.lastIndex=0;(E=s.exec(d))!==null;){var k=new w.AttrList(E[1]);if(k.TYPE===m){var D={attrs:k,bitrate:0,id:T++,groupId:k["GROUP-ID"],instreamId:k["INSTREAM-ID"],name:k.NAME||k.LANGUAGE||"",type:m,default:k.bool("DEFAULT"),autoselect:k.bool("AUTOSELECT"),forced:k.bool("FORCED"),lang:k.LANGUAGE,url:k.URI?b.resolve(k.URI,f):""};if(h.length){var x=b.findGroup(h,D.groupId)||h[0];v(D,x,"audioCodec"),v(D,x,"textCodec")}_.push(D)}}return _},b.parseLevelPlaylist=function(d,f,m,h,E){var _=new B.LevelDetails(f),T=_.fragments,k=null,D=0,x=0,P=0,H=0,I=null,V=new F.Fragment(h,f),$,ge,te,be=-1,ve=!1;for(i.lastIndex=0,_.m3u8=d;($=i.exec(d))!==null;){ve&&(ve=!1,V=new F.Fragment(h,f),V.start=P,V.sn=D,V.cc=H,V.level=m,k&&(V.initSegment=k,V.rawProgramDateTime=k.rawProgramDateTime));var oe=$[1];if(oe){V.duration=parseFloat(oe);var le=(" "+$[2]).slice(1);V.title=le||null,V.tagList.push(le?["INF",oe,le]:["INF",oe])}else if($[3])Object(N.isFiniteNumber)(V.duration)&&(V.start=P,te&&(V.levelkey=te),V.sn=D,V.level=m,V.cc=H,V.urlId=E,T.push(V),V.relurl=(" "+$[3]).slice(1),p(V,I),I=V,P+=V.duration,D++,x=0,ve=!0);else if($[4]){var _e=(" "+$[4]).slice(1);I?V.setByteRange(_e,I):V.setByteRange(_e)}else if($[5])V.rawProgramDateTime=(" "+$[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),be===-1&&(be=T.length);else{if($=$[0].match(o),!$){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ge=1;ge<$.length&&!(typeof $[ge]!="undefined");ge++);var ee=(" "+$[ge]).slice(1),L=(" "+$[ge+1]).slice(1),A=$[ge+2]?(" "+$[ge+2]).slice(1):"";switch(ee){case"PLAYLIST-TYPE":_.type=L.toUpperCase();break;case"MEDIA-SEQUENCE":D=_.startSN=parseInt(L);break;case"SKIP":{var C=new w.AttrList(L),U=C.decimalInteger("SKIPPED-SEGMENTS");if(Object(N.isFiniteNumber)(U)){_.skippedSegments=U;for(var K=U;K--;)T.unshift(null);D+=U}var M=C.enumeratedString("RECENTLY-REMOVED-DATERANGES");M&&(_.recentlyRemovedDateranges=M.split(" "));break}case"TARGETDURATION":_.targetduration=parseFloat(L);break;case"VERSION":_.version=parseInt(L);break;case"EXTM3U":break;case"ENDLIST":_.live=!1;break;case"#":(L||A)&&V.tagList.push(A?[L,A]:[L]);break;case"DIS":H++;case"GAP":V.tagList.push([ee]);break;case"BITRATE":V.tagList.push([ee,L]);break;case"DISCONTINUITY-SEQ":H=parseInt(L);break;case"KEY":{var ie,Ee=new w.AttrList(L),Oe=Ee.enumeratedString("METHOD"),q=Ee.URI,ce=Ee.hexadecimalInteger("IV"),Se=Ee.enumeratedString("KEYFORMATVERSIONS"),Ce=Ee.enumeratedString("KEYID"),Pe=(ie=Ee.enumeratedString("KEYFORMAT"))!=null?ie:"identity",Ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ne.indexOf(Pe)>-1){g.logger.warn("Keyformat "+Pe+" is not supported from the manifest");continue}else if(Pe!=="identity")continue;Oe&&(te=e.LevelKey.fromURL(f,q),q&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Oe)>=0&&(te.method=Oe,te.keyFormat=Pe,Ce&&(te.keyID=Ce),Se&&(te.keyFormatVersions=Se),te.iv=ce));break}case"START":{var Ie=new w.AttrList(L),Me=Ie.decimalFloatingPoint("TIME-OFFSET");Object(N.isFiniteNumber)(Me)&&(_.startTimeOffset=Me);break}case"MAP":{var He=new w.AttrList(L);V.relurl=He.URI,He.BYTERANGE&&V.setByteRange(He.BYTERANGE),V.level=m,V.sn="initSegment",te&&(V.levelkey=te),V.initSegment=null,k=V,ve=!0;break}case"SERVER-CONTROL":{var We=new w.AttrList(L);_.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),_.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),_.canSkipDateRanges=_.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),_.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),_.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ge=new w.AttrList(L);_.partTarget=Ge.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=_.partList;Be||(Be=_.partList=[]);var Xe=x>0?Be[Be.length-1]:void 0,Ye=x++,ne=new F.Part(new w.AttrList(L),V,f,Ye,Xe);Be.push(ne),V.duration+=ne.duration;break}case"PRELOAD-HINT":{var z=new w.AttrList(L);_.preloadHint=z;break}case"RENDITION-REPORT":{var G=new w.AttrList(L);_.renditionReports=_.renditionReports||[],_.renditionReports.push(G);break}default:g.logger.warn("line parsed but not handled: "+$);break}}}I&&!I.relurl?(T.pop(),P-=I.duration,_.partList&&(_.fragmentHint=I)):_.partList&&(p(V,I),V.cc=H,_.fragmentHint=V);var J=T.length,re=T[0],Y=T[J-1];if(P+=_.skippedSegments*_.targetduration,P>0&&J&&Y){_.averagetargetduration=P/J;var Z=Y.sn;_.endSN=Z!=="initSegment"?Z:0,re&&(_.startCC=re.cc,re.initSegment||_.fragments.every(function(se){return se.relurl&&r(se.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new F.Fragment(h,f),V.relurl=Y.relurl,V.level=m,V.sn="initSegment",re.initSegment=V,_.needSidxRanges=!0))}else _.endSN=0,_.startCC=0;return _.fragmentHint&&(P+=_.fragmentHint.duration),_.totalduration=P,_.endCC=H,be>0&&c(T,be),_},b}();function t(b,y){["video","audio","text"].forEach(function(d){var f=b.filter(function(h){return Object(u.isCodecType)(h,d)});if(f.length){var m=f.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});y[d+"Codec"]=m.length>0?m[0]:f[0],b=b.filter(function(h){return f.indexOf(h)===-1})}}),y.unknownCodecs=b}function v(b,y,d){var f=y[d];f&&(b[d]=f)}function c(b,y){for(var d=b[y],f=y;f--;){var m=b[f];if(!m)return;m.programDateTime=d.programDateTime-m.duration*1e3,d=m}}function p(b,y){b.rawProgramDateTime?b.programDateTime=Date.parse(b.rawProgramDateTime):y!=null&&y.programDateTime&&(b.programDateTime=y.endProgramDateTime),Object(N.isFiniteNumber)(b.programDateTime)||(b.programDateTime=null,b.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/logger.ts"),B=R("./src/utils/mp4-tools.ts"),e=R("./src/loader/m3u8-parser.ts"),w=R("./src/types/loader.ts"),g=R("./src/utils/attr-list.ts");function u(i){var o=i.type;switch(o){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function l(i,o){var a=i.url;return(a===void 0||a.indexOf("data:")===0)&&(a=o.url),a}var s=function(){function i(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var o=i.prototype;return o.registerListeners=function(){var r=this.hls;r.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(S.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(S.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var r=this.hls;r.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(S.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(S.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(r){var n=this.hls.config,t=n.pLoader,v=n.loader,c=t||v,p=new c(n);return r.loader=p,this.loaders[r.type]=p,p},o.getInternalLoader=function(r){return this.loaders[r.type]},o.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},o.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(r,n){var t=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},o.onLevelLoading=function(r,n){var t=n.id,v=n.level,c=n.url,p=n.deliveryDirectives;this.load({id:t,groupId:null,level:v,responseType:"text",type:w.PlaylistContextType.LEVEL,url:c,deliveryDirectives:p})},o.onAudioTrackLoading=function(r,n){var t=n.id,v=n.groupId,c=n.url,p=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:c,deliveryDirectives:p})},o.onSubtitleTrackLoading=function(r,n){var t=n.id,v=n.groupId,c=n.url,p=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:c,deliveryDirectives:p})},o.load=function(r){var n,t=this.hls.config,v=this.getInternalLoader(r);if(v){var c=v.context;if(c&&c.url===r.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),v.abort()}var p,b,y,d;switch(r.type){case w.PlaylistContextType.MANIFEST:p=t.manifestLoadingMaxRetry,b=t.manifestLoadingTimeOut,y=t.manifestLoadingRetryDelay,d=t.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:p=0,b=t.levelLoadingTimeOut;break;default:p=t.levelLoadingMaxRetry,b=t.levelLoadingTimeOut,y=t.levelLoadingRetryDelay,d=t.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(r),(n=r.deliveryDirectives)!==null&&n!==void 0&&n.part){var f;if(r.type===w.PlaylistContextType.LEVEL&&r.level!==null?f=this.hls.levels[r.level].details:r.type===w.PlaylistContextType.AUDIO_TRACK&&r.id!==null?f=this.hls.audioTracks[r.id].details:r.type===w.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(f=this.hls.subtitleTracks[r.id].details),f){var m=f.partTarget,h=f.targetduration;m&&h&&(b=Math.min(Math.max(m*3,h*.8)*1e3,b))}}var E={timeout:b,maxRetry:p,retryDelay:y,maxRetryDelay:d,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(r,E,_)},o.loadsuccess=function(r,n,t,v){if(v===void 0&&(v=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,n,t,v);return}this.resetInternalLoader(t.type);var c=r.data;if(c.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",v);return}n.parsing.start=performance.now(),c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,t,v):this.handleMasterPlaylist(r,n,t,v)},o.loaderror=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!1,r)},o.loadtimeout=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!0)},o.handleMasterPlaylist=function(r,n,t,v){var c=this.hls,p=r.data,b=l(r,t),y=e.default.parseMasterPlaylist(p,b),d=y.levels,f=y.sessionData;if(!d.length){this.handleManifestParsingError(r,t,"no level found in manifest",v);return}var m=d.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),h=d.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),E=e.default.parseMasterPlaylistMedia(p,b,"AUDIO",m),_=e.default.parseMasterPlaylistMedia(p,b,"SUBTITLES",h),T=e.default.parseMasterPlaylistMedia(p,b,"CLOSED-CAPTIONS");if(E.length){var k=E.some(function(D){return!D.url});!k&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}c.trigger(S.Events.MANIFEST_LOADED,{levels:d,audioTracks:E,subtitles:_,captions:T,url:b,stats:n,networkDetails:v,sessionData:f})},o.handleTrackOrLevelPlaylist=function(r,n,t,v){var c=this.hls,p=t.id,b=t.level,y=t.type,d=l(r,t),f=Object(N.isFiniteNumber)(p)?p:0,m=Object(N.isFiniteNumber)(b)?b:f,h=u(t),E=e.default.parseLevelPlaylist(r.data,d,m,h,f);if(!E.fragments.length){c.trigger(S.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(y===w.PlaylistContextType.MANIFEST){var _={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:d};c.trigger(S.Events.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:d,stats:n,networkDetails:v,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var T,k=(T=E.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:k,isSidxRequest:!0,type:y,level:b,levelDetails:E,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=E,this.handlePlaylistLoaded(r,n,t,v)},o.handleSidxRequest=function(r,n){var t=Object(B.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var v=t.references,c=n.levelDetails;v.forEach(function(p,b){var y=p.info,d=c.fragments[b];d.byteRange.length===0&&d.setByteRange(String(1+y.end-y.start)+"@"+String(y.start)),d.initSegment&&d.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(r,n,t,v){this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===w.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:n,networkDetails:v})},o.handleNetworkError=function(r,n,t,v){t===void 0&&(t=!1),F.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 c=O.ErrorDetails.UNKNOWN,p=!1,b=this.getInternalLoader(r);switch(r.type){case w.PlaylistContextType.MANIFEST:c=t?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case w.PlaylistContextType.LEVEL:c=t?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case w.PlaylistContextType.AUDIO_TRACK:c=t?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:c=t?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}b&&this.resetInternalLoader(r.type);var y={type:O.ErrorTypes.NETWORK_ERROR,details:c,fatal:p,url:r.url,loader:b,context:r,networkDetails:n};v&&(y.response=v),this.hls.trigger(S.Events.ERROR,y)},o.handlePlaylistLoaded=function(r,n,t,v){var c=t.type,p=t.level,b=t.id,y=t.groupId,d=t.loader,f=t.levelDetails,m=t.deliveryDirectives;if(!(f!=null&&f.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",v);return}if(!d)return;f.live&&(d.getCacheAge&&(f.ageHeader=d.getCacheAge()||0),(!d.getCacheAge||isNaN(f.ageHeader))&&(f.ageHeader=0));switch(c){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(S.Events.LEVEL_LOADED,{details:f,level:p||0,id:b||0,stats:n,networkDetails:v,deliveryDirectives:m});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(S.Events.AUDIO_TRACK_LOADED,{details:f,id:b||0,groupId:y||"",stats:n,networkDetails:v,deliveryDirectives:m});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(S.Events.SUBTITLE_TRACK_LOADED,{details:f,id:b||0,groupId:y||"",stats:n,networkDetails:v,deliveryDirectives:m});break}},i}();W.default=s},"./src/polyfills/number.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isFiniteNumber",function(){return N}),R.d(W,"MAX_SAFE_INTEGER",function(){return S});var N=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},S=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,W,R){"use strict";R.r(W);var N=function(){function S(){}return S.getSilentFrame=function(F,B){switch(F){case"mp4a.40.2":if(B===1)return new Uint8Array([0,200,0,128,35,128]);if(B===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(B===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(B===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(B===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(B===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(B===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(B===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(B===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},S}();W.default=N},"./src/remux/mp4-generator.ts":function(ue,W,R){"use strict";R.r(W);var N=Math.pow(2,32)-1,S=function(){function O(){}return O.init=function(){O.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 B;for(B in O.types)O.types.hasOwnProperty(B)&&(O.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.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]),w=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]);O.HDLR_TYPES={video:e,audio:w};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),u=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=u,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var l=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,l,i,l,s),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(B){for(var e=8,w=arguments.length,g=new Array(w>1?w-1:0),u=1;u<w;u++)g[u-1]=arguments[u];for(var l=g.length,s=l;l--;)e+=g[l].byteLength;var i=new Uint8Array(e);for(i[0]=e>>24&255,i[1]=e>>16&255,i[2]=e>>8&255,i[3]=e&255,i.set(B,4),l=0,e=8;l<s;l++)i.set(g[l],e),e+=g[l].byteLength;return i},O.hdlr=function(B){return O.box(O.types.hdlr,O.HDLR_TYPES[B])},O.mdat=function(B){return O.box(O.types.mdat,B)},O.mdhd=function(B,e){e*=B;var w=Math.floor(e/(N+1)),g=Math.floor(e%(N+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},O.mdia=function(B){return O.box(O.types.mdia,O.mdhd(B.timescale,B.duration),O.hdlr(B.type),O.minf(B))},O.mfhd=function(B){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,B>>24,B>>16&255,B>>8&255,B&255]))},O.minf=function(B){return B.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(B)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(B))},O.moof=function(B,e,w){return O.box(O.types.moof,O.mfhd(B),O.traf(w,e))},O.moov=function(B){for(var e=B.length,w=[];e--;)w[e]=O.trak(B[e]);return O.box.apply(null,[O.types.moov,O.mvhd(B[0].timescale,B[0].duration)].concat(w).concat(O.mvex(B)))},O.mvex=function(B){for(var e=B.length,w=[];e--;)w[e]=O.trex(B[e]);return O.box.apply(null,[O.types.mvex].concat(w))},O.mvhd=function(B,e){e*=B;var w=Math.floor(e/(N+1)),g=Math.floor(e%(N+1)),u=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&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 O.box(O.types.mvhd,u)},O.sdtp=function(B){var e=B.samples||[],w=new Uint8Array(4+e.length),g,u;for(g=0;g<e.length;g++)u=e[g].flags,w[g+4]=u.dependsOn<<4|u.isDependedOn<<2|u.hasRedundancy;return O.box(O.types.sdtp,w)},O.stbl=function(B){return O.box(O.types.stbl,O.stsd(B),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(B){var e=[],w=[],g,u,l;for(g=0;g<B.sps.length;g++)u=B.sps[g],l=u.byteLength,e.push(l>>>8&255),e.push(l&255),e=e.concat(Array.prototype.slice.call(u));for(g=0;g<B.pps.length;g++)u=B.pps[g],l=u.byteLength,w.push(l>>>8&255),w.push(l&255),w=w.concat(Array.prototype.slice.call(u));var s=O.box(O.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|B.sps.length].concat(e).concat([B.pps.length]).concat(w))),i=B.width,o=B.height,a=B.pixelRatio[0],r=B.pixelRatio[1];return O.box(O.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,i>>8&255,i&255,o>>8&255,o&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]),s,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255])))},O.esds=function(B){var e=B.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(B.config).concat([6,1,2]))},O.mp4a=function(B){var e=B.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),O.box(O.types.esds,O.esds(B)))},O.mp3=function(B){var e=B.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},O.stsd=function(B){return B.type==="audio"?!B.isAAC&&B.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(B)):O.box(O.types.stsd,O.STSD,O.mp4a(B)):O.box(O.types.stsd,O.STSD,O.avc1(B))},O.tkhd=function(B){var e=B.id,w=B.duration*B.timescale,g=B.width,u=B.height,l=Math.floor(w/(N+1)),s=Math.floor(w%(N+1));return O.box(O.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,s>>24,s>>16&255,s>>8&255,s&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,g>>8&255,g&255,0,0,u>>8&255,u&255,0,0]))},O.traf=function(B,e){var w=O.sdtp(B),g=B.id,u=Math.floor(e/(N+1)),l=Math.floor(e%(N+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,l>>24,l>>16&255,l>>8&255,l&255])),O.trun(B,w.length+16+20+8+16+8+8),w)},O.trak=function(B){return B.duration=B.duration||4294967295,O.box(O.types.trak,O.tkhd(B),O.mdia(B))},O.trex=function(B){var e=B.id;return O.box(O.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]))},O.trun=function(B,e){var w=B.samples||[],g=w.length,u=12+16*g,l=new Uint8Array(u),s,i,o,a,r,n;for(e+=8+u,l.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),s=0;s<g;s++)i=w[s],o=i.duration,a=i.size,r=i.flags,n=i.cts,l.set([o>>>24&255,o>>>16&255,o>>>8&255,o&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,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*s);return O.box(O.types.trun,l)},O.initSegment=function(B){O.types||O.init();var e=O.moov(B),w=new Uint8Array(O.FTYP.byteLength+e.byteLength);return w.set(O.FTYP),w.set(e,O.FTYP.byteLength),w},O}();S.types=void 0,S.HDLR_TYPES=void 0,S.STTS=void 0,S.STSC=void 0,S.STCO=void 0,S.STSZ=void 0,S.VMHD=void 0,S.SMHD=void 0,S.STSD=void 0,S.FTYP=void 0,S.DINF=void 0,W.default=S},"./src/remux/mp4-remuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n}),R.d(W,"normalizePts",function(){return t});var N=R("./src/polyfills/number.ts"),S=R("./src/remux/aac-helper.ts"),O=R("./src/remux/mp4-generator.ts"),F=R("./src/events.ts"),B=R("./src/errors.ts"),e=R("./src/utils/logger.ts"),w=R("./src/types/loader.ts"),g=R("./src/utils/timescale-conversion.ts");function u(){return u=Object.assign||function(b){for(var y=1;y<arguments.length;y++){var d=arguments[y];for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(b[f]=d[f])}return b},u.apply(this,arguments)}var l=10*1e3,s=1024,i=1152,o=null,a=null,r=!1,n=function(){function b(d,f,m,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=d,this.config=f,this.typeSupported=m,this.ISGenerated=!1,o===null){var E=navigator.userAgent||"",_=E.match(/Chrome\/(\d+)/i);o=_?parseInt(_[1]):0}if(a===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);a=T?parseInt(T[1]):0}r=!!o&&o<75||!!a&&a<600}var y=b.prototype;return y.destroy=function(){},y.resetTimeStamp=function(f){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=f},y.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},y.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},y.getVideoStartPts=function(f){var m=!1,h=f.reduce(function(E,_){var T=_.pts-E;return T<-4294967296?(m=!0,t(E,_.pts)):T>0?E:_.pts},f[0].pts);return m&&e.logger.debug("PTS rollover detected"),h},y.remux=function(f,m,h,E,_,T,k,D){var x,P,H,I,V,$,ge=_,te=_,be=f.pid>-1,ve=m.pid>-1,oe=m.samples.length,le=f.samples.length>0,_e=oe>1,ee=(!be||le)&&(!ve||_e)||this.ISGenerated||k;if(ee){this.ISGenerated||(H=this.generateIS(f,m,_));var L=this.isVideoContiguous,A=-1;if(_e&&(A=v(m.samples),!L&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,A>0){e.logger.warn("[mp4-remuxer]: Dropped "+A+" out of "+oe+" video samples due to a missing keyframe");var C=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(A),m.dropped+=A,te+=(m.samples[0].pts-C)/(m.timescale||9e4)}else A===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+oe+" video samples"),$=!1);if(this.ISGenerated){if(le&&_e){var U=this.getVideoStartPts(m.samples),K=t(f.samples[0].pts,U)-U,M=K/m.inputTimeScale;ge+=Math.max(0,M),te+=Math.max(0,-M)}if(le){if(f.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(f,m,_)),P=this.remuxAudio(f,ge,this.isAudioContiguous,T,ve||_e||D===w.PlaylistLevelType.AUDIO?te:void 0),_e){var ie=P?P.endPTS-P.startPTS:0;m.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(f,m,_)),x=this.remuxVideo(m,te,L,ie)}}else _e&&(x=this.remuxVideo(m,te,L,0));x&&(x.firstKeyFrame=A,x.independent=A!==-1)}}return this.ISGenerated&&(h.samples.length&&(V=this.remuxID3(h,_)),E.samples.length&&(I=this.remuxText(E,_))),{audio:P,video:x,initSegment:H,independent:$,text:I,id3:V}},y.generateIS=function(f,m,h){var E=f.samples,_=m.samples,T=this.typeSupported,k={},D=!Object(N.isFiniteNumber)(this._initPTS),x="audio/mp4",P,H,I;if(D&&(P=H=Infinity),f.config&&E.length&&(f.timescale=f.samplerate,f.isAAC||(T.mpeg?(x="audio/mpeg",f.codec=""):T.mp3&&(f.codec="mp3")),k.audio={id:"audio",container:x,codec:f.codec,initSegment:!f.isAAC&&T.mpeg?new Uint8Array(0):O.default.initSegment([f]),metadata:{channelCount:f.channelCount}},D&&(I=f.inputTimeScale,P=H=E[0].pts-Math.round(I*h))),m.sps&&m.pps&&_.length&&(m.timescale=m.inputTimeScale,k.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:O.default.initSegment([m]),metadata:{width:m.width,height:m.height}},D)){I=m.inputTimeScale;var V=this.getVideoStartPts(_),$=Math.round(I*h);H=Math.min(H,t(_[0].dts,V)-$),P=Math.min(P,V-$)}if(Object.keys(k).length)return this.ISGenerated=!0,D&&(this._initPTS=P,this._initDTS=H),{tracks:k,initPTS:P,timescale:I}},y.remuxVideo=function(f,m,h,E){var _=f.inputTimeScale,T=f.samples,k=[],D=T.length,x=this._initPTS,P=this.nextAvcDts,H=8,I,V,$,ge=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,be=0,ve=!1;if(!h||P===null){var oe=m*_,le=T[0].pts-t(T[0].dts,T[0].pts);P=oe-le}for(var _e=0;_e<D;_e++){var ee=T[_e];if(ee.pts=t(ee.pts-x,P),ee.dts=t(ee.dts-x,P),ee.dts>ee.pts){var L=9e4*.2;be=Math.max(Math.min(be,ee.pts-ee.dts),-1*L)}ee.dts<T[_e>0?_e-1:_e].dts&&(ve=!0)}ve&&T.sort(function(ht,st){var qe=ht.dts-st.dts,Ut=ht.pts-st.pts;return qe||Ut}),V=T[0].dts,$=T[T.length-1].dts;var A=Math.round(($-V)/(D-1));if(be<0){if(be<A*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-A,!0)+" ms");for(var C=be,U=0;U<D;U++)T[U].dts=C=Math.max(C,T[U].pts-A),T[U].pts=Math.max(C,T[U].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(be,!0)+" ms to overcome this issue");for(var K=0;K<D;K++)T[K].dts=T[K].dts+be}V=T[0].dts}if(h){var M=V-P,ie=M>A,Ee=M<-1;if(ie||Ee){ie?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),V=P;var Oe=T[0].pts-M;T[0].dts=V,T[0].pts=Oe,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Oe,!0)+"/"+Object(g.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(M,!0)+" ms")}}r&&(V=Math.max(0,V));for(var q=0,ce=0,Se=0;Se<D;Se++){for(var Ce=T[Se],Pe=Ce.units,Ne=Pe.length,Ie=0,Me=0;Me<Ne;Me++)Ie+=Pe[Me].data.length;ce+=Ie,q+=Ne,Ce.length=Ie,Ce.dts=Math.max(Ce.dts,V),Ce.pts=Math.max(Ce.pts,Ce.dts,0),ge=Math.min(Ce.pts,ge),te=Math.max(Ce.pts,te)}$=T[D-1].dts;var He=ce+4*q+8,We;try{We=new Uint8Array(He)}catch(ht){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating video mdat "+He});return}var Ge=new DataView(We.buffer);Ge.setUint32(0,He),We.set(O.default.types.mdat,4);for(var Be=0;Be<D;Be++){for(var Xe=T[Be],Ye=Xe.units,ne=0,z=0,G=Ye.length;z<G;z++){var J=Ye[z],re=J.data,Y=J.data.byteLength;Ge.setUint32(H,Y),H+=4,We.set(re,H),H+=Y,ne+=4+Y}if(Be<D-1)I=T[Be+1].dts-Xe.dts;else{var Z=this.config,se=Xe.dts-T[Be>0?Be-1:Be].dts;if(Z.stretchShortVideoTrack&&this.nextAudioPts!==null){var he=Math.floor(Z.maxBufferHole*_),De=(E?ge+E*_:this.nextAudioPts)-Xe.pts;De>he?(I=De-se,I<0&&(I=se),e.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=se}else I=se}var Re=Math.round(Xe.pts-Xe.dts);k.push(new c(Xe.key,I,ne,Re))}if(k.length&&o&&o<70){var Ue=k[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=$+I,this.isVideoContiguous=!0;var Ve=O.default.moof(f.sequenceNumber++,V,u({},f,{samples:k})),Je="video",Qe={data1:Ve,data2:We,startPTS:ge/_,endPTS:(te+I)/_,startDTS:V/_,endDTS:P/_,type:Je,hasAudio:!1,hasVideo:!0,nb:k.length,dropped:f.dropped};return f.samples=[],f.dropped=0,console.assert(We.length,"MDAT length must not be zero"),Qe},y.remuxAudio=function(f,m,h,E,_){var T=f.inputTimeScale,k=f.samplerate?f.samplerate:T,D=T/k,x=f.isAAC?s:i,P=x*D,H=this._initPTS,I=!f.isAAC&&this.typeSupported.mpeg,V=[],$=f.samples,ge=I?0:8,te=this.nextAudioPts||-1,be=m*T;if(this.isAudioContiguous=h=h||$.length&&te>0&&(E&&Math.abs(be-te)<9e3||Math.abs(t($[0].pts-H,be)-te)<20*P),$.forEach(function(re){re.pts=t(re.pts-H,be)}),!h||te<0){if($=$.filter(function(re){return re.pts>=0}),!$.length)return;_===0?te=0:E?te=Math.max(0,be):te=$[0].pts}if(f.isAAC)for(var ve=_!==void 0,oe=this.config.maxAudioFramesDrift,le=0,_e=te;le<$.length;le++){var ee=$[le],L=ee.pts,A=L-_e,C=Math.abs(1e3*A/T);if(A<=-oe*P&&ve)le===0&&(e.logger.warn("Audio frame @ "+(L/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*A/T)+" ms."),this.nextAudioPts=te=_e=L);else if(A>=oe*P&&C<l&&ve){var U=Math.round(A/P);_e=L-U*P,_e<0&&(U--,_e+=P),le===0&&(this.nextAudioPts=te=_e),e.logger.warn("[mp4-remuxer]: Injecting "+U+" audio frame @ "+(_e/T).toFixed(3)+"s due to "+Math.round(1e3*A/T)+" ms gap.");for(var K=0;K<U;K++){var M=Math.max(_e,0),ie=S.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);ie||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ie=ee.unit.subarray()),$.splice(le,0,{unit:ie,pts:M}),_e+=P,le++}}ee.pts=_e,_e+=P}for(var Ee=null,Oe=null,q,ce=0,Se=$.length;Se--;)ce+=$[Se].unit.byteLength;for(var Ce=0,Pe=$.length;Ce<Pe;Ce++){var Ne=$[Ce],Ie=Ne.unit,Me=Ne.pts;if(Oe!==null){var He=V[Ce-1];He.duration=Math.round((Me-Oe)/D)}else if(h&&f.isAAC&&(Me=te),Ee=Me,ce>0){ce+=ge;try{q=new Uint8Array(ce)}catch(re){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ce,reason:"fail allocating audio mdat "+ce});return}if(!I){var We=new DataView(q.buffer);We.setUint32(0,ce),q.set(O.default.types.mdat,4)}}else return;q.set(Ie,ge);var Ge=Ie.byteLength;ge+=Ge,V.push(new c(!0,x,Ge,0)),Oe=Me}var Be=V.length;if(!Be)return;var Xe=V[V.length-1];this.nextAudioPts=te=Oe+D*Xe.duration;var Ye=I?new Uint8Array(0):O.default.moof(f.sequenceNumber++,Ee/D,u({},f,{samples:V}));f.samples=[];var ne=Ee/T,z=te/T,G="audio",J={data1:Ye,data2:q,startPTS:ne,endPTS:z,startDTS:ne,endDTS:z,type:G,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(q.length,"MDAT length must not be zero"),J},y.remuxEmptyAudio=function(f,m,h,E){var _=f.inputTimeScale,T=f.samplerate?f.samplerate:_,k=_/T,D=this.nextAudioPts,x=(D!==null?D:E.startDTS*_)+this._initDTS,P=E.endDTS*_+this._initDTS,H=k*s,I=Math.ceil((P-x)/H),V=S.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ge=0;ge<I;ge++){var te=x+ge*H;$.push({unit:V,pts:te,dts:te})}return f.samples=$,this.remuxAudio(f,m,h,!1)},y.remuxID3=function(f,m){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,_=this._initPTS,T=this._initDTS,k=0;k<h;k++){var D=f.samples[k];D.pts=t(D.pts-_,m*E)/E,D.dts=t(D.dts-T,m*E)/E}var x=f.samples;return f.samples=[],{samples:x}},y.remuxText=function(f,m){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,_=this._initPTS,T=0;T<h;T++){var k=f.samples[T];k.pts=t(k.pts-_,m*E)/E}f.samples.sort(function(x,P){return x.pts-P.pts});var D=f.samples;return f.samples=[],{samples:D}},b}();function t(b,y){var d;if(y===null)return b;for(y<b?d=-8589934592:d=8589934592;Math.abs(b-y)>4294967296;)b+=d;return b}function v(b){for(var y=0;y<b.length;y++)if(b[y].key)return y;return-1}var c=function(y,d,f,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=d,this.size=f,this.cts=m,this.flags=new p(y)},p=function(y){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=y?2:1,this.isNonSync=y?0:1}},"./src/remux/passthrough-remuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/fragment.ts"),F=R("./src/utils/logger.ts"),B=function(){function g(){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 u=g.prototype;return u.destroy=function(){},u.resetTimeStamp=function(s){this.initPTS=s,this.lastEndDTS=null},u.resetNextTimestamp=function(){this.lastEndDTS=null},u.resetInitSegment=function(s,i,o){this.audioCodec=i,this.videoCodec=o,this.generateInitSegment(s),this.emitInitSegment=!0},u.generateInitSegment=function(s){var i=this.audioCodec,o=this.videoCodec;if(!s||!s.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(S.parseInitSegment)(s);i||(i=w(a.audio,O.ElementaryStreamTypes.AUDIO)),o||(o=w(a.video,O.ElementaryStreamTypes.VIDEO));var r={};a.audio&&a.video?r.audiovideo={container:"video/mp4",codec:i+","+o,initSegment:s,id:"main"}:a.audio?r.audio={container:"audio/mp4",codec:i,initSegment:s,id:"audio"}:a.video?r.video={container:"video/mp4",codec:o,initSegment:s,id:"main"}:F.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},u.remux=function(s,i,o,a,r){var n=this.initPTS,t=this.lastEndDTS,v={audio:void 0,video:void 0,text:a,id3:o,initSegment:void 0};Object(N.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var c=i.samples;if(!c||!c.length)return v;var p={initPTS:void 0,timescale:1},b=this.initData;if((!b||!b.length)&&(this.generateInitSegment(c),b=this.initData),!b||!b.length)return F.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(N.isFiniteNumber)(n)||(this.initPTS=p.initPTS=n=e(b,c,t));var y=Object(S.getDuration)(c,b),d=t,f=y+d;Object(S.offsetStartDTS)(b,c,n),y>0?this.lastEndDTS=f:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!b.audio,h=!!b.video,E="";m&&(E+="audio"),h&&(E+="video");var _={data1:c,startPTS:d,startDTS:d,endPTS:f,endDTS:f,type:E,hasAudio:m,hasVideo:h,nb:1,dropped:0};return v.audio=_.type==="audio"?_:void 0,v.video=_.type!=="audio"?_:void 0,v.text=a,v.id3=o,v.initSegment=p,v},g}(),e=function(u,l,s){return Object(S.getStartDTS)(u,l)-s};function w(g,u){var l=g==null?void 0:g.codec;return l&&l.length>4?l:l==="hvc1"?"hvc1.1.c.L120.90":l==="av01"?"av01.0.04M.08":l==="avc1"||u===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=B},"./src/task-loop.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=S.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(B){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,B),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},S}()},"./src/types/cmcd.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"CMCDVersion",function(){return N}),R.d(W,"CMCDObjectType",function(){return S}),R.d(W,"CMCDStreamingFormat",function(){return O}),R.d(W,"CMCDStreamType",function(){return F});var N=1,S;(function(B){B.MANIFEST="m",B.AUDIO="a",B.VIDEO="v",B.MUXED="av",B.INIT="i",B.CAPTION="c",B.TIMED_TEXT="tt",B.KEY="k",B.OTHER="o"})(S||(S={}));var O;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(O||(O={}));var F;(function(B){B.VOD="v",B.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"HlsSkip",function(){return O}),R.d(W,"getSkipValue",function(){return F}),R.d(W,"HlsUrlParameters",function(){return B}),R.d(W,"Level",function(){return e});function N(w,g){for(var u=0;u<g.length;u++){var l=g[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(w,l.key,l)}}function S(w,g,u){return g&&N(w.prototype,g),u&&N(w,u),w}var O;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(O||(O={}));function F(w,g){var u=w.canSkipUntil,l=w.canSkipDateRanges,s=w.endSN,i=g!==void 0?g-s:0;return u&&i<u?l?O.v2:O.Yes:O.No}var B=function(){function w(u,l,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=u,this.part=l,this.skip=s}var g=w.prototype;return g.addDirectives=function(l){var s=new self.URL(l);return this.msn!==void 0&&s.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&s.searchParams.set("_HLS_part",this.part.toString()),this.skip&&s.searchParams.set("_HLS_skip",this.skip),s.toString()},w}(),e=function(){function w(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(u){return u}).join(",").replace(/\.[^.,]+/g,"")}return S(w,[{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(u){var l=u%this.url.length;this._urlId!==l&&(this.details=void 0,this._urlId=l)}}]),w}()},"./src/types/loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"PlaylistContextType",function(){return N}),R.d(W,"PlaylistLevelType",function(){return S});var N;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(N||(N={}));var S;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(S||(S={}))},"./src/types/transmuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ChunkMetadata",function(){return N});var N=function(F,B,e,w,g,u){w===void 0&&(w=0),g===void 0&&(g=-1),u===void 0&&(u=!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=S(),this.buffering={audio:S(),video:S(),audiovideo:S()},this.level=F,this.sn=B,this.id=e,this.size=w,this.part=g,this.partial=u};function S(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"AttrList",function(){return O});var N=/^(\d+)x(\d+)$/,S=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function F(e){typeof e=="string"&&(e=F.parseAttrList(e));for(var w in e)e.hasOwnProperty(w)&&(this[w]=e[w])}var B=F.prototype;return B.decimalInteger=function(w){var g=parseInt(this[w],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},B.hexadecimalInteger=function(w){if(this[w]){var g=(this[w]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var u=new Uint8Array(g.length/2),l=0;l<g.length/2;l++)u[l]=parseInt(g.slice(l*2,l*2+2),16);return u}else return null},B.hexadecimalIntegerAsNumber=function(w){var g=parseInt(this[w],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},B.decimalFloatingPoint=function(w){return parseFloat(this[w])},B.optionalFloat=function(w,g){var u=this[w];return u?parseFloat(u):g},B.enumeratedString=function(w){return this[w]},B.bool=function(w){return this[w]==="YES"},B.decimalResolution=function(w){var g=N.exec(this[w]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},F.parseAttrList=function(w){var g,u={},l='"';for(S.lastIndex=0;(g=S.exec(w))!==null;){var s=g[2];s.indexOf(l)===0&&s.lastIndexOf(l)===s.length-1&&(s=s.slice(1,-1)),u[g[1]]=s}return u},F}()},"./src/utils/binary-search.ts":function(ue,W,R){"use strict";R.r(W);var N={search:function(O,F){for(var B=0,e=O.length-1,w=null,g=null;B<=e;){w=(B+e)/2|0,g=O[w];var u=F(g);if(u>0)B=w+1;else if(u<0)e=w-1;else return g}return null}};W.default=N},"./src/utils/buffer-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"BufferHelper",function(){return O});var N=R("./src/utils/logger.ts"),S={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function F(){}return F.isBuffered=function(e,w){try{if(e){for(var g=F.getBuffered(e),u=0;u<g.length;u++)if(w>=g.start(u)&&w<=g.end(u))return!0}}catch(l){}return!1},F.bufferInfo=function(e,w,g){try{if(e){var u=F.getBuffered(e),l=[],s;for(s=0;s<u.length;s++)l.push({start:u.start(s),end:u.end(s)});return this.bufferedInfo(l,w,g)}}catch(i){}return{len:0,start:w,end:w,nextStart:void 0}},F.bufferedInfo=function(e,w,g){w=Math.max(0,w),e.sort(function(p,b){var y=p.start-b.start;return y||b.end-p.end});var u=[];if(g)for(var l=0;l<e.length;l++){var s=u.length;if(s){var i=u[s-1].end;e[l].start-i<g?e[l].end>i&&(u[s-1].end=e[l].end):u.push(e[l])}else u.push(e[l])}else u=e;for(var o=0,a,r=w,n=w,t=0;t<u.length;t++){var v=u[t].start,c=u[t].end;if(w+g>=v&&w<c)r=v,n=c,o=n-w;else if(w+g<v){a=v;break}}return{len:o,start:r||0,end:n||0,nextStart:a}},F.getBuffered=function(e){try{return e.buffered}catch(w){return N.logger.log("failed to get media.buffered",w),S}},F}()},"./src/utils/cea-608-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"Row",function(){return n}),R.d(W,"CaptionScreen",function(){return t});var N=R("./src/utils/logger.ts"),S={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},O=function(f){var m=f;return S.hasOwnProperty(f)&&(m=S[f]),String.fromCharCode(m)},F=15,B=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],s;(function(d){d[d.ERROR=0]="ERROR",d[d.TEXT=1]="TEXT",d[d.WARNING=2]="WARNING",d[d.INFO=2]="INFO",d[d.DEBUG=3]="DEBUG",d[d.DATA=3]="DATA"})(s||(s={}));var i=function(){function d(){this.time=null,this.verboseLevel=s.ERROR}var f=d.prototype;return f.log=function(h,E){this.verboseLevel>=h&&N.logger.log(this.time+" ["+h+"] "+E)},d}(),o=function(f){for(var m=[],h=0;h<f.length;h++)m.push(f[h].toString(16));return m},a=function(){function d(m,h,E,_,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=m||"white",this.underline=h||!1,this.italics=E||!1,this.background=_||"black",this.flash=T||!1}var f=d.prototype;return f.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},f.setStyles=function(h){for(var E=["foreground","underline","italics","background","flash"],_=0;_<E.length;_++){var T=E[_];h.hasOwnProperty(T)&&(this[T]=h[T])}},f.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},f.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},f.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},f.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},d}(),r=function(){function d(m,h,E,_,T,k){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new a(h,E,_,T,k)}var f=d.prototype;return f.reset=function(){this.uchar=" ",this.penState.reset()},f.setChar=function(h,E){this.uchar=h,this.penState.copy(E)},f.setPenState=function(h){this.penState.copy(h)},f.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},f.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},f.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},d}(),n=function(){function d(m){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<B;h++)this.chars.push(new r);this.logger=m,this.pos=0,this.currPenState=new a}var f=d.prototype;return f.equals=function(h){for(var E=!0,_=0;_<B;_++)if(!this.chars[_].equals(h.chars[_])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<B;E++)this.chars[E].copy(h.chars[E])},f.isEmpty=function(){for(var h=!0,E=0;E<B;E++)if(!this.chars[E].isEmpty()){h=!1;break}return h},f.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(s.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>B&&(this.logger.log(s.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},f.moveCursor=function(h){var E=this.pos+h;if(h>1)for(var _=this.pos+1;_<E+1;_++)this.chars[_].setPenState(this.currPenState);this.setCursor(E)},f.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},f.insertChar=function(h){h>=144&&this.backSpace();var E=O(h);if(this.pos>=B){this.logger.log(s.ERROR,"Cannot insert "+h.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},f.clearFromPos=function(h){var E;for(E=h;E<B;E++)this.chars[E].reset()},f.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},f.clearToEndOfRow=function(){this.clearFromPos(this.pos)},f.getTextString=function(){for(var h=[],E=!0,_=0;_<B;_++){var T=this.chars[_].uchar;T!==" "&&(E=!1),h.push(T)}return E?"":h.join("")},f.setPenStyles=function(h){this.currPenState.setStyles(h);var E=this.chars[this.pos];E.setPenState(this.currPenState)},d}(),t=function(){function d(m){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<F;h++)this.rows.push(new n(m));this.logger=m,this.currRow=F-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var f=d.prototype;return f.reset=function(){for(var h=0;h<F;h++)this.rows[h].clear();this.currRow=F-1},f.equals=function(h){for(var E=!0,_=0;_<F;_++)if(!this.rows[_].equals(h.rows[_])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<F;E++)this.rows[E].copy(h.rows[E])},f.isEmpty=function(){for(var h=!0,E=0;E<F;E++)if(!this.rows[E].isEmpty()){h=!1;break}return h},f.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},f.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},f.insertChar=function(h){var E=this.rows[this.currRow];E.insertChar(h)},f.setPen=function(h){var E=this.rows[this.currRow];E.setPenStyles(h)},f.moveCursor=function(h){var E=this.rows[this.currRow];E.moveCursor(h)},f.setCursor=function(h){this.logger.log(s.INFO,"setCursor: "+h);var E=this.rows[this.currRow];E.setCursor(h)},f.setPAC=function(h){this.logger.log(s.INFO,"pacData = "+JSON.stringify(h));var E=h.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var _=0;_<F;_++)this.rows[_].clear();var T=this.currRow+1-this.nrRollUpRows,k=this.lastOutputScreen;if(k){var D=k.rows[T].cueStartTime,x=this.logger.time;if(D&&x!==null&&D<x)for(var P=0;P<this.nrRollUpRows;P++)this.rows[E-this.nrRollUpRows+P+1].copy(k.rows[T+P])}}this.currRow=E;var H=this.rows[this.currRow];if(h.indent!==null){var I=h.indent,V=Math.max(I-1,0);H.setCursor(h.indent),h.color=H.chars[V].penState.foreground}var $={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen($)},f.setBkgData=function(h){this.logger.log(s.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},f.setRollUpRows=function(h){this.nrRollUpRows=h},f.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(s.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(s.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(h,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(s.INFO,"Rolling up")},f.getDisplayText=function(h){h=h||!1;for(var E=[],_="",T=-1,k=0;k<F;k++){var D=this.rows[k].getTextString();D&&(T=k+1,h?E.push("Row "+T+": '"+D+"'"):E.push(D.trim()))}return E.length>0&&(h?_="["+E.join(" | ")+"]":_=E.join(`
|
|
`)),_},f.getTextAndFormat=function(){return this.rows},d}(),v=function(){function d(m,h,E){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=m,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new t(E),this.nonDisplayedMemory=new t(E),this.lastOutputScreen=new t(E),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var f=d.prototype;return f.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},f.getHandler=function(){return this.outputFilter},f.setHandler=function(h){this.outputFilter=h},f.setPAC=function(h){this.writeScreen.setPAC(h)},f.setBkgData=function(h){this.writeScreen.setBkgData(h)},f.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(s.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},f.insertChars=function(h){for(var E=0;E<h.length;E++)this.writeScreen.insertChar(h[E]);var _=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(s.INFO,_+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(s.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},f.ccRCL=function(){this.logger.log(s.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},f.ccBS=function(){if(this.logger.log(s.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},f.ccAOF=function(){},f.ccAON=function(){},f.ccDER=function(){this.logger.log(s.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},f.ccRU=function(h){this.logger.log(s.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},f.ccFON=function(){this.logger.log(s.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},f.ccRDC=function(){this.logger.log(s.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},f.ccTR=function(){this.logger.log(s.INFO,"TR"),this.setMode("MODE_TEXT")},f.ccRTD=function(){this.logger.log(s.INFO,"RTD"),this.setMode("MODE_TEXT")},f.ccEDM=function(){this.logger.log(s.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},f.ccCR=function(){this.logger.log(s.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},f.ccENM=function(){this.logger.log(s.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},f.ccEOC=function(){if(this.logger.log(s.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(s.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},f.ccTO=function(h){this.logger.log(s.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},f.ccMIDROW=function(h){var E={flash:!1};if(E.underline=h%2===1,E.italics=h>=46,E.italics)E.foreground="white";else{var _=Math.floor(h/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=T[_]}this.logger.log(s.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},f.outputDataUpdate=function(h){h===void 0&&(h=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},f.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},d}(),c=function(){function d(m,h,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var _=new i;this.channels=[null,new v(m,h,_),new v(m+1,E,_)],this.cmdHistory=y(),this.logger=_}var f=d.prototype;return f.getHandler=function(h){return this.channels[h].getHandler()},f.setHandler=function(h,E){this.channels[h].setHandler(E)},f.addData=function(h,E){var _,T,k,D=!1;this.logger.time=h;for(var x=0;x<E.length;x+=2){if(T=E[x]&127,k=E[x+1]&127,T===0&&k===0)continue;if(this.logger.log(s.DATA,"["+o([E[x],E[x+1]])+"] -> ("+o([T,k])+")"),_=this.parseCmd(T,k),_||(_=this.parseMidrow(T,k)),_||(_=this.parsePAC(T,k)),_||(_=this.parseBackgroundAttributes(T,k)),!_&&(D=this.parseChars(T,k),D)){var P=this.currentChannel;if(P&&P>0){var H=this.channels[P];H.insertChars(D)}else this.logger.log(s.WARNING,"No channel found yet. TEXT-MODE?")}!_&&!D&&this.logger.log(s.WARNING,"Couldn't parse cleaned data "+o([T,k])+" orig: "+o([E[x],E[x+1]]))}},f.parseCmd=function(h,E){var _=this.cmdHistory,T=(h===20||h===28||h===21||h===29)&&E>=32&&E<=47,k=(h===23||h===31)&&E>=33&&E<=35;if(!(T||k))return!1;if(b(h,E,_))return p(null,null,_),this.logger.log(s.DEBUG,"Repeated command ("+o([h,E])+") is dropped"),!0;var D=h===20||h===21||h===23?1:2,x=this.channels[D];return h===20||h===21||h===28||h===29?E===32?x.ccRCL():E===33?x.ccBS():E===34?x.ccAOF():E===35?x.ccAON():E===36?x.ccDER():E===37?x.ccRU(2):E===38?x.ccRU(3):E===39?x.ccRU(4):E===40?x.ccFON():E===41?x.ccRDC():E===42?x.ccTR():E===43?x.ccRTD():E===44?x.ccEDM():E===45?x.ccCR():E===46?x.ccENM():E===47&&x.ccEOC():x.ccTO(E-32),p(h,E,_),this.currentChannel=D,!0},f.parseMidrow=function(h,E){var _=0;if((h===17||h===25)&&E>=32&&E<=47){if(h===17?_=1:_=2,_!==this.currentChannel)return this.logger.log(s.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[_];return T?(T.ccMIDROW(E),this.logger.log(s.DEBUG,"MIDROW ("+o([h,E])+")"),!0):!1}return!1},f.parsePAC=function(h,E){var _,T=this.cmdHistory,k=(h>=17&&h<=23||h>=25&&h<=31)&&E>=64&&E<=127,D=(h===16||h===24)&&E>=64&&E<=95;if(!(k||D))return!1;if(b(h,E,T))return p(null,null,T),!0;var x=h<=23?1:2;E>=64&&E<=95?_=x===1?e[h]:g[h]:_=x===1?w[h]:u[h];var P=this.channels[x];return P?(P.setPAC(this.interpretPAC(_,E)),p(h,E,T),this.currentChannel=x,!0):!1},f.interpretPAC=function(h,E){var _,T={color:null,italics:!1,indent:null,underline:!1,row:h};return E>95?_=E-96:_=E-64,T.underline=(_&1)===1,_<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(_/2)]:_<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((_-16)/2)*4,T},f.parseChars=function(h,E){var _,T=null,k=null;if(h>=25?(_=2,k=h-8):(_=1,k=h),k>=17&&k<=19){var D;k===17?D=E+80:k===18?D=E+112:D=E+144,this.logger.log(s.INFO,"Special char '"+O(D)+"' in channel "+_),T=[D]}else h>=32&&h<=127&&(T=E===0?[h]:[h,E]);if(T){var x=o(T);this.logger.log(s.DEBUG,"Char codes = "+x.join(",")),p(h,E,this.cmdHistory)}return T},f.parseBackgroundAttributes=function(h,E){var _=(h===16||h===24)&&E>=32&&E<=47,T=(h===23||h===31)&&E>=45&&E<=47;if(!(_||T))return!1;var k,D={};h===16||h===24?(k=Math.floor((E-32)/2),D.background=l[k],E%2===1&&(D.background=D.background+"_semi")):E===45?D.background="transparent":(D.foreground="black",E===47&&(D.underline=!0));var x=h<=23?1:2,P=this.channels[x];return P.setBkgData(D),p(h,E,this.cmdHistory),!0},f.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var E=this.channels[h];E&&E.reset()}this.cmdHistory=y()},f.cueSplitAtTime=function(h){for(var E=0;E<this.channels.length;E++){var _=this.channels[E];_&&_.cueSplitAtTime(h)}},d}();function p(d,f,m){m.a=d,m.b=f}function b(d,f,m){return m.a===d&&m.b===f}function y(){return{a:null,b:null}}W.default=c},"./src/utils/codecs.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isCodecType",function(){return S}),R.d(W,"isCodecSupportedInMp4",function(){return O});var N={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 S(F,B){var e=N[B];return!!e&&e[F.slice(0,4)]===!0}function O(F,B){return MediaSource.isTypeSupported((B||"video")+'/mp4;codecs="'+F+'"')}},"./src/utils/cues.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/vttparser.ts"),S=R("./src/utils/webvtt-parser.ts"),O=R("./src/utils/texttrack-utils.ts"),F=/\s/,B={newCue:function(w,g,u,l){for(var s=[],i,o,a,r,n,t=self.VTTCue||self.TextTrackCue,v=0;v<l.rows.length;v++)if(i=l.rows[v],a=!0,r=0,n="",!i.isEmpty()){for(var c=0;c<i.chars.length;c++)F.test(i.chars[c].uchar)&&a?r++:(n+=i.chars[c].uchar,a=!1);i.cueStartTime=g,g===u&&(u+=1e-4),r>=16?r--:r++;var p=Object(N.fixLineBreaks)(n.trim()),b=Object(S.generateCueId)(g,u,p);(!w||!w.cues||!w.cues.getCueById(b))&&(o=new t(g,u,p),o.id=b,o.line=v+1,o.align="left",o.position=10+Math.min(80,Math.floor(r*8/32)*10),s.push(o))}return w&&s.length&&(s.sort(function(y,d){return y.line==="auto"||d.line==="auto"?0:y.line>8&&d.line>8?d.line-y.line:y.line-d.line}),s.forEach(function(y){return Object(O.addCueToTrack)(w,y)})),s}};W.default=B},"./src/utils/discontinuities.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"findFirstFragWithCC",function(){return F}),R.d(W,"shouldAlignOnDiscontinuities",function(){return B}),R.d(W,"findDiscontinuousReferenceFrag",function(){return e}),R.d(W,"adjustSlidingStart",function(){return g}),R.d(W,"alignStream",function(){return u}),R.d(W,"alignPDT",function(){return s}),R.d(W,"alignFragmentByPDTDelta",function(){return i}),R.d(W,"alignMediaPlaylistByPDT",function(){return o});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/logger.ts"),O=R("./src/controller/level-helper.ts");function F(a,r){for(var n=null,t=0,v=a.length;t<v;t++){var c=a[t];if(c&&c.cc===r){n=c;break}}return n}function B(a,r,n){return!!(r.details&&(n.endCC>n.startCC||a&&a.cc<n.startCC))}function e(a,r){var n=a.fragments,t=r.fragments;if(!t.length||!n.length){S.logger.log("No fragments to align");return}var v=F(n,t[0].cc);if(!v||v&&!v.startPTS){S.logger.log("No frag in previous level to align on");return}return v}function w(a,r){if(a){var n=a.start+r;a.start=a.startPTS=n,a.endPTS=n+a.duration}}function g(a,r){for(var n=r.fragments,t=0,v=n.length;t<v;t++)w(n[t],a);r.fragmentHint&&w(r.fragmentHint,a),r.alignedSliding=!0}function u(a,r,n){if(!r)return;l(a,n,r),!n.alignedSliding&&r.details&&s(n,r.details),!n.alignedSliding&&r.details&&!n.skippedSegments&&Object(O.adjustSliding)(r.details,n)}function l(a,r,n){if(B(a,n,r)){var t=e(n.details,r);t&&Object(N.isFiniteNumber)(t.start)&&(S.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),g(t.start,r))}}function s(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=a.fragments[0].programDateTime,v=(t-n)/1e3+r.fragments[0].start;v&&Object(N.isFiniteNumber)(v)&&(S.logger.log("Adjusting PTS using programDateTime delta "+(t-n)+"ms, sliding:"+v.toFixed(3)+" "+a.url+" "),g(v,a))}function i(a,r){var n=a.programDateTime;if(!n)return;var t=(n-r)/1e3;a.start=a.startPTS=t,a.endPTS=t+a.duration}function o(a,r){if(!r.fragments.length||!a.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=r.fragments[0].start,v=n-t*1e3;a.fragments.forEach(function(c){i(c,v)}),a.fragmentHint&&i(a.fragmentHint,v),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/ewma.ts"),S=function(){function O(B,e,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new N.default(B),this.fast_=new N.default(e)}var F=O.prototype;return F.update=function(e,w){var g=this.slow_,u=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new N.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new N.default(w,u.getEstimate(),u.getTotalWeight()))},F.sample=function(e,w){e=Math.max(e,this.minDelayMs_);var g=8*w,u=e/1e3,l=g/u;this.fast_.sample(u,l),this.slow_.sample(u,l)},F.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},O}();W.default=S},"./src/utils/ewma.ts":function(ue,W,R){"use strict";R.r(W);var N=function(){function S(F,B,e){B===void 0&&(B=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=B,this.totalWeight_=e}var O=S.prototype;return O.sample=function(B,e){var w=Math.pow(this.alpha_,B);this.estimate_=e*(1-w)+w*this.estimate_,this.totalWeight_+=B},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var B=1-Math.pow(this.alpha_,this.totalWeight_);if(B)return this.estimate_/B}return this.estimate_},S}();W.default=N},"./src/utils/fetch-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"fetchSupported",function(){return i});var N=R("./src/polyfills/number.ts"),S=R("./src/loader/load-stats.ts"),O=R("./src/demux/chunk-cache.ts");function F(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,u(t,v)}function B(t){var v=typeof Map=="function"?new Map:void 0;return B=function(p){if(p===null||!g(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(p))return v.get(p);v.set(p,b)}function b(){return e(p,arguments,l(this).constructor)}return b.prototype=Object.create(p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),u(b,p)},B(t)}function e(t,v,c){return w()?e=Reflect.construct:e=function(b,y,d){var f=[null];f.push.apply(f,y);var m=Function.bind.apply(b,f),h=new m;return d&&u(h,d.prototype),h},e.apply(null,arguments)}function w(){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 g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function u(t,v){return u=Object.setPrototypeOf||function(p,b){return p.__proto__=b,p},u(t,v)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},l(t)}function s(){return s=Object.assign||function(t){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(t[p]=c[p])}return t},s.apply(this,arguments)}function i(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var o=function(){function t(c){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=c.fetchSetup||r,this.controller=new self.AbortController,this.stats=new S.LoadStats}var v=t.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(p,b,y){var d=this,f=this.stats;if(f.loading.start)throw new Error("Loader can only be used once.");f.loading.start=self.performance.now();var m=a(p,this.controller.signal),h=y.onProgress,E=p.responseType==="arraybuffer",_=E?"byteLength":"length";this.context=p,this.config=b,this.callbacks=y,this.request=this.fetchSetup(p,m),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){d.abortInternal(),y.onTimeout(f,p,d.response)},b.timeout),self.fetch(this.request).then(function(T){if(d.response=d.loader=T,!T.ok){var k=T.status,D=T.statusText;throw new n(D||"fetch, bad network response",k,T)}return f.loading.first=Math.max(self.performance.now(),f.loading.start),f.total=parseInt(T.headers.get("Content-Length")||"0"),h&&Object(N.isFiniteNumber)(b.highWaterMark)?d.loadProgressively(T,f,p,b.highWaterMark,h):E?T.arrayBuffer():T.text()}).then(function(T){var k=d.response;self.clearTimeout(d.requestTimeout),f.loading.end=Math.max(self.performance.now(),f.loading.first),f.loaded=f.total=T[_];var D={url:k.url,data:T};h&&!Object(N.isFiniteNumber)(b.highWaterMark)&&h(f,p,T,k),y.onSuccess(D,f,p,k)}).catch(function(T){if(self.clearTimeout(d.requestTimeout),f.aborted)return;var k=T.code||0;y.onError({code:k,text:T.message},p,T.details)})},v.getCacheAge=function(){var p=null;if(this.response){var b=this.response.headers.get("age");p=b?parseFloat(b):null}return p},v.loadProgressively=function(p,b,y,d,f){d===void 0&&(d=0);var m=new O.default,h=p.body.getReader(),E=function _(){return h.read().then(function(T){if(T.done)return m.dataLength&&f(b,y,m.flush(),p),Promise.resolve(new ArrayBuffer(0));var k=T.value,D=k.length;return b.loaded+=D,D<d||m.dataLength?(m.push(k),m.dataLength>=d&&f(b,y,m.flush(),p)):f(b,y,k,p),_()}).catch(function(){return Promise.reject()})};return E()},t}();function a(t,v){var c={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(s({},t.headers))};return t.rangeEnd&&c.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),c}function r(t,v){return new self.Request(t.url,v)}var n=function(t){F(v,t);function v(c,p,b){var y;return y=t.call(this,c)||this,y.code=void 0,y.details=void 0,y.code=p,y.details=b,y}return v}(B(Error));W.default=o},"./src/utils/imsc1-ttml-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"IMSC1_CODEC",function(){return g}),R.d(W,"parseIMSC1",function(){return i});var N=R("./src/utils/mp4-tools.ts"),S=R("./src/utils/vttparser.ts"),O=R("./src/utils/vttcue.ts"),F=R("./src/demux/id3.ts"),B=R("./src/utils/timescale-conversion.ts"),e=R("./src/utils/webvtt-parser.ts");function w(){return w=Object.assign||function(d){for(var f=1;f<arguments.length;f++){var m=arguments[f];for(var h in m)Object.prototype.hasOwnProperty.call(m,h)&&(d[h]=m[h])}return d},w.apply(this,arguments)}var g="stpp.ttml.im1t",u=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,l=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,s={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(d,f,m,h,E){var _=Object(N.findBox)(new Uint8Array(d),["mdat"]);if(_.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var T=_[0],k=Object(F.utf8ArrayToStr)(new Uint8Array(d,T.start,T.end-T.start)),D=Object(B.toTimescaleFromScale)(f,1,m);try{h(o(k,D))}catch(x){E(x)}}function o(d,f){var m=new DOMParser,h=m.parseFromString(d,"text/xml"),E=h.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var _={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(_).reduce(function(H,I){return H[I]=E.getAttribute("ttp:"+I)||_[I],H},{}),k=E.getAttribute("xml:space")!=="preserve",D=r(a(E,"styling","style")),x=r(a(E,"layout","region")),P=a(E,"body","[begin]");return[].map.call(P,function(H){var I=n(H,k);if(!I||!H.hasAttribute("begin"))return null;var V=p(H.getAttribute("begin"),T),$=p(H.getAttribute("dur"),T),ge=p(H.getAttribute("end"),T);if(V===null)throw c(H);if(ge===null){if($===null)throw c(H);ge=V+$}var te=new O.default(V-f,ge-f,I);te.id=Object(e.generateCueId)(te.startTime,te.endTime,te.text);var be=x[H.getAttribute("region")],ve=D[H.getAttribute("style")];te.position=10,te.size=80;var oe=t(be,ve),le=oe.textAlign;if(le){var _e=s[le];_e&&(te.lineAlign=_e),te.align=le}return w(te,oe),te}).filter(function(H){return H!==null})}function a(d,f,m){var h=d.getElementsByTagName(f)[0];return h?[].slice.call(h.querySelectorAll(m)):[]}function r(d){return d.reduce(function(f,m){var h=m.getAttribute("xml:id");return h&&(f[h]=m),f},{})}function n(d,f){return[].slice.call(d.childNodes).reduce(function(m,h,E){var _;return h.nodeName==="br"&&E?m+`
|
|
`:(_=h.childNodes)!==null&&_!==void 0&&_.length?n(h,f):f?m+h.textContent.trim().replace(/\s+/g," "):m+h.textContent},"")}function t(d,f){var m="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(E,_){var T=v(f,m,_)||v(d,m,_);return T&&(E[_]=T),E},{})}function v(d,f,m){return d.hasAttributeNS(f,m)?d.getAttributeNS(f,m):null}function c(d){return new Error("Could not parse ttml timestamp "+d)}function p(d,f){if(!d)return null;var m=Object(S.parseTimeStamp)(d);return m===null&&(u.test(d)?m=b(d,f):l.test(d)&&(m=y(d,f))),m}function b(d,f){var m=u.exec(d),h=(m[4]|0)+(m[5]|0)/f.subFrameRate;return(m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+h/f.frameRate}function y(d,f){var m=l.exec(d),h=Number(m[1]),E=m[2];switch(E){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/f.frameRate;case"t":return h/f.tickRate}return h}},"./src/utils/logger.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"enableLogs",function(){return e}),R.d(W,"logger",function(){return w});var N=function(){},S={trace:N,debug:N,log:N,warn:N,info:N,error:N},O=S;function F(g){var u=self.console[g];return u?u.bind(self.console,"["+g+"] >"):N}function B(g){for(var u=arguments.length,l=new Array(u>1?u-1:0),s=1;s<u;s++)l[s-1]=arguments[s];l.forEach(function(i){O[i]=g[i]?g[i].bind(g):F(i)})}function e(g){if(self.console&&g===!0||typeof g=="object"){B(g,"debug","log","info","warn","error");try{O.log()}catch(u){O=S}}else O=S}var w=O},"./src/utils/mediakeys-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"KeySystems",function(){return N}),R.d(W,"requestMediaKeySystemAccess",function(){return S});var N;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(N||(N={}));var S=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"getMediaSource",function(){return N});function N(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"bin2str",function(){return B}),R.d(W,"readUint16",function(){return e}),R.d(W,"readUint32",function(){return w}),R.d(W,"writeUint32",function(){return g}),R.d(W,"findBox",function(){return u}),R.d(W,"parseSegmentIndex",function(){return l}),R.d(W,"parseInitSegment",function(){return s}),R.d(W,"getStartDTS",function(){return i}),R.d(W,"getDuration",function(){return o}),R.d(W,"computeRawDurationFromSamples",function(){return a}),R.d(W,"offsetStartDTS",function(){return r}),R.d(W,"segmentValidRange",function(){return n}),R.d(W,"appendUint8Array",function(){return t});var N=R("./src/utils/typed-array.ts"),S=R("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,F=[].push;function B(v){return String.fromCharCode.apply(null,v)}function e(v,c){"data"in v&&(c+=v.start,v=v.data);var p=v[c]<<8|v[c+1];return p<0?65536+p:p}function w(v,c){"data"in v&&(c+=v.start,v=v.data);var p=v[c]<<24|v[c+1]<<16|v[c+2]<<8|v[c+3];return p<0?4294967296+p:p}function g(v,c,p){"data"in v&&(c+=v.start,v=v.data),v[c]=p>>24,v[c+1]=p>>16&255,v[c+2]=p>>8&255,v[c+3]=p&255}function u(v,c){var p=[];if(!c.length)return p;var b,y,d;"data"in v?(b=v.data,y=v.start,d=v.end):(b=v,y=0,d=b.byteLength);for(var f=y;f<d;){var m=w(b,f),h=B(b.subarray(f+4,f+8)),E=m>1?f+m:d;if(h===c[0])if(c.length===1)p.push({data:b,start:f+8,end:E});else{var _=u({data:b,start:f+8,end:E},c.slice(1));_.length&&F.apply(p,_)}f=E}return p}function l(v){var c=u(v,["moov"]),p=c[0],b=p?p.end:null,y=u(v,["sidx"]);if(!y||!y[0])return null;var d=[],f=y[0],m=f.data[0],h=m===0?8:16,E=w(f,h);h+=4;var _=0,T=0;m===0?h+=8:h+=16,h+=2;var k=f.end+T,D=e(f,h);h+=2;for(var x=0;x<D;x++){var P=h,H=w(f,P);P+=4;var I=H&2147483647,V=(H&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=w(f,P);P+=4,d.push({referenceSize:I,subsegmentDuration:$,info:{duration:$/E,start:k,end:k+I-1}}),k+=I,P+=4,h=P}return{earliestPresentationTime:_,timescale:E,version:m,referencesCount:D,references:d,moovEndOffset:b}}function s(v){for(var c=[],p=u(v,["moov","trak"]),b=0;b<p.length;b++){var y=p[b],d=u(y,["tkhd"])[0];if(d){var f=d.data[d.start],m=f===0?12:20,h=w(d,m),E=u(y,["mdia","mdhd"])[0];if(E){f=E.data[E.start],m=f===0?12:20;var _=w(E,m),T=u(y,["mdia","hdlr"])[0];if(T){var k=B(T.data.subarray(T.start+8,T.start+12)),D={soun:S.ElementaryStreamTypes.AUDIO,vide:S.ElementaryStreamTypes.VIDEO}[k];if(D){var x=u(y,["mdia","minf","stbl","stsd"])[0],P=void 0;x&&(P=B(x.data.subarray(x.start+12,x.start+16))),c[h]={timescale:_,type:D},c[D]={timescale:_,id:h,codec:P}}}}}}var H=u(v,["moov","mvex","trex"]);return H.forEach(function(I){var V=w(I,4),$=c[V];$&&($.default={duration:w(I,12),flags:w(I,20)})}),c}function i(v,c){return u(c,["moof","traf"]).reduce(function(p,b){var y=u(b,["tfdt"])[0],d=y.data[y.start],f=u(b,["tfhd"]).reduce(function(m,h){var E=w(h,4),_=v[E];if(_){var T=w(y,4);d===1&&(T*=Math.pow(2,32),T+=w(y,8));var k=_.timescale||9e4,D=T/k;if(isFinite(D)&&(m===null||D<m))return D}return m},null);return f!==null&&isFinite(f)&&(p===null||f<p)?f:p},null)||0}function o(v,c){for(var p=0,b=0,y=0,d=u(v,["moof","traf"]),f=0;f<d.length;f++){var m=d[f],h=u(m,["tfhd"])[0],E=w(h,4),_=c[E];if(!_)continue;var T=_.default,k=w(h,0)|(T==null?void 0:T.flags),D=T==null?void 0:T.duration;k&8&&(k&2?D=w(h,12):D=w(h,8));for(var x=_.timescale||9e4,P=u(m,["trun"]),H=0;H<P.length;H++){if(D){var I=w(P[H],4);p=D*I}else p=a(P[H]);_.type===S.ElementaryStreamTypes.VIDEO?b+=p/x:_.type===S.ElementaryStreamTypes.AUDIO&&(y+=p/x)}}if(b===0&&y===0){var V=l(v);if(V!=null&&V.references)return V.references.reduce(function($,ge){return $+ge.info.duration||0},0)}return b||y}function a(v){var c=w(v,0),p=8;c&1&&(p+=4),c&4&&(p+=4);for(var b=0,y=w(v,4),d=0;d<y;d++){if(c&256){var f=w(v,p);b+=f,p+=4}c&512&&(p+=4),c&1024&&(p+=4),c&2048&&(p+=4)}return b}function r(v,c,p){u(c,["moof","traf"]).forEach(function(b){u(b,["tfhd"]).forEach(function(y){var d=w(y,4),f=v[d];if(!f)return;var m=f.timescale||9e4;u(b,["tfdt"]).forEach(function(h){var E=h.data[h.start],_=w(h,4);if(E===0)g(h,4,_-p*m);else{_*=Math.pow(2,32),_+=w(h,8),_-=p*m,_=Math.max(_,0);var T=Math.floor(_/(O+1)),k=Math.floor(_%(O+1));g(h,4,T),g(h,8,k)}})})})}function n(v){var c={valid:null,remainder:null},p=u(v,["moof"]);if(p){if(p.length<2)return c.remainder=v,c}else return c;var b=p[p.length-1];return c.valid=Object(N.sliceUint8)(v,0,b.start-8),c.remainder=Object(N.sliceUint8)(v,b.start-8),c}function t(v,c){var p=new Uint8Array(v.length+c.length);return p.set(v),p.set(c,v.length),p}},"./src/utils/output-filter.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,B){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=F,this.trackName=B}var O=S.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(B,e,w){(this.startTime===null||this.startTime>B)&&(this.startTime=B),this.endTime=e,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},S}()},"./src/utils/texttrack-utils.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"sendAddTrackEvent",function(){return S}),R.d(W,"addCueToTrack",function(){return O}),R.d(W,"clearCurrentCues",function(){return F}),R.d(W,"removeCuesInRange",function(){return B}),R.d(W,"getCuesInRange",function(){return w});var N=R("./src/utils/logger.ts");function S(g,u){var l;try{l=new Event("addtrack")}catch(s){l=document.createEvent("Event"),l.initEvent("addtrack",!1,!1)}l.track=g,u.dispatchEvent(l)}function O(g,u){var l=g.mode;if(l==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(u.id))try{if(g.addCue(u),!g.cues.getCueById(u.id))throw new Error("addCue is failed for: "+u)}catch(i){N.logger.debug("[texttrack-utils]: "+i);var s=new self.TextTrackCue(u.startTime,u.endTime,u.text);s.id=u.id,g.addCue(s)}l==="disabled"&&(g.mode=l)}function F(g){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues)for(var l=g.cues.length;l--;)g.removeCue(g.cues[l]);u==="disabled"&&(g.mode=u)}function B(g,u,l){var s=g.mode;if(s==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var i=w(g.cues,u,l),o=0;o<i.length;o++)g.removeCue(i[o]);s==="disabled"&&(g.mode=s)}function e(g,u){if(u<g[0].startTime)return 0;var l=g.length-1;if(u>g[l].endTime)return-1;for(var s=0,i=l;s<=i;){var o=Math.floor((i+s)/2);if(u<g[o].startTime)i=o-1;else if(u>g[o].startTime&&s<l)s=o+1;else return o}return g[s].startTime-u<u-g[i].startTime?s:i}function w(g,u,l){var s=[],i=e(g,u);if(i>-1)for(var o=i,a=g.length;o<a;o++){var r=g[o];if(r.startTime>=u&&r.endTime<=l)s.push(r);else if(r.startTime>l)return s}return s}},"./src/utils/time-ranges.ts":function(ue,W,R){"use strict";R.r(W);var N={toString:function(O){for(var F="",B=O.length,e=0;e<B;e++)F+="["+O.start(e).toFixed(3)+","+O.end(e).toFixed(3)+"]";return F}};W.default=N},"./src/utils/timescale-conversion.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"toTimescaleFromBase",function(){return S}),R.d(W,"toTimescaleFromScale",function(){return O}),R.d(W,"toMsFromMpegTsClock",function(){return F}),R.d(W,"toMpegTsClockFromTimescale",function(){return B});var N=9e4;function S(e,w,g,u){g===void 0&&(g=1),u===void 0&&(u=!1);var l=e*w*g;return u?Math.round(l):l}function O(e,w,g,u){return g===void 0&&(g=1),u===void 0&&(u=!1),S(e,w,1/g,u)}function F(e,w){return w===void 0&&(w=!1),S(e,1e3,1/N,w)}function B(e,w){return w===void 0&&(w=1),S(e,N,1/w)}},"./src/utils/typed-array.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"sliceUint8",function(){return N});function N(S,O,F){return Uint8Array.prototype.slice?S.slice(O,F):new Uint8Array(Array.prototype.slice.call(S,O,F))}},"./src/utils/vttcue.ts":function(ue,W,R){"use strict";R.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var N=["","lr","rl"],S=["start","middle","end","left","right"];function O(g,u){if(typeof u!="string")return!1;if(!Array.isArray(g))return!1;var l=u.toLowerCase();return~g.indexOf(l)?l:!1}function F(g){return O(N,g)}function B(g){return O(S,g)}function e(g){for(var u=arguments.length,l=new Array(u>1?u-1:0),s=1;s<u;s++)l[s-1]=arguments[s];for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var a in o)g[a]=o[a]}return g}function w(g,u,l){var s=this,i={enumerable:!0};s.hasBeenReset=!1;var o="",a=!1,r=g,n=u,t=l,v=null,c="",p=!0,b="auto",y="start",d=50,f="middle",m=50,h="middle";Object.defineProperty(s,"id",e({},i,{get:function(){return o},set:function(_){o=""+_}})),Object.defineProperty(s,"pauseOnExit",e({},i,{get:function(){return a},set:function(_){a=!!_}})),Object.defineProperty(s,"startTime",e({},i,{get:function(){return r},set:function(_){if(typeof _!="number")throw new TypeError("Start time must be set to a number.");r=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",e({},i,{get:function(){return n},set:function(_){if(typeof _!="number")throw new TypeError("End time must be set to a number.");n=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",e({},i,{get:function(){return t},set:function(_){t=""+_,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",e({},i,{get:function(){return v},set:function(_){v=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",e({},i,{get:function(){return c},set:function(_){var T=F(_);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=T,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",e({},i,{get:function(){return p},set:function(_){p=!!_,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",e({},i,{get:function(){return b},set:function(_){if(typeof _!="number"&&_!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");b=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",e({},i,{get:function(){return y},set:function(_){var T=B(_);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");y=T,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",e({},i,{get:function(){return d},set:function(_){if(_<0||_>100)throw new Error("Position must be between 0 and 100.");d=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",e({},i,{get:function(){return f},set:function(_){var T=B(_);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");f=T,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",e({},i,{get:function(){return m},set:function(_){if(_<0||_>100)throw new Error("Size must be between 0 and 100.");m=_,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",e({},i,{get:function(){return h},set:function(_){var T=B(_);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");h=T,this.hasBeenReset=!0}})),s.displayState=void 0}return w.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"parseTimeStamp",function(){return O}),R.d(W,"fixLineBreaks",function(){return u}),R.d(W,"VTTParser",function(){return l});var N=R("./src/utils/vttcue.ts"),S=function(){function s(){}var i=s.prototype;return i.decode=function(a,r){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},s}();function O(s){function i(a,r,n,t){return(a|0)*3600+(r|0)*60+(n|0)+parseFloat(t||0)}var o=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?i(o[2],o[3],0,o[4]):i(o[1],o[2],o[3],o[4]):null}var F=function(){function s(){this.values=Object.create(null)}var i=s.prototype;return i.set=function(a,r){!this.get(a)&&r!==""&&(this.values[a]=r)},i.get=function(a,r,n){return n?this.has(a)?this.values[a]:r[n]:this.has(a)?this.values[a]:r},i.has=function(a){return a in this.values},i.alt=function(a,r,n){for(var t=0;t<n.length;++t)if(r===n[t]){this.set(a,r);break}},i.integer=function(a,r){/^-?\d+$/.test(r)&&this.set(a,parseInt(r,10))},i.percent=function(a,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var n=parseFloat(r);if(n>=0&&n<=100)return this.set(a,n),!0}return!1},s}();function B(s,i,o,a){var r=a?s.split(a):[s];for(var n in r){if(typeof r[n]!="string")continue;var t=r[n].split(o);if(t.length!==2)continue;var v=t[0],c=t[1];i(v,c)}}var e=new N.default(0,0,""),w=e.align==="middle"?"middle":"center";function g(s,i,o){var a=s;function r(){var v=O(s);if(v===null)throw new Error("Malformed timestamp: "+a);return s=s.replace(/^[^\sa-zA-Z-]+/,""),v}function n(v,c){var p=new F;B(v,function(d,f){var m;switch(d){case"region":for(var h=o.length-1;h>=0;h--)if(o[h].id===f){p.set(d,o[h].region);break}break;case"vertical":p.alt(d,f,["rl","lr"]);break;case"line":m=f.split(","),p.integer(d,m[0]),p.percent(d,m[0])&&p.set("snapToLines",!1),p.alt(d,m[0],["auto"]),m.length===2&&p.alt("lineAlign",m[1],["start",w,"end"]);break;case"position":m=f.split(","),p.percent(d,m[0]),m.length===2&&p.alt("positionAlign",m[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":p.percent(d,f);break;case"align":p.alt(d,f,["start",w,"end","left","right"]);break}},/:/,/\s/),c.region=p.get("region",null),c.vertical=p.get("vertical","");var b=p.get("line","auto");b==="auto"&&e.line===-1&&(b=-1),c.line=b,c.lineAlign=p.get("lineAlign","start"),c.snapToLines=p.get("snapToLines",!0),c.size=p.get("size",100),c.align=p.get("align",w);var y=p.get("position","auto");y==="auto"&&e.position===50&&(y=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=y}function t(){s=s.replace(/^\s+/,"")}if(t(),i.startTime=r(),t(),s.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);s=s.substr(3),t(),i.endTime=r(),t(),n(s,i)}function u(s){return s.replace(/<br(?: \/)?>/gi,`
|
|
`)}var l=function(){function s(){this.state="INITIAL",this.buffer="",this.decoder=new S,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var i=s.prototype;return i.parse=function(a){var r=this;a&&(r.buffer+=r.decoder.decode(a,{stream:!0}));function n(){var y=r.buffer,d=0;for(y=u(y);d<y.length&&y[d]!=="\r"&&y[d]!==`
|
|
`;)++d;var f=y.substr(0,d);return y[d]==="\r"&&++d,y[d]===`
|
|
`&&++d,r.buffer=y.substr(d),f}function t(y){B(y,function(d,f){},/:/)}try{var v="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;v=n();var c=v.match(/^()?WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var p=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;p?p=!1:v=n();switch(r.state){case"HEADER":/:/.test(v)?t(v):v||(r.state="ID");continue;case"NOTE":v||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){r.state="NOTE";break}if(!v)continue;if(r.cue=new N.default(0,0,""),r.state="CUE",v.indexOf("-->")===-1){r.cue.id=v;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{g(v,r.cue,r.regionList)}catch(y){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var b=v.indexOf("-->")!==-1;if(!v||b&&(p=!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+=v}continue;case"BADCUE":v||(r.state="ID")}}}catch(y){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},i.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},s}()},"./src/utils/webvtt-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"generateCueId",function(){return l}),R.d(W,"parseWebVTT",function(){return i});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/vttparser.ts"),O=R("./src/demux/id3.ts"),F=R("./src/utils/timescale-conversion.ts"),B=R("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,w=function(a,r,n){return n===void 0&&(n=0),a.substr(n,r.length)===r},g=function(a){var r=parseInt(a.substr(-3)),n=parseInt(a.substr(-6,2)),t=parseInt(a.substr(-9,2)),v=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(N.isFiniteNumber)(r)||!Object(N.isFiniteNumber)(n)||!Object(N.isFiniteNumber)(t)||!Object(N.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return r+=1e3*n,r+=60*1e3*t,r+=60*60*1e3*v,r},u=function(a){for(var r=5381,n=a.length;n;)r=r*33^a.charCodeAt(--n);return(r>>>0).toString()};function l(o,a,r){return u(o.toString())+u(a.toString())+u(r)}var s=function(a,r,n){var t=a[r],v=a[t.prevCC];if(!v||!v.new&&t.new){a.ccOffset=a.presentationOffset=t.start,t.new=!1;return}for(;(c=v)!==null&&c!==void 0&&c.new;){var c;a.ccOffset+=t.start-v.start,t.new=!1,t=v,v=a[t.prevCC]}a.presentationOffset=n};function i(o,a,r,n,t,v,c,p){var b=new S.VTTParser,y=Object(O.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(e,`
|
|
`).split(`
|
|
`),d=[],f=Object(F.toMpegTsClockFromTimescale)(a,r),m="00:00.000",h=0,E=0,_,T=!0,k=!1;b.oncue=function(D){var x=n[t],P=n.ccOffset,H=(h-f)/9e4;if(x!=null&&x.new&&(E!==void 0?P=n.ccOffset=x.start:s(n,t,H)),H&&(P=H-n.presentationOffset),k){var I=D.endTime-D.startTime,V=Object(B.normalizePts)((D.startTime+P-E)*9e4,v*9e4)/9e4;D.startTime=V,D.endTime=V+I}var $=D.text.trim();D.text=decodeURIComponent(encodeURIComponent($)),D.id||(D.id=l(D.startTime,D.endTime,$)),D.endTime>0&&d.push(D)},b.onparsingerror=function(D){_=D},b.onflush=function(){if(_){p(_);return}c(d)},y.forEach(function(D){if(T)if(w(D,"X-TIMESTAMP-MAP=")){T=!1,k=!0,D.substr(16).split(",").forEach(function(x){w(x,"LOCAL:")?m=x.substr(6):w(x,"MPEGTS:")&&(h=parseInt(x.substr(7)))});try{E=g(m)/1e3}catch(x){k=!1,_=x}return}else D===""&&(T=!1);b.parse(D+`
|
|
`)}),b.flush()}},"./src/utils/xhr-loader.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/logger.ts"),S=R("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,F=function(){function B(w){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=w?w.xhrSetup:null,this.stats=new S.LoadStats,this.retryDelay=0}var e=B.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,u,l){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=u,this.callbacks=l,this.retryDelay=u.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,u=this.context;if(!g)return;var l=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0;var i=this.xhrSetup;try{if(i)try{i(l,u.url)}catch(r){l.open("GET",u.url,!0),i(l,u.url)}l.readyState||l.open("GET",u.url,!0);var o=this.context.headers;if(o)for(var a in o)l.setRequestHeader(a,o[a])}catch(r){this.callbacks.onError({code:l.status,text:r.message},u,l);return}u.rangeEnd&&l.setRequestHeader("Range","bytes="+u.rangeStart+"-"+(u.rangeEnd-1)),l.onreadystatechange=this.readystatechange.bind(this),l.onprogress=this.loadprogress.bind(this),l.responseType=u.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),l.send()},e.readystatechange=function(){var g=this.context,u=this.loader,l=this.stats;if(!g||!u)return;var s=u.readyState,i=this.config;if(l.aborted)return;if(s>=2)if(self.clearTimeout(this.requestTimeout),l.loading.first===0&&(l.loading.first=Math.max(self.performance.now(),l.loading.start)),s===4){u.onreadystatechange=null,u.onprogress=null;var o=u.status;if(o>=200&&o<300){l.loading.end=Math.max(self.performance.now(),l.loading.first);var a,r;if(g.responseType==="arraybuffer"?(a=u.response,r=a.byteLength):(a=u.responseText,r=a.length),l.loaded=l.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(l,g,a,u),!this.callbacks)return;var t={url:u.responseURL,data:a};this.callbacks.onSuccess(t,l,g,u)}else l.retry>=i.maxRetry||o>=400&&o<499?(N.logger.error(o+" while loading "+g.url),this.callbacks.onError({code:o,text:u.statusText},g,u)):(N.logger.warn(o+" while loading "+g.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,i.maxRetryDelay),l.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){N.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var u=this.stats;u.loaded=g.loaded,g.lengthComputable&&(u.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var u=this.loader.getResponseHeader("age");g=u?parseFloat(u):null}return g},B}();W.default=F}}).default})},vHTk:function(Ke,ye,j){Ke.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xTzM:function(Ke,ye){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="}}]);
|