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

156 lines
681 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[100,5,7,8,13],{"+ua5":function(ut,tt,te){},"479L":function(ut,tt){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAWCAYAAAAvg9c4AAAAAXNSR0IArs4c6QAABPdJREFUSEullWloHGUYx//vzO7sHDuzm93sZpM2l/SgRyK7xSYxrfYgbdUq6JcixXqAUrxItGAVMT1A+kH7Re1WWppa6afiAYJIi7ZB07vkIARzVJqYbJMmu90zszOzM6/MVEXQotR3mPky8/7e//N7ZuYl+J+jt7fX7/f7i/X19cU/UORemZRSZnBwsKNQKLztdrtHOI57sqGhYcbm3ROUUsoOD4++Mz9f2CtJItE0DaVSqTMWi+27Jyil1DM0NLTfsmgHpZbLhthQSmlfTU3NmkgkUvjPSSmlZGRkZI2maZ2mWdpAGBehpgnd0KBpOkzTLPn9/gei0Wjfv0JHR0cXGpq2xTDNHZTSJsu0OJNaIIRFUc07KXXdgGVZCAQCL7e0tMT/Br3ja3iRaZptlmU9YVHayhBGoAApGTpKhgHCsFCLRaRvp+yEtk9QaiEYDHy0cWPb639CbdjAwADP8/zRkmk9BYADIU4nLUqdycX5Agxdh4cXkLh5E8m5WTD2A4SAZVmEwxVnNm3a9AiJx+MrdSI8nslm25YtqlMaVi6LWab1+2IUFIB9NXQDuUwapmFAUnwYHBhAOp0Ex3nAcRx4QUA4FL62ecuWVnL01Om8V1YkXdewpMoLn6zYC4NhGLhcLng4t4OdnEognUqCIQSSJOPipYvI5gsQBBGyV4KiyAgFgz83NDauImevDtFUJo+ZqXGsW7UcvjK/zQDDEBBCHF+pZBKTU1NOl1mWgYfnMTNzy1FTWbUA6UzWuVce9N2QRKmRfP3d9zSRLOBS9xlsbVsLv893p2TLcjzqhgGtqEEvGWAI47izyx27ft2ppq6uHpIoIFcowqfIkz7Fu4LEjxyhVUtX4cuTn2FxdQiiKILYKe3DbpTtwu4Fw4Bzu8F5PGAZFqnbKWdhRVEQDkegm5YNnVhYFVlJ9uzbb2x++iXXxwf2o0Jxg+N5J4ENs/0RlgVLCFwuNyRJhCAITgX+sgCyubzjXZK88Hq9ttuRMr8SI2d+OHdCqFz8zMkjh1SeqqXy8qBsGIbj0rQs56UGpXCxLCRZhiLLmFdVyF4FmmFAUXzw+RRIogSvV+xdUFX5ILl07drBIh/quHD2bNeK+vLLum7ENXUe+Xweqqo6p6brMEsleDweJ1Eul0MgWA7Too6uYCAAryxDEvlzzU1NbeTClSsHDTHScaG7+/D6pmU9k2nt8/TU+NUl91UP53K5dblcrjKfzzOFQsFpmu01k8mgrCwAC4yjygZXVkYgy9LR1paWF0n3jz0fMMGaN8+f6z68oXnp+V/T1omRgd7ju9t3Pp9IJMTZ2dmHMpnMtnQ6/Wg2mw2pqkqy2SzcbjdcnAiOczuJIxUhVIRCu5qbV39Ivj19+oBSvfytyz/1HG5trLs4NU+O3xge6npj53Mv/PUHPj09HR4bG9s+NzfXnkymatSiCoEX4C8rA+fh4eE4GioPrI1Goz3k1Fdf7KlcEuvsu3z1mN9jjY3fSr/vgX5oV/trr/zTrtDf379wYmIinkqlHrMsi8iyDFnxQRCFsdrq6tW1tbW3yXt79z77y42J44KL5FPJOeJiXUb0/oYdu9/t/OZuW42tpa+v75iqqtvy+RwqwiEIvPjJw+vXv+q8011dXXx/f/9WWZaVQCBwE0Bfe3v7NCHE/rDuOmzw+Pj4p4lEYruLZWeqa2o2xmKxIXvCb487Tm3fsdeDAAAAAElFTkSuQmCC"},"55Ip":function(ut,tt,te){"use strict";te.d(tt,"a",function(){return t});var le=te("Ty5D"),N=te("dI71"),O=te("cDcd"),L=te.n(O),T=te("YS25"),A=te("17x9"),M=te.n(A),C=te("wx14"),S=te("zLVn"),x=te("9R94"),v=function(d){Object(N.a)(a,d);function a(){for(var c,h=arguments.length,E=new Array(h),R=0;R<h;R++)E[R]=arguments[R];return c=d.call.apply(d,[this].concat(E))||this,c.history=Object(T.a)(c.props),c}var o=a.prototype;return o.render=function(){return L.a.createElement(le.c,{history:this.history,children:this.props.children})},a}(L.a.Component),g=function(d){Object(N.a)(a,d);function a(){for(var c,h=arguments.length,E=new Array(h),R=0;R<h;R++)E[R]=arguments[R];return c=d.call.apply(d,[this].concat(E))||this,c.history=Object(T.b)(c.props),c}var o=a.prototype;return o.render=function(){return L.a.createElement(le.c,{history:this.history,children:this.props.children})},a}(L.a.Component),s=function(a,o){return typeof a=="function"?a(o):a},r=function(a,o){return typeof a=="string"?Object(T.c)(a,null,null,o):a},n=function(a){return a},u=L.a.forwardRef;typeof u=="undefined"&&(u=n);function l(d){return!!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)}var e=u(function(d,a){var o=d.innerRef,c=d.navigate,h=d.onClick,E=Object(S.a)(d,["innerRef","navigate","onClick"]),R=E.target,w=Object(C.a)({},E,{onClick:function(D){try{h&&h(D)}catch(U){throw D.preventDefault(),U}!D.defaultPrevented&&D.button===0&&(!R||R==="_self")&&!l(D)&&(D.preventDefault(),c())}});return n!==u?w.ref=a||o:w.ref=o,L.a.createElement("a",w)}),t=u(function(d,a){var o=d.component,c=o===void 0?e:o,h=d.replace,E=d.to,R=d.innerRef,w=Object(S.a)(d,["component","replace","to","innerRef"]);return L.a.createElement(le.e.Consumer,null,function(P){P||Object(x.a)(!1);var D=P.history,U=r(s(E,P.location),P.location),I=U?D.createHref(U):"",k=Object(C.a)({},w,{href:I,navigate:function(){var J=s(E,P.location),$=h?D.replace:D.push;$(J)}});return n!==u?k.ref=a||R:k.innerRef=R,L.a.createElement(c,k)})});if(!1)var i,b;var _=function(a){return a},p=L.a.forwardRef;typeof p=="undefined"&&(p=_);function y(){for(var d=arguments.length,a=new Array(d),o=0;o<d;o++)a[o]=arguments[o];return a.filter(function(c){return c}).join(" ")}var m=p(function(d,a){var o=d["aria-current"],c=o===void 0?"page":o,h=d.activeClassName,E=h===void 0?"active":h,R=d.activeStyle,w=d.className,P=d.exact,D=d.isActive,U=d.location,I=d.sensitive,k=d.strict,H=d.style,J=d.to,$=d.innerRef,fe=Object(S.a)(d,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return L.a.createElement(le.e.Consumer,null,function(he){he||Object(x.a)(!1);var ce=U||he.location,pe=r(s(J,ce),ce),_e=pe.pathname,oe=_e&&_e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ne=oe?Object(le.f)(ce.pathname,{path:oe,exact:P,sensitive:I,strict:k}):null,Ee=!!(D?D(ne,ce):ne),ke=Ee?y(w,E):w,we=Ee?Object(C.a)({},H,{},R):H,Re=Object(C.a)({"aria-current":Ee&&c||null,className:ke,style:we,to:pe},fe);return _!==p?Re.ref=a||$:Re.innerRef=$,L.a.createElement(t,Re)})});if(!1)var f},"5VLF":function(ut,tt,te){"use strict";var le,N;function O(L,T,A){var M=function(C,S){return L.js_beautify(C,S)};return M.js=L.js_beautify,M.css=T.css_beautify,M.html=A.html_beautify,M.js_beautify=L.js_beautify,M.css_beautify=T.css_beautify,M.html_beautify=A.html_beautify,M}!(le=[te("6UM0"),te("TXwP"),te("psGv")],N=function(L,T,A){return O(L,T,A)}.apply(tt,le),N!==void 0&&(ut.exports=N))},"6+eU":function(ut,tt,te){"use strict";te.d(tt,"a",function(){return p});var le=te("wx14"),N=te("rePB"),O=te("VTBJ"),L=te("1OyB"),T=te("vuIU"),A=te("Ji7U"),M=te("LK+K"),C=te("cDcd"),S=te.n(C),x=te("TSYQ"),v=te.n(x),g=function(m){var f,d="".concat(m.rootPrefixCls,"-item"),a=v()(d,"".concat(d,"-").concat(m.page),(f={},Object(N.a)(f,"".concat(d,"-active"),m.active),Object(N.a)(f,m.className,!!m.className),Object(N.a)(f,"".concat(d,"-disabled"),!m.page),f)),o=function(){m.onClick(m.page)},c=function(E){m.onKeyPress(E,m.onClick,m.page)};return S.a.createElement("li",{title:m.showTitle?m.page:null,className:a,onClick:o,onKeyPress:c,tabIndex:"0"},m.itemRender(m.page,"page",S.a.createElement("a",{rel:"nofollow"},m.page)))},s=g,r={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},n=function(y){Object(A.a)(f,y);var m=Object(M.a)(f);function f(){var d;Object(L.a)(this,f);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return d=m.call.apply(m,[this].concat(o)),d.state={goInputText:""},d.buildOptionText=function(h){return"".concat(h," ").concat(d.props.locale.items_per_page)},d.changeSize=function(h){d.props.changeSize(Number(h))},d.handleChange=function(h){d.setState({goInputText:h.target.value})},d.handleBlur=function(h){var E=d.props,R=E.goButton,w=E.quickGo,P=E.rootPrefixCls,D=d.state.goInputText;if(R||D==="")return;if(h.relatedTarget&&(h.relatedTarget.className.indexOf("".concat(P,"-prev"))>=0||h.relatedTarget.className.indexOf("".concat(P,"-next"))>=0))return;d.setState({goInputText:""}),w(d.getValidValue())},d.go=function(h){var E=d.state.goInputText;if(E==="")return;(h.keyCode===r.ENTER||h.type==="click")&&(d.setState({goInputText:""}),d.props.quickGo(d.getValidValue()))},d}return Object(T.a)(f,[{key:"getValidValue",value:function(){var a=this.state,o=a.goInputText,c=a.current;return!o||isNaN(o)?c:Number(o)}},{key:"getPageSizeOptions",value:function(){var a=this.props,o=a.pageSize,c=a.pageSizeOptions;return c.some(function(h){return h.toString()===o.toString()})?c:c.concat([o.toString()]).sort(function(h,E){var R=isNaN(Number(h))?0:Number(h),w=isNaN(Number(E))?0:Number(E);return R-w})}},{key:"render",value:function(){var a=this,o=this.props,c=o.pageSize,h=o.locale,E=o.rootPrefixCls,R=o.changeSize,w=o.quickGo,P=o.goButton,D=o.selectComponentClass,U=o.buildOptionText,I=o.selectPrefixCls,k=o.disabled,H=this.state.goInputText,J="".concat(E,"-options"),$=D,fe=null,he=null,ce=null;if(!R&&!w)return null;var pe=this.getPageSizeOptions();if(R&&$){var _e=pe.map(function(oe,ne){return S.a.createElement($.Option,{key:ne,value:oe.toString()},(U||a.buildOptionText)(oe))});fe=S.a.createElement($,{disabled:k,prefixCls:I,showSearch:!1,className:"".concat(J,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(c||pe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ne){return ne.parentNode}},_e)}return w&&(P&&(ce=typeof P=="boolean"?S.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:k,className:"".concat(J,"-quick-jumper-button")},h.jump_to_confirm):S.a.createElement("span",{onClick:this.go,onKeyUp:this.go},P)),he=S.a.createElement("div",{className:"".concat(J,"-quick-jumper")},h.jump_to,S.a.createElement("input",{disabled:k,type:"text",value:H,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),h.page,ce)),S.a.createElement("li",{className:"".concat(J)},fe,he)}}]),f}(S.a.Component);n.defaultProps={pageSizeOptions:["10","20","50","100"]};var u=n,l=te("N2Kk");function e(){}function t(y){return typeof y=="number"&&isFinite(y)&&Math.floor(y)===y}function i(y,m,f){return f}function b(y,m,f){var d=typeof y=="undefined"?m.pageSize:y;return Math.floor((f.total-1)/d)+1}var _=function(y){Object(A.a)(f,y);var m=Object(M.a)(f);function f(d){var a;Object(L.a)(this,f),a=m.call(this,d),a.getJumpPrevPage=function(){return Math.max(1,a.state.current-(a.props.showLessItems?3:5))},a.getJumpNextPage=function(){return Math.min(b(void 0,a.state,a.props),a.state.current+(a.props.showLessItems?3:5))},a.getItemIcon=function(R,w){var P=a.props.prefixCls,D=R||S.a.createElement("button",{type:"button","aria-label":w,className:"".concat(P,"-item-link")});return typeof R=="function"&&(D=S.a.createElement(R,Object(O.a)({},a.props))),D},a.savePaginationNode=function(R){a.paginationNode=R},a.isValid=function(R){return t(R)&&R!==a.state.current},a.shouldDisplayQuickJumper=function(){var R=a.props,w=R.showQuickJumper,P=R.pageSize,D=R.total;return D<=P?!1:w},a.handleKeyDown=function(R){(R.keyCode===r.ARROW_UP||R.keyCode===r.ARROW_DOWN)&&R.preventDefault()},a.handleKeyUp=function(R){var w=a.getValidValue(R),P=a.state.currentInputValue;w!==P&&a.setState({currentInputValue:w}),R.keyCode===r.ENTER?a.handleChange(w):R.keyCode===r.ARROW_UP?a.handleChange(w-1):R.keyCode===r.ARROW_DOWN&&a.handleChange(w+1)},a.changePageSize=function(R){var w=a.state.current,P=b(R,a.state,a.props);w=w>P?P:w,P===0&&(w=a.state.current),typeof R=="number"&&("pageSize"in a.props||a.setState({pageSize:R}),"current"in a.props||a.setState({current:w,currentInputValue:w})),a.props.onShowSizeChange(w,R),"onChange"in a.props&&a.props.onChange&&a.props.onChange(w,R)},a.handleChange=function(R){var w=a.props.disabled,P=R;if(a.isValid(P)&&!w){var D=b(void 0,a.state,a.props);P>D?P=D:P<1&&(P=1),"current"in a.props||a.setState({current:P,currentInputValue:P});var U=a.state.pageSize;return a.props.onChange(P,U),P}return a.state.current},a.prev=function(){a.hasPrev()&&a.handleChange(a.state.current-1)},a.next=function(){a.hasNext()&&a.handleChange(a.state.current+1)},a.jumpPrev=function(){a.handleChange(a.getJumpPrevPage())},a.jumpNext=function(){a.handleChange(a.getJumpNextPage())},a.hasPrev=function(){return a.state.current>1},a.hasNext=function(){return a.state.current<b(void 0,a.state,a.props)},a.runIfEnter=function(R,w){if(R.key==="Enter"||R.charCode===13){for(var P=arguments.length,D=new Array(P>2?P-2:0),U=2;U<P;U++)D[U-2]=arguments[U];w.apply(void 0,D)}},a.runIfEnterPrev=function(R){a.runIfEnter(R,a.prev)},a.runIfEnterNext=function(R){a.runIfEnter(R,a.next)},a.runIfEnterJumpPrev=function(R){a.runIfEnter(R,a.jumpPrev)},a.runIfEnterJumpNext=function(R){a.runIfEnter(R,a.jumpNext)},a.handleGoTO=function(R){(R.keyCode===r.ENTER||R.type==="click")&&a.handleChange(a.state.currentInputValue)};var o=d.onChange!==e,c="current"in d;c&&!o&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var h=d.defaultCurrent;"current"in d&&(h=d.current);var E=d.defaultPageSize;return"pageSize"in d&&(E=d.pageSize),h=Math.min(h,b(E,void 0,d)),a.state={current:h,currentInputValue:h,pageSize:E},a}return Object(T.a)(f,[{key:"componentDidUpdate",value:function(a,o){var c=this.props.prefixCls;if(o.current!==this.state.current&&this.paginationNode){var h=this.paginationNode.querySelector(".".concat(c,"-item-").concat(o.current));h&&document.activeElement===h&&h.blur()}}},{key:"getValidValue",value:function(a){var o=a.target.value,c=b(void 0,this.state,this.props),h=this.state.currentInputValue,E;return o===""?E=o:isNaN(Number(o))?E=h:o>=c?E=c:E=Number(o),E}},{key:"getShowSizeChanger",value:function(){var a=this.props,o=a.showSizeChanger,c=a.total,h=a.totalBoundaryShowSizeChanger;return typeof o!="undefined"?o:c>h}},{key:"renderPrev",value:function(a){var o=this.props,c=o.prevIcon,h=o.itemRender,E=h(a,"prev",this.getItemIcon(c,"prev page")),R=!this.hasPrev();return Object(C.isValidElement)(E)?Object(C.cloneElement)(E,{disabled:R}):E}},{key:"renderNext",value:function(a){var o=this.props,c=o.nextIcon,h=o.itemRender,E=h(a,"next",this.getItemIcon(c,"next page")),R=!this.hasNext();return Object(C.isValidElement)(E)?Object(C.cloneElement)(E,{disabled:R}):E}},{key:"render",value:function(){var a=this,o=this.props,c=o.prefixCls,h=o.className,E=o.style,R=o.disabled,w=o.hideOnSinglePage,P=o.total,D=o.locale,U=o.showQuickJumper,I=o.showLessItems,k=o.showTitle,H=o.showTotal,J=o.simple,$=o.itemRender,fe=o.showPrevNextJumpers,he=o.jumpPrevIcon,ce=o.jumpNextIcon,pe=o.selectComponentClass,_e=o.selectPrefixCls,oe=o.pageSizeOptions,ne=this.state,Ee=ne.current,ke=ne.pageSize,we=ne.currentInputValue;if(w===!0&&P<=ke)return null;var Re=b(void 0,this.state,this.props),Ue=[],be=null,Se=null,Ie=null,Me=null,De=null,Te=U&&U.goButton,ye=I?1:2,Ge=Ee-1>0?Ee-1:0,Be=Ee+1<Re?Ee+1:Re,He=Object.keys(this.props).reduce(function(B,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(B[W]=a.props[W]),B},{});if(J)return Te&&(typeof Te=="boolean"?De=S.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},D.jump_to_confirm):De=S.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Te),De=S.a.createElement("li",{title:k?"".concat(D.jump_to).concat(Ee,"/").concat(Re):null,className:"".concat(c,"-simple-pager")},De)),S.a.createElement("ul",Object(le.a)({className:v()(c,"".concat(c,"-simple"),Object(N.a)({},"".concat(c,"-disabled"),R),h),style:E,ref:this.savePaginationNode},He),S.a.createElement("li",{title:k?D.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:v()("".concat(c,"-prev"),Object(N.a)({},"".concat(c,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ge)),S.a.createElement("li",{title:k?"".concat(Ee,"/").concat(Re):null,className:"".concat(c,"-simple-pager")},S.a.createElement("input",{type:"text",value:we,disabled:R,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),S.a.createElement("span",{className:"".concat(c,"-slash")},"/"),Re),S.a.createElement("li",{title:k?D.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:v()("".concat(c,"-next"),Object(N.a)({},"".concat(c,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Be)),De);if(Re<=3+ye*2){var Ne={locale:D,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:k,itemRender:$};Re||Ue.push(S.a.createElement(s,Object(le.a)({},Ne,{key:"noPager",page:Re,className:"".concat(c,"-disabled")})));for(var Ve=1;Ve<=Re;Ve+=1){var ze=Ee===Ve;Ue.push(S.a.createElement(s,Object(le.a)({},Ne,{key:Ve,page:Ve,active:ze})))}}else{var Fe=I?D.prev_3:D.prev_5,Ce=I?D.next_3:D.next_5;fe&&(be=S.a.createElement("li",{title:k?Fe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:v()("".concat(c,"-jump-prev"),Object(N.a)({},"".concat(c,"-jump-prev-custom-icon"),!!he))},$(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(he,"prev page"))),Se=S.a.createElement("li",{title:k?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:v()("".concat(c,"-jump-next"),Object(N.a)({},"".concat(c,"-jump-next-custom-icon"),!!ce))},$(this.getJumpNextPage(),"jump-next",this.getItemIcon(ce,"next page")))),Me=S.a.createElement(s,{locale:D,last:!0,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:k,itemRender:$}),Ie=S.a.createElement(s,{locale:D,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:k,itemRender:$});var We=Math.max(1,Ee-ye),je=Math.min(Ee+ye,Re);Ee-1<=ye&&(je=1+ye*2),Re-Ee<=ye&&(We=Re-ye*2);for(var me=We;me<=je;me+=1){var Le=Ee===me;Ue.push(S.a.createElement(s,{locale:D,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:me,page:me,active:Le,showTitle:k,itemRender:$}))}Ee-1>=ye*2&&Ee!==1+2&&(Ue[0]=Object(C.cloneElement)(Ue[0],{className:"".concat(c,"-item-after-jump-prev")}),Ue.unshift(be)),Re-Ee>=ye*2&&Ee!==Re-2&&(Ue[Ue.length-1]=Object(C.cloneElement)(Ue[Ue.length-1],{className:"".concat(c,"-item-before-jump-next")}),Ue.push(Se)),We!==1&&Ue.unshift(Ie),je!==Re&&Ue.push(Me)}var re=null;H&&(re=S.a.createElement("li",{className:"".concat(c,"-total-text")},H(P,[P===0?0:(Ee-1)*ke+1,Ee*ke>P?P:Ee*ke])));var q=!this.hasPrev()||!Re,Z=!this.hasNext()||!Re;return S.a.createElement("ul",Object(le.a)({className:v()(c,h,Object(N.a)({},"".concat(c,"-disabled"),R)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},He),re,S.a.createElement("li",{title:k?D.prev_page:null,onClick:this.prev,tabIndex:q?null:0,onKeyPress:this.runIfEnterPrev,className:v()("".concat(c,"-prev"),Object(N.a)({},"".concat(c,"-disabled"),q)),"aria-disabled":q},this.renderPrev(Ge)),Ue,S.a.createElement("li",{title:k?D.next_page:null,onClick:this.next,tabIndex:Z?null:0,onKeyPress:this.runIfEnterNext,className:v()("".concat(c,"-next"),Object(N.a)({},"".concat(c,"-disabled"),Z)),"aria-disabled":Z},this.renderNext(Be)),S.a.createElement(u,{disabled:R,locale:D,rootPrefixCls:c,selectComponentClass:pe,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ee,pageSize:ke,pageSizeOptions:oe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Te}))}}],[{key:"getDerivedStateFromProps",value:function(a,o){var c={};if("current"in a&&(c.current=a.current,a.current!==o.current&&(c.currentInputValue=c.current)),"pageSize"in a&&a.pageSize!==o.pageSize){var h=o.current,E=b(a.pageSize,o,a);h=h>E?E:h,"current"in a||(c.current=h,c.currentInputValue=h),c.pageSize=a.pageSize}return c}}]),f}(S.a.Component);_.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:e,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:e,locale:l.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var p=_},"6UM0":function(ut,tt,te){var le,N;(function(){var O;(function(){"use strict";var T=[function(S,x,v){var g=v(1).Beautifier,s=v(5).Options;function r(n,u){var l=new g(n,u);return l.beautify()}S.exports=r,S.exports.defaultOptions=function(){return new s}},function(S,x,v){var g=v(2).Output,s=v(3).Token,r=v(4),n=v(5).Options,u=v(7).Tokenizer,l=v(7).line_starters,e=v(7).positionable_operators,t=v(7).TOKEN;function i(I,k){return k.indexOf(I)!==-1}function b(I){return I.replace(/^\s+/g,"")}function _(I){for(var k={},H=0;H<I.length;H++)k[I[H].replace(/-/g,"_")]=I[H];return k}function p(I,k){return I&&I.type===t.RESERVED&&I.text===k}function y(I,k){return I&&I.type===t.RESERVED&&i(I.text,k)}var m=["case","return","do","if","throw","else","await","break","continue","async"],f=["before-newline","after-newline","preserve-newline"],d=_(f),a=[d.before_newline,d.preserve_newline],o={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function c(I,k){if(k.multiline_frame||k.mode===o.ForInitializer||k.mode===o.Conditional)return;I.remove_indent(k.start_line_index)}function h(I){I=I.replace(r.allLineBreaks,`
`);for(var k=[],H=I.indexOf(`
`);H!==-1;)k.push(I.substring(0,H)),I=I.substring(H+1),H=I.indexOf(`
`);return I.length&&k.push(I),k}function E(I){return I===o.ArrayLiteral}function R(I){return i(I,[o.Expression,o.ForInitializer,o.Conditional])}function w(I,k){for(var H=0;H<I.length;H++){var J=I[H].trim();if(J.charAt(0)!==k)return!1}return!0}function P(I,k){for(var H=0,J=I.length,$;H<J;H++)if($=I[H],$&&$.indexOf(k)!==0)return!1;return!0}function D(I,k){k=k||{},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 n(k)}D.prototype.create_flags=function(I,k){var H=0;I&&(H=I.indentation_level,!this._output.just_added_newline()&&I.line_indent_level>H&&(H=I.line_indent_level));var J={mode:k,parent:I,last_token:I?I.last_token:new s(t.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:H,alignment:0,line_indent_level:I?I.line_indent_level:H,start_line_index:this._output.get_line_number(),ternary_depth:0};return J},D.prototype._reset=function(I){var k=I.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,k),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(o.BlockStatement);var H=new u(I,this._options);return this._tokens=H.tokenize(),I},D.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I,k=this._reset(this._source_text),H=this._options.eol;this._options.eol==="auto"&&(H=`
`,k&&r.lineBreak.test(k||"")&&(H=k.match(r.lineBreak)[0]));for(var J=this._tokens.next();J;)this.handle_token(J),this._last_last_text=this._flags.last_token.text,this._flags.last_token=J,J=this._tokens.next();return I=this._output.get_code(H),I},D.prototype.handle_token=function(I,k){I.type===t.START_EXPR?this.handle_start_expr(I):I.type===t.END_EXPR?this.handle_end_expr(I):I.type===t.START_BLOCK?this.handle_start_block(I):I.type===t.END_BLOCK?this.handle_end_block(I):I.type===t.WORD?this.handle_word(I):I.type===t.RESERVED?this.handle_word(I):I.type===t.SEMICOLON?this.handle_semicolon(I):I.type===t.STRING?this.handle_string(I):I.type===t.EQUALS?this.handle_equals(I):I.type===t.OPERATOR?this.handle_operator(I):I.type===t.COMMA?this.handle_comma(I):I.type===t.BLOCK_COMMENT?this.handle_block_comment(I,k):I.type===t.COMMENT?this.handle_comment(I,k):I.type===t.DOT?this.handle_dot(I):I.type===t.EOF?this.handle_eof(I):I.type===t.UNKNOWN?this.handle_unknown(I,k):this.handle_unknown(I,k)},D.prototype.handle_whitespace_and_comments=function(I,k){var H=I.newlines,J=this._options.keep_array_indentation&&E(this._flags.mode);if(I.comments_before)for(var $=I.comments_before.next();$;)this.handle_whitespace_and_comments($,k),this.handle_token($,k),$=I.comments_before.next();if(J)for(var fe=0;fe<H;fe+=1)this.print_newline(fe>0,k);else if(this._options.max_preserve_newlines&&H>this._options.max_preserve_newlines&&(H=this._options.max_preserve_newlines),this._options.preserve_newlines&&H>1){this.print_newline(!1,k);for(var he=1;he<H;he+=1)this.print_newline(!0,k)}};var U=["async","break","continue","return","throw","yield"];D.prototype.allow_wrap_or_preserved_newline=function(I,k){if(k=k===void 0?!1:k,this._output.just_added_newline())return;var H=this._options.preserve_newlines&&I.newlines||k,J=i(this._flags.last_token.text,e)||i(I.text,e);if(J){var $=i(this._flags.last_token.text,e)&&i(this._options.operator_position,a)||i(I.text,e);H=H&&$}if(H)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(y(this._flags.last_token,U))return;this._output.set_wrap_point()}},D.prototype.print_newline=function(I,k){if(!k&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var H=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&p(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(I)&&(this._flags.multiline_frame=!0)},D.prototype.print_token_line_indentation=function(I){this._output.just_added_newline()&&(this._options.keep_array_indentation&&I.newlines&&(I.text==="["||E(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))},D.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===t.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var k=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(k),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)},D.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.set_mode=function(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)},D.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===o.Statement&&c(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.start_of_object_property=function(){return this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"]))},D.prototype.start_of_statement=function(I){var k=!1;return k=k||y(this._flags.last_token,["var","let","const"])&&I.type===t.WORD,k=k||p(this._flags.last_token,"do"),k=k||!(this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement)&&y(this._flags.last_token,U)&&!I.newlines,k=k||p(this._flags.last_token,"else")&&!(p(I,"if")&&!I.comments_before),k=k||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===o.ForInitializer||this._previous_flags.mode===o.Conditional),k=k||this._flags.last_token.type===t.WORD&&this._flags.mode===o.BlockStatement&&!this._flags.in_case&&!(I.text==="--"||I.text==="++")&&this._last_last_text!=="function"&&I.type!==t.WORD&&I.type!==t.RESERVED,k=k||this._flags.mode===o.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"])),k?(this.set_mode(o.Statement),this.indent(),this.handle_whitespace_and_comments(I,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I,y(I,["do","for","if","while"])),!0):!1},D.prototype.handle_start_expr=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I);var k=o.Expression;if(I.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){y(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(I),this.set_mode(k),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}k=o.ArrayLiteral,E(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())),i(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,k=o.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,k=o.Conditional):i(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:(i(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var H=this._tokens.peek(-3);if(this._options.space_after_named_function&&H){var J=this._tokens.peek(-4);y(H,["async","function"])||H.text==="*"&&y(J,["async","function"])?this._output.space_before_token=!0:this._flags.mode===o.ObjectLiteral?(H.text==="{"||H.text===","||H.text==="*"&&(J.text==="{"||J.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===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&i(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===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(I,I.newlines),this.print_token(I),this.set_mode(k),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},D.prototype.handle_end_expr=function(I){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(I,I.text==="]"&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.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(),c(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===o.Conditional&&(this._previous_flags.mode=o.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},D.prototype.handle_start_block=function(I){this.handle_whitespace_and_comments(I);var k=this._tokens.peek(),H=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(o.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(o.BlockStatement):H&&(i(H.text,[":",","])&&i(k.type,[t.STRING,t.WORD,t.RESERVED])||i(k.text,["get","set","..."])&&i(H.type,[t.WORD,t.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(H.text,[":",","])?this.set_mode(o.BlockStatement):this.set_mode(o.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(o.BlockStatement):i(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||y(this._flags.last_token,["return","throw","import","default"])?this.set_mode(o.ObjectLiteral):this.set_mode(o.BlockStatement),this._flags.last_token&&(y(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var J=!k.comments_before&&k.text==="}",$=J&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,he=null;this._flags.inline_frame=!0;do if(fe+=1,he=this._tokens.peek(fe-1),he.newlines){this._flags.inline_frame=!1;break}while(he.type!==t.EOF&&!(he.type===t.END_BLOCK&&he.opened===I))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&($||this._flags.last_token.type===t.EQUALS||y(this._flags.last_token,m)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(E(this._previous_flags.mode)&&(this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.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!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(I),this.indent(),!J&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},D.prototype.handle_end_block=function(I){for(this.handle_whitespace_and_comments(I);this._flags.mode===o.Statement;)this.restore_mode();var k=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!k?this._output.space_before_token=!0:this._options.brace_style==="expand"?k||this.print_newline():k||(E(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)},D.prototype.handle_word=function(I){if(I.type===t.RESERVED){if(i(I.text,["set","get"])&&this._flags.mode!==o.ObjectLiteral)I.type=t.WORD;else if(I.text==="import"&&i(this._tokens.peek().text,["(","."]))I.type=t.WORD;else if(i(I.text,["as","from"])&&!this._flags.import_block)I.type=t.WORD;else if(this._flags.mode===o.ObjectLiteral){var k=this._tokens.peek();k.text===":"&&(I.type=t.WORD)}}if(this.start_of_statement(I)?y(this._flags.last_token,["var","let","const"])&&I.type===t.WORD&&(this._flags.declaration_statement=!0):I.newlines&&!R(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!y(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===o.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&y(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===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I)),p(I,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!I.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?y(this._flags.last_token,["get","set","new","export"])||y(this._flags.last_token,U)?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===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(I),this._flags.last_word=I.text;return}var H="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?H="SPACE":y(I,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines?H="NEWLINE":(H="SPACE",this._output.space_before_token=!0):H="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===o.BlockStatement?H="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&R(this._flags.mode)?H="SPACE":this._flags.last_token.type===t.STRING?H="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&i(this._last_last_text,["{",","]))?H="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?H="SPACE":H="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,H="NEWLINE"),y(I,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?H="SPACE":H="NEWLINE"),y(I,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===o.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 J=this._output.current_line;J.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else H==="NEWLINE"?y(this._flags.last_token,m)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&y(I,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!y(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()):y(I,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():H==="SPACE"&&(this._output.space_before_token=!0);I.previous&&(I.previous.type===t.WORD||I.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(I),this._flags.last_word=I.text,I.type===t.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))},D.prototype.handle_semicolon=function(I){this.start_of_statement(I)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(I);for(var k=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&p(k,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(I)},D.prototype.handle_string=function(I){I.text.startsWith("`")&&I.newlines===0&&I.whitespace_before===""&&(I.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(I)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(I),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I):I.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(I.previous.text==="]"||I.previous.text===")")&&I.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(I)},D.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},D.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?(R(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===o.ObjectLiteral||this._flags.mode===o.Statement&&this._flags.parent.mode===o.ObjectLiteral?(this._flags.mode===o.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(I)},D.prototype.handle_operator=function(I){var k=I.text==="*"&&(y(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),H=i(I.text,["-","+"])&&(i(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||i(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(I)){var J=!k;this.handle_whitespace_and_comments(I,J)}if(I.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(I);return}if(I.text==="::"){this.print_token(I);return}if(this._flags.last_token.type===t.OPERATOR&&i(this._options.operator_position,a)&&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!==t.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 $=!0,fe=!0,he=!1;if(I.text===":"?this._flags.ternary_depth===0?$=!1:(this._flags.ternary_depth-=1,he=!0):I.text==="?"&&(this._flags.ternary_depth+=1),!H&&!k&&this._options.preserve_newlines&&i(I.text,e)){var ce=I.text===":",pe=ce&&he,_e=ce&&!he;switch(this._options.operator_position){case d.before_newline:this._output.space_before_token=!_e,this.print_token(I),(!ce||pe)&&this.allow_wrap_or_preserved_newline(I),this._output.space_before_token=!0;return;case d.after_newline:this._output.space_before_token=!0,!ce||pe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(I):this._output.space_before_token=!1,this.print_token(I),this._output.space_before_token=!0;return;case d.preserve_newline:_e||this.allow_wrap_or_preserved_newline(I),$=!(this._output.just_added_newline()||_e),this._output.space_before_token=$,this.print_token(I),this._output.space_before_token=!0;return}}if(k){this.allow_wrap_or_preserved_newline(I),$=!1;var oe=this._tokens.peek();fe=oe&&i(oe.type,[t.WORD,t.RESERVED])}else if(I.text==="...")this.allow_wrap_or_preserved_newline(I),$=this._flags.last_token.type===t.START_BLOCK,fe=!1;else if(i(I.text,["--","++","!","~"])||H){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(I),$=!1,fe=!1,I.newlines&&(I.text==="--"||I.text==="++"||I.text==="~")){var ne=y(this._flags.last_token,m)&&I.newlines;ne&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ne,!0)}this._flags.last_token.text===";"&&R(this._flags.mode)&&($=!0),this._flags.last_token.type===t.RESERVED?$=!0:this._flags.last_token.type===t.END_EXPR?$=!(this._flags.last_token.text==="]"&&(I.text==="--"||I.text==="++")):this._flags.last_token.type===t.OPERATOR&&($=i(I.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(I.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===o.BlockStatement&&!this._flags.inline_frame||this._flags.mode===o.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||$,this.print_token(I),this._output.space_before_token=fe},D.prototype.handle_block_comment=function(I,k){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,k),this.print_token(I),I.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!r.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,k)},D.prototype.print_block_commment=function(I,k){var H=h(I.text),J,$=!1,fe=!1,he=I.whitespace_before,ce=he.length;if(this.print_newline(!1,k),this.print_token_line_indentation(I),this._output.add_token(H[0]),this.print_newline(!1,k),H.length>1){for(H=H.slice(1),$=w(H,"*"),fe=P(H,he),$&&(this._flags.alignment=1),J=0;J<H.length;J++)$?(this.print_token_line_indentation(I),this._output.add_token(b(H[J]))):fe&&H[J]?(this.print_token_line_indentation(I),this._output.add_token(H[J].substring(ce))):(this._output.current_line.set_indent(-1),this._output.add_token(H[J])),this.print_newline(!1,k);this._flags.alignment=0}},D.prototype.handle_comment=function(I,k){I.newlines?this.print_newline(!1,k):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(I),this.print_newline(!1,k)},D.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),y(this._flags.last_token,m)?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)},D.prototype.handle_unknown=function(I,k){this.print_token(I),I.text[I.text.length-1]===`
`&&this.print_newline(!1,k)},D.prototype.handle_eof=function(I){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I)},S.exports.Beautifier=D},function(S){function x(s){this.__parent=s,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=[]}x.prototype.clone_empty=function(){var s=new x(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},x.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},x.prototype.has_match=function(s){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(s))return!0;return!1},x.prototype.set_indent=function(s,r){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},x.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)},x.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},x.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},x.prototype.is_empty=function(){return this.__items.length===0},x.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},x.prototype.push=function(s){this.__items.push(s);var r=s.lastIndexOf(`
`);r!==-1?this.__character_count=s.length-r:this.__character_count+=s.length},x.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},x.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},x.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},x.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},x.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function v(s,r){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),r=r||"",s.indent_level>0&&(r=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}v.prototype.get_indent_size=function(s,r){var n=this.__base_string_length;return r=r||0,s<0&&(n=0),n+=s*this.__indent_size,n+=r,n},v.prototype.get_indent_string=function(s,r){var n=this.__base_string;return r=r||0,s<0&&(s=0,n=""),r+=s*this.__indent_size,this.__ensure_cache(r),n+=this.__cache[r],n},v.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var s=this.__cache.length,r=0,n="";this.__indent_size&&s>=this.__indent_size&&(r=Math.floor(s/this.__indent_size),s-=r*this.__indent_size,n=new Array(r+1).join(this.__indent_string)),s&&(n+=new Array(s+1).join(" ")),this.__cache.push(n)};function g(s,r){this.__indent_cache=new v(s,r),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new x(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(s,r){return this.__indent_cache.get_indent_string(s,r)},g.prototype.get_indent_size=function(s,r){return this.__indent_cache.get_indent_size(s,r)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(s){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
`);return s!==`
`&&(n=n.replace(/[\n]/g,s)),n},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(s,r){return s=s||0,r=r||0,this.next_line.set_indent(s,r),this.__lines.length>1?(this.current_line.set_indent(s,r),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(s){for(var r=0;r<s.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(s){for(var r=this.__lines.length;s<r;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(s,r){for(var n=this.__lines.length-2;n>=0;){var u=this.__lines[n];if(u.is_empty())break;if(u.item(0).indexOf(s)!==0&&u.item(-1)!==r){this.__lines.splice(n+1,0,new x(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},S.exports.Output=g},function(S){function x(v,g,s,r){this.type=v,this.text=g,this.comments_before=null,this.newlines=s||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}S.exports.Token=x},function(S,x){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\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",r="\\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",n="(?:\\\\u[0-9a-fA-F]{4}|["+v+s+"])",u="(?:\\\\u[0-9a-fA-F]{4}|["+g+s+r+"])*";x.identifier=new RegExp(n+u,"g"),x.identifierStart=new RegExp(n),x.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+s+r+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;x.newline=/[\n\r\u2028\u2029]/,x.lineBreak=new RegExp(`\r
|`+x.newline.source),x.allLineBreaks=new RegExp(x.lineBreak.source,"g")},function(S,x,v){var g=v(6).Options,s=["before-newline","after-newline","preserve-newline"];function r(n){g.call(this,n,"js");var u=this.raw_options.brace_style||null;u==="expand-strict"?this.raw_options.brace_style="expand":u==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var e=0;e<l.length;e++)l[e]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[e];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",s),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}r.prototype=new g,S.exports.Options=r},function(S){function x(s,r){this.raw_options=v(s,r),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"])}x.prototype._get_array=function(s,r){var n=this.raw_options[s],u=r||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(u=n.concat()):typeof n=="string"&&(u=n.split(/[^a-zA-Z0-9_\/\-]+/)),u},x.prototype._get_boolean=function(s,r){var n=this.raw_options[s],u=n===void 0?!!r:!!n;return u},x.prototype._get_characters=function(s,r){var n=this.raw_options[s],u=r||"";return typeof n=="string"&&(u=n.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},x.prototype._get_number=function(s,r){var n=this.raw_options[s];r=parseInt(r,10),isNaN(r)&&(r=0);var u=parseInt(n,10);return isNaN(u)&&(u=r),u},x.prototype._get_selection=function(s,r,n){var u=this._get_selection_list(s,r,n);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[s]+"'");return u[0]},x.prototype._get_selection_list=function(s,r,n){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[r[0]],!this._is_valid_selection(n,r))throw new Error("Invalid Default Value!");var u=this._get_array(s,n);if(!this._is_valid_selection(u,r))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[s]+"'");return u},x.prototype._is_valid_selection=function(s,r){return s.length&&r.length&&!s.some(function(n){return r.indexOf(n)===-1})};function v(s,r){var n={};s=g(s);var u;for(u in s)u!==r&&(n[u]=s[u]);if(r&&s[r])for(u in s[r])n[u]=s[r][u];return n}function g(s){var r={},n;for(n in s){var u=n.replace(/-/g,"_");r[u]=s[n]}return r}S.exports.Options=x,S.exports.normalizeOpts=g,S.exports.mergeOpts=v},function(S,x,v){var g=v(8).InputScanner,s=v(9).Tokenizer,r=v(9).TOKEN,n=v(13).Directives,u=v(4),l=v(12).Pattern,e=v(14).TemplatablePattern;function t(w,P){return P.indexOf(w)!==-1}var i={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:r.START,RAW:r.RAW,EOF:r.EOF},b=new n(/\/\*/,/\*\//),_=/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]/,y=/[^\d\.]/,m=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),f="\\?\\.(?!\\d) "+f,f=f.replace(/ /g,"|");var d=new RegExp(f),a="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),o=a.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),c=new RegExp("^(?:"+o.join("|")+")$"),h,E=function(w,P){s.call(this,w,P),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var D=new l(this._input),U=new e(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(u.identifier).matching(u.identifierMatch),number:D.matching(_),punct:D.matching(d),comment:D.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:D.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:D.matching(/<!--/),html_comment_end:D.matching(/-->/),include:D.starting_with(/#include/).until_after(u.lineBreak),shebang:D.starting_with(/#!/).until_after(u.lineBreak),xml:D.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};E.prototype=new s,E.prototype._is_comment=function(w){return w.type===i.COMMENT||w.type===i.BLOCK_COMMENT||w.type===i.UNKNOWN},E.prototype._is_opening=function(w){return w.type===i.START_BLOCK||w.type===i.START_EXPR},E.prototype._is_closing=function(w,P){return(w.type===i.END_BLOCK||w.type===i.END_EXPR)&&P&&(w.text==="]"&&P.text==="["||w.text===")"&&P.text==="("||w.text==="}"&&P.text==="{")},E.prototype._reset=function(){h=!1},E.prototype._get_next_token=function(w,P){var D=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(i.EOF,""):(D=D||this._read_non_javascript(U),D=D||this._read_string(U),D=D||this._read_word(w),D=D||this._read_singles(U),D=D||this._read_comment(U),D=D||this._read_regexp(U,w),D=D||this._read_xml(U,w),D=D||this._read_punctuation(),D=D||this._create_token(i.UNKNOWN,this._input.next()),D)},E.prototype._read_word=function(w){var P;if(P=this.__patterns.identifier.read(),P!=="")return P=P.replace(u.allLineBreaks,`
`),!(w.type===i.DOT||w.type===i.RESERVED&&(w.text==="set"||w.text==="get"))&&c.test(P)?(P==="in"||P==="of")&&(w.type===i.WORD||w.type===i.STRING)?this._create_token(i.OPERATOR,P):this._create_token(i.RESERVED,P):this._create_token(i.WORD,P);if(P=this.__patterns.number.read(),P!=="")return this._create_token(i.WORD,P)},E.prototype._read_singles=function(w){var P=null;return w==="("||w==="["?P=this._create_token(i.START_EXPR,w):w===")"||w==="]"?P=this._create_token(i.END_EXPR,w):w==="{"?P=this._create_token(i.START_BLOCK,w):w==="}"?P=this._create_token(i.END_BLOCK,w):w===";"?P=this._create_token(i.SEMICOLON,w):w==="."&&y.test(this._input.peek(1))?P=this._create_token(i.DOT,w):w===","&&(P=this._create_token(i.COMMA,w)),P&&this._input.next(),P},E.prototype._read_punctuation=function(){var w=this.__patterns.punct.read();if(w!=="")return w==="="?this._create_token(i.EQUALS,w):w==="?."?this._create_token(i.DOT,w):this._create_token(i.OPERATOR,w)},E.prototype._read_non_javascript=function(w){var P="";if(w==="#"){if(this._is_first_token()&&(P=this.__patterns.shebang.read(),P))return this._create_token(i.UNKNOWN,P.trim()+`
`);if(P=this.__patterns.include.read(),P)return this._create_token(i.UNKNOWN,P.trim()+`
`);w=this._input.next();var D="#";if(this._input.hasNext()&&this._input.testChar(p)){do w=this._input.next(),D+=w;while(this._input.hasNext()&&w!=="#"&&w!=="=");return w==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(D+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(D+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,D)}this._input.back()}else if(w==="<"&&this._is_first_token()){if(P=this.__patterns.html_comment_start.read(),P){for(;this._input.hasNext()&&!this._input.testChar(u.newline);)P+=this._input.next();return h=!0,this._create_token(i.COMMENT,P)}}else if(h&&w==="-"&&(P=this.__patterns.html_comment_end.read(),P))return h=!1,this._create_token(i.COMMENT,P);return null},E.prototype._read_comment=function(w){var P=null;if(w==="/"){var D="";if(this._input.peek(1)==="*"){D=this.__patterns.block_comment.read();var U=b.get_directives(D);U&&U.ignore==="start"&&(D+=b.readIgnored(this._input)),D=D.replace(u.allLineBreaks,`
`),P=this._create_token(i.BLOCK_COMMENT,D),P.directives=U}else this._input.peek(1)==="/"&&(D=this.__patterns.comment.read(),P=this._create_token(i.COMMENT,D))}return P},E.prototype._read_string=function(w){if(w==="`"||w==="'"||w==='"'){var P=this._input.next();return this.has_char_escapes=!1,w==="`"?P+=this._read_string_recursive("`",!0,"${"):P+=this._read_string_recursive(w),this.has_char_escapes&&this._options.unescape_strings&&(P=R(P)),this._input.peek()===w&&(P+=this._input.next()),P=P.replace(u.allLineBreaks,`
`),this._create_token(i.STRING,P)}return null},E.prototype._allow_regexp_or_xml=function(w){return w.type===i.RESERVED&&t(w.text,["return","case","throw","else","do","typeof","yield"])||w.type===i.END_EXPR&&w.text===")"&&w.opened.previous.type===i.RESERVED&&t(w.opened.previous.text,["if","while","for"])||t(w.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},E.prototype._read_regexp=function(w,P){if(w==="/"&&this._allow_regexp_or_xml(P)){for(var D=this._input.next(),U=!1,I=!1;this._input.hasNext()&&(U||I||this._input.peek()!==w)&&!this._input.testChar(u.newline);)D+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?I=!0:this._input.peek()==="]"&&(I=!1)),this._input.next();return this._input.peek()===w&&(D+=this._input.next(),D+=this._input.read(u.identifier)),this._create_token(i.STRING,D)}return null},E.prototype._read_xml=function(w,P){if(this._options.e4x&&w==="<"&&this._allow_regexp_or_xml(P)){var D="",U=this.__patterns.xml.read_match();if(U){for(var I=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),k=I.indexOf("{")===0,H=0;U;){var J=!!U[1],$=U[2],fe=!!U[U.length-1]||$.slice(0,8)==="![CDATA[";if(!fe&&($===I||k&&$.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(J?--H:++H),D+=U[0],H<=0)break;U=this.__patterns.xml.read_match()}return U||(D+=this._input.match(/[\s\S]*/g)[0]),D=D.replace(u.allLineBreaks,`
`),this._create_token(i.STRING,D)}}return null};function R(w){for(var P="",D=0,U=new g(w),I=null;U.hasNext();)if(I=U.match(/([\s]|[^\\]|\\\\)+/g),I&&(P+=I[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")I=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")I=U.match(/u([0-9A-Fa-f]{4})/g);else{P+="\\",U.hasNext()&&(P+=U.next());continue}if(!I)return w;if(D=parseInt(I[1],16),D>126&&D<=255&&I[0].indexOf("x")===0)return w;if(D>=0&&D<32){P+="\\"+I[0];continue}else D===34||D===39||D===92?P+="\\"+String.fromCharCode(D):P+=String.fromCharCode(D)}return P}E.prototype._read_string_recursive=function(w,P,D){var U,I;w==="'"?I=this.__patterns.single_quote:w==='"'?I=this.__patterns.double_quote:w==="`"?I=this.__patterns.template_text:w==="}"&&(I=this.__patterns.template_expression);for(var k=I.read(),H="";this._input.hasNext();){if(H=this._input.next(),H===w||!P&&u.newline.test(H)){this._input.back();break}else H==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),H+=this._input.next()):D&&(D==="${"&&H==="$"&&this._input.peek()==="{"&&(H+=this._input.next()),D===H&&(w==="`"?H+=this._read_string_recursive("}",P,"`"):H+=this._read_string_recursive("`",P,"${"),this._input.hasNext()&&(H+=this._input.next())));H+=I.read(),k+=H}return k},S.exports.Tokenizer=E,S.exports.TOKEN=i,S.exports.positionable_operators=m.slice(),S.exports.line_starters=a.slice()},function(S){var x=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var s=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(s=this.__input.charAt(g)),s},v.prototype.__match=function(g,s){g.lastIndex=s;var r=g.exec(this.__input);return r&&!(x&&g.sticky)&&(r.index!==s&&(r=null)),r},v.prototype.test=function(g,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(g,s):!1},v.prototype.testChar=function(g,s){var r=this.peek(s);return g.lastIndex=0,r!==null&&g.test(r)},v.prototype.match=function(g){var s=this.__match(g,this.__position);return s?this.__position+=s[0].length:s=null,s},v.prototype.read=function(g,s,r){var n="",u;return g&&(u=this.match(g),u&&(n+=u[0])),s&&(u||!g)&&(n+=this.readUntil(s,r)),n},v.prototype.readUntil=function(g,s){var r="",n=this.__position;g.lastIndex=this.__position;var u=g.exec(this.__input);return u?(n=u.index,s&&(n+=u[0].length)):n=this.__input_length,r=this.__input.substring(this.__position,n),this.__position=n,r},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,s){var r=null,n="g";return s&&x&&(n="y"),typeof g=="string"&&g!==""?r=new RegExp(g,n):g&&(r=new RegExp(g.source,n)),r},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var s=this.__position,r=this.readUntilAfter(g);return this.__position=s,r},v.prototype.lookBack=function(g){var s=this.__position-1;return s>=g.length&&this.__input.substring(s-g.length,s).toLowerCase()===g},S.exports.InputScanner=v},function(S,x,v){var g=v(8).InputScanner,s=v(3).Token,r=v(10).TokenStream,n=v(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new g(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new n(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var e,t=new s(u.START,""),i=null,b=[],_=new r;t.type!==u.EOF;){for(e=this._get_next_token(t,i);this._is_comment(e);)_.add(e),e=this._get_next_token(t,i);_.isEmpty()||(e.comments_before=_,_=new r),e.parent=i,this._is_opening(e)?(b.push(i),i=e):i&&this._is_closing(e,i)&&(e.opened=i,i.closed=e,i=b.pop(),e.parent=i),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(u.RAW,i):this._create_token(u.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){var i=new s(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},S.exports.Tokenizer=l,S.exports.TOKEN=u},function(S){function x(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}x.prototype.restart=function(){this.__position=0},x.prototype.isEmpty=function(){return this.__tokens_length===0},x.prototype.hasNext=function(){return this.__position<this.__tokens_length},x.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},x.prototype.peek=function(v){var g=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(g=this.__tokens[v]),g},x.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},S.exports.TokenStream=x},function(S,x,v){var g=v(12).Pattern;function s(r,n){g.call(this,r,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new g,s.prototype.__set_whitespace_patterns=function(r,n){r+="\\t ",n+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+n+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+n+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var n=this.__split(this._newline_regexp,r);this.newline_count=n.length-1,this.whitespace_before_token=n[this.newline_count]}return r},s.prototype.matching=function(r,n){var u=this._create();return u.__set_whitespace_patterns(r,n),u._update(),u},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(r,n){r.lastIndex=0;for(var u=0,l=[],e=r.exec(n);e;)l.push(n.substring(u,e.index)),u=e.index+e[0].length,e=r.exec(n);return u<n.length?l.push(n.substring(u,n.length)):l.push(""),l},S.exports.WhitespacePattern=s},function(S){function x(v,g){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}x.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},x.prototype.read_match=function(){return this._input.match(this._match_pattern)},x.prototype.until_after=function(v){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(v),g._update(),g},x.prototype.until=function(v){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(v),g._update(),g},x.prototype.starting_with=function(v){var g=this._create();return g._starting_pattern=this._input.get_regexp(v,!0),g._update(),g},x.prototype.matching=function(v){var g=this._create();return g._match_pattern=this._input.get_regexp(v,!0),g._update(),g},x.prototype._create=function(){return new x(this._input,this)},x.prototype._update=function(){},S.exports.Pattern=x},function(S){function x(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}x.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(v);s;)g[s[1]]=s[2],s=this.__directive_pattern.exec(v);return g},x.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},S.exports.Directives=x},function(S,x,v){var g=v(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(n,u){g.call(this,n,u),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var l=new g(n);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new g,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(n){var u=this._create();return u._disabled[n]=!0,u._update(),u},r.prototype.read_options=function(n){var u=this._create();for(var l in s)u._disabled[l]=n.templating.indexOf(l)===-1;return u._update(),u},r.prototype.exclude=function(n){var u=this._create();return u._excluded[n]=!0,u._update(),u},r.prototype.read=function(){var n="";this._match_pattern?n=this._input.read(this._starting_pattern):n=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),n+=u,u=this._read_template();return this._until_after&&(n+=this._input.readUntilAfter(this._until_pattern)),n},r.prototype.__set_templated_pattern=function(){var n=[];this._disabled.php||n.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||n.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||n.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(n.push(this.__patterns.django._starting_pattern.source),n.push(this.__patterns.django_value._starting_pattern.source),n.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||n.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&n.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+n.join("|")+")")},r.prototype._read_template=function(){var n="",u=this._input.peek();if(u==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(n=n||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(n=n||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(n=n||this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars_unescaped.read(),n=n||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(n=n||this.__patterns.django_value.read()),this._excluded.django||(n=n||this.__patterns.django_comment.read(),n=n||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(n=n||this.__patterns.smarty_comment.read(),n=n||this.__patterns.smarty_literal.read(),n=n||this.__patterns.smarty.read()));return n},S.exports.TemplatablePattern=r}],A={};function M(S){var x=A[S];if(x!==void 0)return x.exports;var v=A[S]={exports:{}};return T[S](v,v.exports,M),v.exports}var C=M(0);O=C})();var L=O;!(le=[],N=function(){return{js_beautify:L}}.apply(tt,le),N!==void 0&&(ut.exports=N))})()},"8hTe":function(ut,tt,te){ut.exports={button:"button___1wy9m"}},"9Bee":function(ut,tt,te){"use strict";var le=te("DYRE"),N=te("zeV3"),O=te("+L6B"),L=te("2/Rp"),T=te("k1fw"),A=te("tJVT"),M=te("cDcd"),C=te.n(M),S=te("vg9a"),x=te("DlQD"),v=te.n(x),g=te("rUJ1");function s(ce,pe){var _e=ce.match(/^(\s+)(?:```)/);if(_e===null)return pe;var oe=_e[1];return pe.split(`
`).map(function(ne){var Ee=ne.match(/^\s+/);if(Ee===null)return ne;var ke=Object(A.a)(Ee,1),we=ke[0];return we.length>=oe.length?ne.slice(oe.length):ne}).join(`
`)}var r=[],n=["<ul>"],u=new v.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function e(){r.length=0,n=["<ul>"]}var t={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function i(ce,pe,_e,oe){if(pe>=ce.length||ce[pe].level<=_e)return pe;var ne=ce[pe];oe.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),pe++;var Ee=[];return pe=i(ce,pe,ne.level,Ee),Ee.length>0&&(oe.push("<ul>"),Ee.forEach(function(ke){oe.push(ke)}),oe.push("</ul>")),oe.push("</li>"),pe=i(ce,pe,_e,oe),pe}function b(){return i(r,0,0,n),n.push("</ul>"),n.join("")}var _={heading:function(pe){var _e=l.exec(pe);if(_e)return{type:"heading",raw:_e[0],depth:_e[1].length,text:_e[2]}},fences:function(pe){var _e=this.rules.block.fences.exec(pe);if(_e){var oe=_e[0],ne=s(oe,_e[3]||""),Ee=_e[2]?_e[2].trim():_e[2];if(["latex","katex","math"].indexOf(Ee)>=0){var ke=m(),we=ne;ne=ke,f[ke]={type:"block",expression:we}}return{type:"code",raw:oe,lang:Ee,text:ne}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,m=function(){return"__special_katext_id_".concat(y++,"__")},f={};function d(){return f}function a(){y=0,f={}}function o(ce){return ce=ce.replace(p,function(pe,_e){var oe=m();return f[oe]={type:"inline",expression:_e},oe}),ce}var c=u.listitem;u.listitem=function(ce){return c(o(ce))};var h=u.paragraph;u.paragraph=function(ce){return h(o(ce))};var E=u.tablecell;u.tablecell=function(ce,pe){return E(o(ce),pe)},u.code=function(ce,pe,_e){var oe=(pe||"").match(/\S*/)[0];return oe?["latex","katex","math"].indexOf(oe)>=0?"<p class='editormd-tex'>".concat(ce,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(pe,'">').concat(_e?ce:Object(g.escape)(ce,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(_e?ce:Object(g.escape)(ce,!0))+"</code></pre>"},u.heading=function(ce,pe,_e){var oe=this.options.headerPrefix+_e.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:oe,level:pe,text:ce}),"<h"+pe+' id="'+oe+'">'+ce+"</h"+pe+">"},v.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),v.a.use({tokenizer:_,renderer:u});var R=v.a,w=te("SJMd"),P=te("ulZh"),D=te.n(P),U=te("m3rI"),I=te("Oy/b"),k=te("p5ED"),H=te("8hTe"),J=te.n(H),$=/<pre[^>]*>/g;function fe(ce){var pe=document.createElement("div");return pe.innerHTML=ce,pe.childNodes.length===0?"":pe.childNodes[0].nodeValue}var he=tt.a=function(ce){var pe=ce.value,_e=pe===void 0?"":pe,oe=ce.edit,ne=oe===void 0?!1:oe,Ee=ce.className,ke=ce.showTextOnly,we=ce.showLines,Re=ce.replaces,Ue=ce.zoomImg,be=ce.hasMask,Se=ce.style,Ie=Se===void 0?{}:Se,Me=ce.stylesPrev,De=Me===void 0?{}:Me,Te=String(_e),ye=Object(M.useRef)(),Ge=Object(M.useRef)(),Be=Object(M.useState)(""),He=Object(A.a)(Be,2),Ne=He[0],Ve=He[1],ze=Object(M.useState)("office"),Fe=Object(A.a)(ze,2),Ce=Fe[0],We=Fe[1],je=Object(M.useMemo)(function(){try{var Z=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,B=/\"\/api\/attachments\/|\"\/attachments\/download\//g,W=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Te=Te.replace(Z,"("+U.a.API_SERVER+"/api/attachments/").replace(B,'"'+U.a.API_SERVER+"/api/attachments/").replace(W,'"'+U.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(ve){}var z=R(Te),Q=d();if(Te.match(/\[TOC\]/)&&(z=z.replace("<p>[TOC]</p>",b()),e()),z=z.replace(/(__special_katext_id_\d+__)/g,function(ve,Ae){var Ye=Q[Ae],qe=Ye.type,Qe=Ye.expression;return Object(I.renderToString)(fe(Qe)||"",{displayMode:qe==="block",throwOnError:!1,output:"html"})}),z=z.replace(/▁/g,"\u2581\u2581\u2581"),a(),ke){var de=document.createElement("div");return de.innerHTML=z,de.innerText}return setTimeout(function(){return re()},500),z},[Te]),me=Object(M.useRef)();t.WebkitLineClamp=we,we&&(Ie=Object(T.a)(Object(T.a)({},Ie),t));function Le(Z){var B=Z.target;if(B.tagName.toUpperCase()==="IMG"){if(Ue){var W=B.getAttribute("src");Ve(W),We("image")}}else if(B.tagName.toUpperCase()==="A"){var z=B.getAttribute("href");if(z.indexOf("office")>-1)Z.preventDefault(),Ve(z),We("office");else if(z.indexOf("application/pdf")>-1)Z.preventDefault(),Ve(z),We("pdf");else if(z.indexOf("text/html")>-1)Z.preventDefault(),Ve(z),We("html");else if(z.startsWith("#")){Z.preventDefault();var Q=document.getElementById(z.replace("#",""));Q&&Q.scrollIntoView(!0)}}}var re=function(){var B,W=(B=me.current)===null||B===void 0?void 0:B.querySelectorAll("video");W==null||W.forEach(function(z){if(z.oncontextmenu=function(){return!1},z.src.indexOf(".m3u8")>-1&&!z.canPlayType("application/vnd.apple.mpegurl")){if(D.a.isSupported()){var Q=new D.a;Q.loadSource(z.src),Q.attachMedia(z)}}})};Object(M.useEffect)(function(){if(me.current&&je&&(je.match($)&&window.PR.prettyPrint()),me.current)return me.current.addEventListener("click",Le),function(){me.current.removeEventListener("click",Le),a(),e()}},[je,me.current,Le]);var q=function(B){if(!ne)return;B.target.nodeName==="IMG"?(ye.current.style.display="flex",ye.current.style.width=B.target.clientWidth+"px",ye.current.style.height=B.target.clientHeight+"px",ye.current.style.top=B.target.offsetTop+"px",ye.current.style.left=B.target.offsetLeft+"px",Ge.current.src=B.target.getAttribute("src")):ye.current.style.display="none"};return C.a.createElement("div",{style:{position:"relative"}},C.a.createElement("div",{ref:me,style:Object(T.a)({},Ie),className:"".concat(Ee||""," markdown-body ").concat(J.a.mdBody),onMouseOver:q,dangerouslySetInnerHTML:{__html:je}}),C.a.createElement("div",{ref:ye,className:J.a.button},C.a.createElement(N.a,null,C.a.createElement(L.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),C.a.createElement(L.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),C.a.createElement("img",{ref:Ge,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),C.a.createElement(k.a,{close:!0,data:Ne,type:Ne!=null&&Ne.length?Ce:"",style:Object(T.a)({},De),onClose:function(){return Ve("")}}))}},BU3w:function(ut,tt,te){"use strict";te.d(tt,"a",function(){return A});var le=te("MNnm"),N="rc-util-key";function O(M){if(M.attachTo)return M.attachTo;var C=document.querySelector("head");return C||document.body}function L(M){var C,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var x=document.createElement("style");if((C=S.csp)===null||C===void 0?void 0:C.nonce){var v;x.nonce=(v=S.csp)===null||v===void 0?void 0:v.nonce}x.innerHTML=M;var g=O(S),s=g.firstChild;return S.prepend&&g.prepend?g.prepend(x):S.prepend&&s?g.insertBefore(x,s):g.appendChild(x),x}var T=new Map;function A(M,C){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=O(S);if(!T.has(x)){var v=L("",S),g=v.parentNode;T.set(x,g),g.removeChild(v)}var s=Array.from(T.get(x).children).find(function(e){return e.tagName==="STYLE"&&e[N]===C});if(s){var r,n;if(((r=S.csp)===null||r===void 0?void 0:r.nonce)&&s.nonce!==((n=S.csp)===null||n===void 0?void 0:n.nonce)){var u;s.nonce=(u=S.csp)===null||u===void 0?void 0:u.nonce}return s.innerHTML!==M&&(s.innerHTML=M),s}var l=L(M,S);return l[N]=C,l}},BdwD:function(ut,tt,te){"use strict";var le=te("+L6B"),N=te("2/Rp"),O=te("0Owb"),L=te("k1fw"),T=te("cDcd"),A=te.n(T),M=te("FOrL"),C=te.n(M),S=function(v){var g=v.buttonProps,s=g===void 0?{}:g,r=v.styles,n=r===void 0?{}:r,u=v.customText,l=v.ButtonText,e=v.ButtonClick,t=v.Buttonclass,i=v.ButtonTwo;return A.a.createElement("section",{className:"tc animated fadeIn",style:Object(L.a)(Object(L.a)({},{color:"#999",margin:"200px auto"}),n)},A.a.createElement("img",{src:C.a}),A.a.createElement("p",{className:"mt20 font14"},u||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&A.a.createElement(N.a,Object(O.a)({className:t,onClick:e},s),l),i&&i)};tt.a=S},DlQD:function(ut,tt,te){(function(le,N){ut.exports=N()})(this,function(){"use strict";function le(re,q){for(var Z=0;Z<q.length;Z++){var B=q[Z];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(re,B.key,B)}}function N(re,q,Z){return q&&le(re.prototype,q),Z&&le(re,Z),re}function O(re,q){if(!re)return;if(typeof re=="string")return L(re,q);var Z=Object.prototype.toString.call(re).slice(8,-1);if(Z==="Object"&&re.constructor&&(Z=re.constructor.name),Z==="Map"||Z==="Set")return Array.from(re);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return L(re,q)}function L(re,q){(q==null||q>re.length)&&(q=re.length);for(var Z=0,B=new Array(q);Z<q;Z++)B[Z]=re[Z];return B}function T(re,q){var Z;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(Z=O(re))||q&&re&&typeof re.length=="number"){Z&&(re=Z);var B=0;return function(){return B>=re.length?{done:!0}:{done:!1,value:re[B++]}}}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 Z=re[Symbol.iterator](),Z.next.bind(Z)}function A(re,q){return q={exports:{}},re(q,q.exports),q.exports}var M=A(function(re){function q(){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 Z(B){re.exports.defaults=B}re.exports={defaults:q(),getDefaults:q,changeDefaults:Z}}),C=M.defaults,S=M.getDefaults,x=M.changeDefaults,v=/[&<>"']/,g=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},u=function(q){return n[q]};function l(re,q){if(q){if(v.test(re))return re.replace(g,u)}else if(s.test(re))return re.replace(r,u);return re}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(re){return re.replace(e,function(q,Z){return Z=Z.toLowerCase(),Z==="colon"?":":Z.charAt(0)==="#"?Z.charAt(1)==="x"?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var i=/(^|[^\[])\^/g;function b(re,q){re=re.source||re,q=q||"";var Z={replace:function(W,z){return z=z.source||z,z=z.replace(i,"$1"),re=re.replace(W,z),Z},getRegex:function(){return new RegExp(re,q)}};return Z}var _=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(re,q,Z){if(re){var B;try{B=decodeURIComponent(t(Z)).replace(_,"").toLowerCase()}catch(W){return null}if(B.indexOf("javascript:")===0||B.indexOf("vbscript:")===0||B.indexOf("data:")===0)return null}q&&!p.test(Z)&&(Z=o(q,Z));try{Z=encodeURI(Z).replace(/%25/g,"%")}catch(W){return null}return Z}var m={},f=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(re,q){m[" "+re]||(f.test(re)?m[" "+re]=re+"/":m[" "+re]=R(re,"/",!0)),re=m[" "+re];var Z=re.indexOf(":")===-1;return q.substring(0,2)==="//"?Z?q:re.replace(d,"$1")+q:q.charAt(0)==="/"?Z?q:re.replace(a,"$1")+q:re+q}var c={exec:function(){}};function h(re){for(var q=1,Z,B;q<arguments.length;q++){Z=arguments[q];for(B in Z)Object.prototype.hasOwnProperty.call(Z,B)&&(re[B]=Z[B])}return re}function E(re,q){var Z=re.replace(/\|/g,function(z,Q,de){for(var ve=!1,Ae=Q;--Ae>=0&&de[Ae]==="\\";)ve=!ve;return ve?"|":" |"}),B=Z.split(/ \|/),W=0;if(B.length>q)B.splice(q);else for(;B.length<q;)B.push("");for(;W<B.length;W++)B[W]=B[W].trim().replace(/\\\|/g,"|");return B}function R(re,q,Z){var B=re.length;if(B===0)return"";for(var W=0;W<B;){var z=re.charAt(B-W-1);if(z===q&&!Z)W++;else if(z!==q&&Z)W++;else break}return re.substr(0,B-W)}function w(re,q){if(re.indexOf(q[1])===-1)return-1;for(var Z=re.length,B=0,W=0;W<Z;W++)if(re[W]==="\\")W++;else if(re[W]===q[0])B++;else if(re[W]===q[1]&&(B--,B<0))return W;return-1}function P(re){re&&re.sanitize&&!re.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var D={escape:l,unescape:t,edit:b,cleanUrl:y,resolveUrl:o,noopTest:c,merge:h,splitCells:E,rtrim:R,findClosingBracket:w,checkSanitizeDeprecation:P},U=M.defaults,I=D.rtrim,k=D.splitCells,H=D.escape,J=D.findClosingBracket;function $(re,q,Z){var B=q.href,W=q.title?H(q.title):null,z=re[1].replace(/\\([\[\]])/g,"$1");return re[0].charAt(0)!=="!"?{type:"link",raw:Z,href:B,title:W,text:z}:{type:"image",raw:Z,href:B,title:W,text:H(z)}}function fe(re,q){var Z=re.match(/^(\s+)(?:```)/);if(Z===null)return q;var B=Z[1];return q.split(`
`).map(function(W){var z=W.match(/^\s+/);if(z===null)return W;var Q=z[0];return Q.length>=B.length?W.slice(B.length):W}).join(`
`)}var he=function(){function re(Z){this.options=Z||U}var q=re.prototype;return q.space=function(B){var W=this.rules.block.newline.exec(B);if(W)return W[0].length>1?{type:"space",raw:W[0]}:{raw:`
`}},q.code=function(B,W){var z=this.rules.block.code.exec(B);if(z){var Q=W[W.length-1];if(Q&&Q.type==="paragraph")return{raw:z[0],text:z[0].trimRight()};var de=z[0].replace(/^ {4}/gm,"");return{type:"code",raw:z[0],codeBlockStyle:"indented",text:this.options.pedantic?de:I(de,`
`)}}},q.fences=function(B){var W=this.rules.block.fences.exec(B);if(W){var z=W[0],Q=fe(z,W[3]||"");return{type:"code",raw:z,lang:W[2]?W[2].trim():W[2],text:Q}}},q.heading=function(B){var W=this.rules.block.heading.exec(B);if(W)return{type:"heading",raw:W[0],depth:W[1].length,text:W[2]}},q.nptable=function(B){var W=this.rules.block.nptable.exec(B);if(W){var z={type:"table",header:k(W[1].replace(/^ *| *\| *$/g,"")),align:W[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:W[3]?W[3].replace(/\n$/,"").split(`
`):[],raw:W[0]};if(z.header.length===z.align.length){var Q=z.align.length,de;for(de=0;de<Q;de++)/^ *-+: *$/.test(z.align[de])?z.align[de]="right":/^ *:-+: *$/.test(z.align[de])?z.align[de]="center":/^ *:-+ *$/.test(z.align[de])?z.align[de]="left":z.align[de]=null;for(Q=z.cells.length,de=0;de<Q;de++)z.cells[de]=k(z.cells[de],z.header.length);return z}}},q.hr=function(B){var W=this.rules.block.hr.exec(B);if(W)return{type:"hr",raw:W[0]}},q.blockquote=function(B){var W=this.rules.block.blockquote.exec(B);if(W){var z=W[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:W[0],text:z}}},q.list=function(B){var W=this.rules.block.list.exec(B);if(W){for(var z=W[0],Q=W[2],de=Q.length>1,ve=Q[Q.length-1]===")",Ae={type:"list",raw:z,ordered:de,start:de?+Q.slice(0,-1):"",loose:!1,items:[]},Ye=W[0].match(this.rules.block.item),qe=!1,Qe,St,ht,$e,Dt,Ot,kt,Nt=Ye.length,dt=0;dt<Nt;dt++)Qe=Ye[dt],z=Qe,St=Qe.length,Qe=Qe.replace(/^ *([*+-]|\d+[.)]) */,""),~Qe.indexOf(`
`)&&(St-=Qe.length,Qe=this.options.pedantic?Qe.replace(/^ {1,4}/gm,""):Qe.replace(new RegExp("^ {1,"+St+"}","gm"),"")),dt!==Nt-1&&(ht=this.rules.block.bullet.exec(Ye[dt+1])[0],(de?ht.length===1||!ve&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==Q)&&($e=Ye.slice(dt+1).join(`
`),Ae.raw=Ae.raw.substring(0,Ae.raw.length-$e.length),dt=Nt-1)),Dt=qe||/\n\n(?!\s*$)/.test(Qe),dt!==Nt-1&&(qe=Qe.charAt(Qe.length-1)===`
`,Dt||(Dt=qe)),Dt&&(Ae.loose=!0),Ot=/^\[[ xX]\] /.test(Qe),kt=void 0,Ot&&(kt=Qe[1]!==" ",Qe=Qe.replace(/^\[[ xX]\] +/,"")),Ae.items.push({type:"list_item",raw:z,task:Ot,checked:kt,loose:Dt,text:Qe});return Ae}},q.html=function(B){var W=this.rules.block.html.exec(B);if(W)return{type:this.options.sanitize?"paragraph":"html",raw:W[0],pre:!this.options.sanitizer&&(W[1]==="pre"||W[1]==="script"||W[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):H(W[0]):W[0]}},q.def=function(B){var W=this.rules.block.def.exec(B);if(W){W[3]&&(W[3]=W[3].substring(1,W[3].length-1));var z=W[1].toLowerCase().replace(/\s+/g," ");return{tag:z,raw:W[0],href:W[2],title:W[3]}}},q.table=function(B){var W=this.rules.block.table.exec(B);if(W){var z={type:"table",header:k(W[1].replace(/^ *| *\| *$/g,"")),align:W[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:W[3]?W[3].replace(/\n$/,"").split(`
`):[]};if(z.header.length===z.align.length){z.raw=W[0];var Q=z.align.length,de;for(de=0;de<Q;de++)/^ *-+: *$/.test(z.align[de])?z.align[de]="right":/^ *:-+: *$/.test(z.align[de])?z.align[de]="center":/^ *:-+ *$/.test(z.align[de])?z.align[de]="left":z.align[de]=null;for(Q=z.cells.length,de=0;de<Q;de++)z.cells[de]=k(z.cells[de].replace(/^ *\| *| *\| *$/g,""),z.header.length);return z}}},q.lheading=function(B){var W=this.rules.block.lheading.exec(B);if(W)return{type:"heading",raw:W[0],depth:W[2].charAt(0)==="="?1:2,text:W[1]}},q.paragraph=function(B){var W=this.rules.block.paragraph.exec(B);if(W)return{type:"paragraph",raw:W[0],text:W[1].charAt(W[1].length-1)===`
`?W[1].slice(0,-1):W[1]}},q.text=function(B,W){var z=this.rules.block.text.exec(B);if(z){var Q=W[W.length-1];return Q&&Q.type==="text"?{raw:z[0],text:z[0]}:{type:"text",raw:z[0],text:z[0]}}},q.escape=function(B){var W=this.rules.inline.escape.exec(B);if(W)return{type:"escape",raw:W[0],text:H(W[1])}},q.tag=function(B,W,z){var Q=this.rules.inline.tag.exec(B);if(Q)return!W&&/^<a /i.test(Q[0])?W=!0:W&&/^<\/a>/i.test(Q[0])&&(W=!1),!z&&/^<(pre|code|kbd|script)(\s|>)/i.test(Q[0])?z=!0:z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Q[0])&&(z=!1),{type:this.options.sanitize?"text":"html",raw:Q[0],inLink:W,inRawBlock:z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):H(Q[0]):Q[0]}},q.link=function(B){var W=this.rules.inline.link.exec(B);if(W){var z=J(W[2],"()");if(z>-1){var Q=W[0].indexOf("!")===0?5:4,de=Q+W[1].length+z;W[2]=W[2].substring(0,z),W[0]=W[0].substring(0,de).trim(),W[3]=""}var ve=W[2],Ae="";if(this.options.pedantic){var Ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ve);Ye?(ve=Ye[1],Ae=Ye[3]):Ae=""}else Ae=W[3]?W[3].slice(1,-1):"";ve=ve.trim().replace(/^<([\s\S]*)>$/,"$1");var qe=$(W,{href:ve&&ve.replace(this.rules.inline._escapes,"$1"),title:Ae&&Ae.replace(this.rules.inline._escapes,"$1")},W[0]);return qe}},q.reflink=function(B,W){var z;if((z=this.rules.inline.reflink.exec(B))||(z=this.rules.inline.nolink.exec(B))){var Q=(z[2]||z[1]).replace(/\s+/g," ");if(Q=W[Q.toLowerCase()],!Q||!Q.href){var de=z[0].charAt(0);return{type:"text",raw:de,text:de}}var ve=$(z,Q,z[0]);return ve}},q.strong=function(B,W,z){z===void 0&&(z="");var Q=this.rules.inline.strong.start.exec(B);if(Q&&(!Q[1]||Q[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){W=W.slice(-1*B.length);var de=Q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var ve;(Q=de.exec(W))!=null;)if(ve=this.rules.inline.strong.middle.exec(W.slice(0,Q.index+3)),ve)return{type:"strong",raw:B.slice(0,ve[0].length),text:B.slice(2,ve[0].length-2)}}},q.em=function(B,W,z){z===void 0&&(z="");var Q=this.rules.inline.em.start.exec(B);if(Q&&(!Q[1]||Q[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){W=W.slice(-1*B.length);var de=Q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var ve;(Q=de.exec(W))!=null;)if(ve=this.rules.inline.em.middle.exec(W.slice(0,Q.index+2)),ve)return{type:"em",raw:B.slice(0,ve[0].length),text:B.slice(1,ve[0].length-1)}}},q.codespan=function(B){var W=this.rules.inline.code.exec(B);if(W){var z=W[2].replace(/\n/g," "),Q=/[^ ]/.test(z),de=z.startsWith(" ")&&z.endsWith(" ");return Q&&de&&(z=z.substring(1,z.length-1)),z=H(z,!0),{type:"codespan",raw:W[0],text:z}}},q.br=function(B){var W=this.rules.inline.br.exec(B);if(W)return{type:"br",raw:W[0]}},q.del=function(B){var W=this.rules.inline.del.exec(B);if(W)return{type:"del",raw:W[0],text:W[1]}},q.autolink=function(B,W){var z=this.rules.inline.autolink.exec(B);if(z){var Q,de;return z[2]==="@"?(Q=H(this.options.mangle?W(z[1]):z[1]),de="mailto:"+Q):(Q=H(z[1]),de=Q),{type:"link",raw:z[0],text:Q,href:de,tokens:[{type:"text",raw:Q,text:Q}]}}},q.url=function(B,W){var z;if(z=this.rules.inline.url.exec(B)){var Q,de;if(z[2]==="@")Q=H(this.options.mangle?W(z[0]):z[0]),de="mailto:"+Q;else{var ve;do ve=z[0],z[0]=this.rules.inline._backpedal.exec(z[0])[0];while(ve!==z[0]);Q=H(z[0]),z[1]==="www."?de="http://"+Q:de=Q}return{type:"link",raw:z[0],text:Q,href:de,tokens:[{type:"text",raw:Q,text:Q}]}}},q.inlineText=function(B,W,z){var Q=this.rules.inline.text.exec(B);if(Q){var de;return W?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):H(Q[0]):Q[0]:de=H(this.options.smartypants?z(Q[0]):Q[0]),{type:"text",raw:Q[0],text:de}}},re}(),ce=D.noopTest,pe=D.edit,_e=D.merge,oe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ce,table:ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,oe.def=pe(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,oe.item=pe(oe.item,"gm").replace(/bull/g,oe.bullet).getRegex(),oe.list=pe(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._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",oe._comment=/<!--(?!-?>)[\s\S]*?-->/,oe.html=pe(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=pe(oe._paragraph).replace("hr",oe.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",oe._tag).getRegex(),oe.blockquote=pe(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=_e({},oe),oe.gfm=_e({},oe.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*|$)"}),oe.gfm.nptable=pe(oe.gfm.nptable).replace("hr",oe.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",oe._tag).getRegex(),oe.gfm.table=pe(oe.gfm.table).replace("hr",oe.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",oe._tag).getRegex(),oe.pedantic=_e({},oe.normal,{html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ce,paragraph:pe(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ce,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ne._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ne.punctuation=pe(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ne._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ne.em.start=pe(ne.em.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.middle=pe(ne.em.middle).replace(/punctuation/g,ne._punctuation).replace(/overlapSkip/g,ne._overlapSkip).getRegex(),ne.em.endAst=pe(ne.em.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.endUnd=pe(ne.em.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.start=pe(ne.strong.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.middle=pe(ne.strong.middle).replace(/punctuation/g,ne._punctuation).replace(/blockSkip/g,ne._blockSkip).getRegex(),ne.strong.endAst=pe(ne.strong.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.endUnd=pe(ne.strong.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=pe(ne._blockSkip,"g").getRegex(),ne.overlapSkip=pe(ne._overlapSkip,"g").getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=pe(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=pe(ne.tag).replace("comment",oe._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=pe(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=pe(ne.reflink).replace("label",ne._label).getRegex(),ne.reflinkSearch=pe(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=_e({},ne),ne.pedantic=_e({},ne.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=_e({},ne.normal,{escape:pe(ne.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ne.gfm.url=pe(ne.gfm.url,"i").replace("email",ne.gfm._extended_email).getRegex(),ne.breaks=_e({},ne.gfm,{br:pe(ne.br).replace("{2,}","*").getRegex(),text:pe(ne.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ee={block:oe,inline:ne},ke=M.defaults,we=Ee.block,Re=Ee.inline;function Ue(re){return re.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 be(re){var q="",Z,B,W=re.length;for(Z=0;Z<W;Z++)B=re.charCodeAt(Z),Math.random()>.5&&(B="x"+B.toString(16)),q+="&#"+B+";";return q}var Se=function(){function re(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||ke,this.options.tokenizer=this.options.tokenizer||new he,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var B={block:we.normal,inline:Re.normal};this.options.pedantic?(B.block=we.pedantic,B.inline=Re.pedantic):this.options.gfm&&(B.block=we.gfm,this.options.breaks?B.inline=Re.breaks:B.inline=Re.gfm),this.tokenizer.rules=B}re.lex=function(B,W){var z=new re(W);return z.lex(B)};var q=re.prototype;return q.lex=function(B){return B=B.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(B,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(B,W,z){W===void 0&&(W=[]),z===void 0&&(z=!0),B=B.replace(/^ +$/gm,"");for(var Q,de,ve,Ae;B;){if(Q=this.tokenizer.space(B)){B=B.substring(Q.raw.length),Q.type&&W.push(Q);continue}if(Q=this.tokenizer.code(B,W)){B=B.substring(Q.raw.length),Q.type?W.push(Q):(Ae=W[W.length-1],Ae.raw+=`
`+Q.raw,Ae.text+=`
`+Q.text);continue}if(Q=this.tokenizer.fences(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.heading(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.nptable(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.hr(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.blockquote(B)){B=B.substring(Q.raw.length),Q.tokens=this.blockTokens(Q.text,[],z),W.push(Q);continue}if(Q=this.tokenizer.list(B)){for(B=B.substring(Q.raw.length),ve=Q.items.length,de=0;de<ve;de++)Q.items[de].tokens=this.blockTokens(Q.items[de].text,[],!1);W.push(Q);continue}if(Q=this.tokenizer.html(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(z&&(Q=this.tokenizer.def(B))){B=B.substring(Q.raw.length),this.tokens.links[Q.tag]||(this.tokens.links[Q.tag]={href:Q.href,title:Q.title});continue}if(Q=this.tokenizer.table(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.lheading(B)){B=B.substring(Q.raw.length),W.push(Q);continue}if(z&&(Q=this.tokenizer.paragraph(B))){B=B.substring(Q.raw.length),W.push(Q);continue}if(Q=this.tokenizer.text(B,W)){B=B.substring(Q.raw.length),Q.type?W.push(Q):(Ae=W[W.length-1],Ae.raw+=`
`+Q.raw,Ae.text+=`
`+Q.text);continue}if(B){var Ye="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return W},q.inline=function(B){var W,z,Q,de,ve,Ae,Ye=B.length;for(W=0;W<Ye;W++){Ae=B[W];switch(Ae.type){case"paragraph":case"text":case"heading":{Ae.tokens=[],this.inlineTokens(Ae.text,Ae.tokens);break}case"table":{for(Ae.tokens={header:[],cells:[]},de=Ae.header.length,z=0;z<de;z++)Ae.tokens.header[z]=[],this.inlineTokens(Ae.header[z],Ae.tokens.header[z]);for(de=Ae.cells.length,z=0;z<de;z++)for(ve=Ae.cells[z],Ae.tokens.cells[z]=[],Q=0;Q<ve.length;Q++)Ae.tokens.cells[z][Q]=[],this.inlineTokens(ve[Q],Ae.tokens.cells[z][Q]);break}case"blockquote":{this.inline(Ae.tokens);break}case"list":{for(de=Ae.items.length,z=0;z<de;z++)this.inline(Ae.items[z].tokens);break}}}return B},q.inlineTokens=function(B,W,z,Q,de){W===void 0&&(W=[]),z===void 0&&(z=!1),Q===void 0&&(Q=!1),de===void 0&&(de="");var ve,Ae=B,Ye;if(this.tokens.links){var qe=Object.keys(this.tokens.links);if(qe.length>0)for(;(Ye=this.tokenizer.rules.inline.reflinkSearch.exec(Ae))!=null;)qe.includes(Ye[0].slice(Ye[0].lastIndexOf("[")+1,-1))&&(Ae=Ae.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ye=this.tokenizer.rules.inline.blockSkip.exec(Ae))!=null;)Ae=Ae.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;B;){if(ve=this.tokenizer.escape(B)){B=B.substring(ve.raw.length),W.push(ve);continue}if(ve=this.tokenizer.tag(B,z,Q)){B=B.substring(ve.raw.length),z=ve.inLink,Q=ve.inRawBlock,W.push(ve);continue}if(ve=this.tokenizer.link(B)){B=B.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,Q)),W.push(ve);continue}if(ve=this.tokenizer.reflink(B,this.tokens.links)){B=B.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,Q)),W.push(ve);continue}if(ve=this.tokenizer.strong(B,Ae,de)){B=B.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],z,Q),W.push(ve);continue}if(ve=this.tokenizer.em(B,Ae,de)){B=B.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],z,Q),W.push(ve);continue}if(ve=this.tokenizer.codespan(B)){B=B.substring(ve.raw.length),W.push(ve);continue}if(ve=this.tokenizer.br(B)){B=B.substring(ve.raw.length),W.push(ve);continue}if(ve=this.tokenizer.del(B)){B=B.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],z,Q),W.push(ve);continue}if(ve=this.tokenizer.autolink(B,be)){B=B.substring(ve.raw.length),W.push(ve);continue}if(!z&&(ve=this.tokenizer.url(B,be))){B=B.substring(ve.raw.length),W.push(ve);continue}if(ve=this.tokenizer.inlineText(B,Q,Ue)){B=B.substring(ve.raw.length),de=ve.raw.slice(-1),W.push(ve);continue}if(B){var Qe="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return W},N(re,null,[{key:"rules",get:function(){return{block:we,inline:Re}}}]),re}(),Ie=M.defaults,Me=D.cleanUrl,De=D.escape,Te=function(){function re(Z){this.options=Z||Ie}var q=re.prototype;return q.code=function(B,W,z){var Q=(W||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(B,Q);de!=null&&de!==B&&(z=!0,B=de)}return Q?'<pre><code class="'+this.options.langPrefix+De(Q,!0)+'">'+(z?B:De(B,!0))+`</code></pre>
`:"<pre><code>"+(z?B:De(B,!0))+`</code></pre>
`},q.blockquote=function(B){return`<blockquote>
`+B+`</blockquote>
`},q.html=function(B){return B},q.heading=function(B,W,z,Q){return this.options.headerIds?"<h"+W+' id="'+this.options.headerPrefix+Q.slug(z)+'">'+B+"</h"+W+`>
`:"<h"+W+">"+B+"</h"+W+`>
`},q.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},q.list=function(B,W,z){var Q=W?"ol":"ul",de=W&&z!==1?' start="'+z+'"':"";return"<"+Q+de+`>
`+B+"</"+Q+`>
`},q.listitem=function(B){return"<li>"+B+`</li>
`},q.checkbox=function(B){return"<input "+(B?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(B){return"<p>"+B+`</p>
`},q.table=function(B,W){return W&&(W="<tbody>"+W+"</tbody>"),`<table>
<thead>
`+B+`</thead>
`+W+`</table>
`},q.tablerow=function(B){return`<tr>
`+B+`</tr>
`},q.tablecell=function(B,W){var z=W.header?"th":"td",Q=W.align?"<"+z+' align="'+W.align+'">':"<"+z+">";return Q+B+"</"+z+`>
`},q.strong=function(B){return"<strong>"+B+"</strong>"},q.em=function(B){return"<em>"+B+"</em>"},q.codespan=function(B){return"<code>"+B+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(B){return"<del>"+B+"</del>"},q.link=function(B,W,z){if(B=Me(this.options.sanitize,this.options.baseUrl,B),B===null)return z;var Q='<a href="'+De(B)+'"';return W&&(Q+=' title="'+W+'"'),Q+=">"+z+"</a>",Q},q.image=function(B,W,z){if(B=Me(this.options.sanitize,this.options.baseUrl,B),B===null)return z;var Q='<img src="'+B+'" alt="'+z+'"';return W&&(Q+=' title="'+W+'"'),Q+=this.options.xhtml?"/>":">",Q},q.text=function(B){return B},re}(),ye=function(){function re(){}var q=re.prototype;return q.strong=function(B){return B},q.em=function(B){return B},q.codespan=function(B){return B},q.del=function(B){return B},q.html=function(B){return B},q.text=function(B){return B},q.link=function(B,W,z){return""+z},q.image=function(B,W,z){return""+z},q.br=function(){return""},re}(),Ge=function(){function re(){this.seen={}}var q=re.prototype;return q.slug=function(B){var W=B.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(W)){var z=W;do this.seen[z]++,W=z+"-"+this.seen[z];while(this.seen.hasOwnProperty(W))}return this.seen[W]=0,W},re}(),Be=M.defaults,He=D.unescape,Ne=function(){function re(Z){this.options=Z||Be,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ye,this.slugger=new Ge}re.parse=function(B,W){var z=new re(W);return z.parse(B)};var q=re.prototype;return q.parse=function(B,W){W===void 0&&(W=!0);var z="",Q,de,ve,Ae,Ye,qe,Qe,St,ht,$e,Dt,Ot,kt,Nt,dt,Wt,$t,et,it=B.length;for(Q=0;Q<it;Q++){$e=B[Q];switch($e.type){case"space":continue;case"hr":{z+=this.renderer.hr();continue}case"heading":{z+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,He(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{z+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(St="",Qe="",Ae=$e.header.length,de=0;de<Ae;de++)Qe+=this.renderer.tablecell(this.parseInline($e.tokens.header[de]),{header:!0,align:$e.align[de]});for(St+=this.renderer.tablerow(Qe),ht="",Ae=$e.cells.length,de=0;de<Ae;de++){for(qe=$e.tokens.cells[de],Qe="",Ye=qe.length,ve=0;ve<Ye;ve++)Qe+=this.renderer.tablecell(this.parseInline(qe[ve]),{header:!1,align:$e.align[ve]});ht+=this.renderer.tablerow(Qe)}z+=this.renderer.table(St,ht);continue}case"blockquote":{ht=this.parse($e.tokens),z+=this.renderer.blockquote(ht);continue}case"list":{for(Dt=$e.ordered,Ot=$e.start,kt=$e.loose,Ae=$e.items.length,ht="",de=0;de<Ae;de++)dt=$e.items[de],Wt=dt.checked,$t=dt.task,Nt="",dt.task&&(et=this.renderer.checkbox(Wt),kt?dt.tokens.length>0&&dt.tokens[0].type==="text"?(dt.tokens[0].text=et+" "+dt.tokens[0].text,dt.tokens[0].tokens&&dt.tokens[0].tokens.length>0&&dt.tokens[0].tokens[0].type==="text"&&(dt.tokens[0].tokens[0].text=et+" "+dt.tokens[0].tokens[0].text)):dt.tokens.unshift({type:"text",text:et}):Nt+=et),Nt+=this.parse(dt.tokens,kt),ht+=this.renderer.listitem(Nt,$t,Wt);z+=this.renderer.list(ht,Dt,Ot);continue}case"html":{z+=this.renderer.html($e.text);continue}case"paragraph":{z+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(ht=$e.tokens?this.parseInline($e.tokens):$e.text;Q+1<it&&B[Q+1].type==="text";)$e=B[++Q],ht+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);z+=W?this.renderer.paragraph(ht):ht;continue}default:{var xt='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return z},q.parseInline=function(B,W){W=W||this.renderer;var z="",Q,de,ve=B.length;for(Q=0;Q<ve;Q++){de=B[Q];switch(de.type){case"escape":{z+=W.text(de.text);break}case"html":{z+=W.html(de.text);break}case"link":{z+=W.link(de.href,de.title,this.parseInline(de.tokens,W));break}case"image":{z+=W.image(de.href,de.title,de.text);break}case"strong":{z+=W.strong(this.parseInline(de.tokens,W));break}case"em":{z+=W.em(this.parseInline(de.tokens,W));break}case"codespan":{z+=W.codespan(de.text);break}case"br":{z+=W.br();break}case"del":{z+=W.del(this.parseInline(de.tokens,W));break}case"text":{z+=W.text(de.text);break}default:{var Ae='Token with "'+de.type+'" type was not found.';if(this.options.silent){console.error(Ae);return}else throw new Error(Ae)}}}return z},re}(),Ve=D.merge,ze=D.checkSanitizeDeprecation,Fe=D.escape,Ce=M.getDefaults,We=M.changeDefaults,je=M.defaults;function me(re,q,Z){if(typeof re=="undefined"||re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(re)+", string expected");if(typeof q=="function"&&(Z=q,q=null),q=Ve({},me.defaults,q||{}),ze(q),Z){var B=q.highlight,W;try{W=Se.lex(re,q)}catch(ve){return Z(ve)}var z=function(Ae){var Ye;if(!Ae)try{Ye=Ne.parse(W,q)}catch(qe){Ae=qe}return q.highlight=B,Ae?Z(Ae):Z(null,Ye)};if(!B||B.length<3)return z();if(delete q.highlight,!W.length)return z();var Q=0;me.walkTokens(W,function(ve){ve.type==="code"&&(Q++,setTimeout(function(){B(ve.text,ve.lang,function(Ae,Ye){if(Ae)return z(Ae);Ye!=null&&Ye!==ve.text&&(ve.text=Ye,ve.escaped=!0),Q--,Q===0&&z()})},0))}),Q===0&&z();return}try{var de=Se.lex(re,q);return q.walkTokens&&me.walkTokens(de,q.walkTokens),Ne.parse(de,q)}catch(ve){if(ve.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+Fe(ve.message+"",!0)+"</pre>";throw ve}}me.options=me.setOptions=function(re){return Ve(me.defaults,re),We(me.defaults),me},me.getDefaults=Ce,me.defaults=je,me.use=function(re){var q=Ve({},re);if(re.renderer&&function(){var B=me.defaults.renderer||new Te,W=function(de){var ve=B[de];B[de]=function(){for(var Ae=arguments.length,Ye=new Array(Ae),qe=0;qe<Ae;qe++)Ye[qe]=arguments[qe];var Qe=re.renderer[de].apply(B,Ye);return Qe===!1&&(Qe=ve.apply(B,Ye)),Qe}};for(var z in re.renderer)W(z);q.renderer=B}(),re.tokenizer&&function(){var B=me.defaults.tokenizer||new he,W=function(de){var ve=B[de];B[de]=function(){for(var Ae=arguments.length,Ye=new Array(Ae),qe=0;qe<Ae;qe++)Ye[qe]=arguments[qe];var Qe=re.tokenizer[de].apply(B,Ye);return Qe===!1&&(Qe=ve.apply(B,Ye)),Qe}};for(var z in re.tokenizer)W(z);q.tokenizer=B}(),re.walkTokens){var Z=me.defaults.walkTokens;q.walkTokens=function(B){re.walkTokens(B),Z&&Z(B)}}me.setOptions(q)},me.walkTokens=function(re,q){for(var Z=T(re),B;!(B=Z()).done;){var W=B.value;q(W);switch(W.type){case"table":{for(var z=T(W.tokens.header),Q;!(Q=z()).done;){var de=Q.value;me.walkTokens(de,q)}for(var ve=T(W.tokens.cells),Ae;!(Ae=ve()).done;)for(var Ye=Ae.value,qe=T(Ye),Qe;!(Qe=qe()).done;){var St=Qe.value;me.walkTokens(St,q)}break}case"list":{me.walkTokens(W.items,q);break}default:W.tokens&&me.walkTokens(W.tokens,q)}}},me.Parser=Ne,me.parser=Ne.parse,me.Renderer=Te,me.TextRenderer=ye,me.Lexer=Se,me.lexer=Se.lex,me.Tokenizer=he,me.Slugger=Ge,me.parse=me;var Le=me;return Le})},FOrL:function(ut,tt,te){ut.exports=te.p+"static/nodata.a6b3f948.png"},INg4:function(ut,tt,te){ut.exports={flex_box_center:"flex_box_center___2rJad",flex_space_between:"flex_space_between___3xFPg",flex_box_vertical_center:"flex_box_vertical_center___3_RIS",flex_box_center_end:"flex_box_center_end___h0Di5",flex_box_column:"flex_box_column___Q5LEA",right:"right___1Gnba",title:"title___2HvSR",titles:"titles___2UU6k",tips:"tips___1iWOB"}},LdHM:function(ut,tt,te){"use strict";te.d(tt,"b",function(){return i}),te.d(tt,"a",function(){return _});var le=te("1OyB"),N=te("vuIU"),O=te("Ji7U"),L=te("LK+K"),T=te("cDcd"),A=te("rePB"),M=te("Ff2n"),C=te("ODXe"),S=te("4IlW"),x=te("bX4T"),v=te("YrtM"),g=te("TSYQ"),s=te.n(g),r=te("+nKL"),n=te("8OUc"),u=function(k,H){var J=k.prefixCls,$=k.id,fe=k.flattenOptions,he=k.childrenAsData,ce=k.values,pe=k.searchValue,_e=k.multiple,oe=k.defaultActiveFirstOption,ne=k.height,Ee=k.itemHeight,ke=k.notFoundContent,we=k.open,Re=k.menuItemSelectedIcon,Ue=k.virtual,be=k.onSelect,Se=k.onToggleOpen,Ie=k.onActiveValue,Me=k.onScroll,De=k.onMouseEnter,Te="".concat(J,"-item"),ye=Object(v.a)(function(){return fe},[we,fe],function(Le,re){return re[0]&&Le[1]!==re[1]}),Ge=T.useRef(null),Be=function(re){re.preventDefault()},He=function(re){Ge.current&&Ge.current.scrollTo({index:re})},Ne=function(re){for(var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Z=ye.length,B=0;B<Z;B+=1){var W=(re+B*q+Z)%Z,z=ye[W],Q=z.group,de=z.data;if(!Q&&!de.disabled)return W}return-1},Ve=T.useState(function(){return Ne(0)}),ze=Object(C.a)(Ve,2),Fe=ze[0],Ce=ze[1],We=function(re){Ce(re);var q=ye[re];if(!q){Ie(null,-1);return}Ie(q.data.value,re)};T.useEffect(function(){We(oe!==!1?Ne(0):-1)},[ye.length,pe]),T.useEffect(function(){var Le=setTimeout(function(){if(!_e&&we&&ce.size===1){var re=Array.from(ce)[0],q=ye.findIndex(function(Z){var B=Z.data;return B.value===re});We(q),He(q)}});return function(){return clearTimeout(Le)}},[we]);var je=function(re){re!==void 0&&be(re,{selected:!ce.has(re)}),_e||Se(!1)};if(T.useImperativeHandle(H,function(){return{onKeyDown:function(re){var q=re.which;switch(q){case S.a.UP:case S.a.DOWN:{var Z=0;if(q===S.a.UP?Z=-1:q===S.a.DOWN&&(Z=1),Z!==0){var B=Ne(Fe+Z,Z);He(B),We(B)}break}case S.a.ENTER:{var W=ye[Fe];W&&!W.data.disabled?je(W.data.value):je(void 0),we&&re.preventDefault();break}case S.a.ESC:Se(!1)}},onKeyUp:function(){},scrollTo:function(re){He(re)}}}),ye.length===0)return T.createElement("div",{role:"listbox",id:"".concat($,"_list"),className:"".concat(Te,"-empty"),onMouseDown:Be},ke);function me(Le){var re=ye[Le];if(!re)return null;var q=re.data||{},Z=q.value,B=q.label,W=q.children,z=Object(x.a)(q,!0),Q=he?W:B;return re?T.createElement("div",Object.assign({"aria-label":typeof Q=="string"?Q:null},z,{key:Le,role:"option",id:"".concat($,"_list_").concat(Le),"aria-selected":ce.has(Z)}),Z):null}return T.createElement(T.Fragment,null,T.createElement("div",{role:"listbox",id:"".concat($,"_list"),style:{height:0,width:0,overflow:"hidden"}},me(Fe-1),me(Fe),me(Fe+1)),T.createElement(r.a,{itemKey:"key",ref:Ge,data:ye,height:ne,itemHeight:Ee,fullHeight:!1,onMouseDown:Be,onScroll:Me,virtual:Ue,onMouseEnter:De},function(Le,re){var q,Z=Le.group,B=Le.groupOption,W=Le.data,z=W.label,Q=W.key;if(Z)return T.createElement("div",{className:s()(Te,"".concat(Te,"-group"))},z!==void 0?z:Q);var de=W.disabled,ve=W.value,Ae=W.title,Ye=W.children,qe=W.style,Qe=W.className,St=Object(M.a)(W,["disabled","value","title","children","style","className"]),ht=ce.has(ve),$e="".concat(Te,"-option"),Dt=s()(Te,$e,Qe,(q={},Object(A.a)(q,"".concat($e,"-grouped"),B),Object(A.a)(q,"".concat($e,"-active"),Fe===re&&!de),Object(A.a)(q,"".concat($e,"-disabled"),de),Object(A.a)(q,"".concat($e,"-selected"),ht),q)),Ot=he?Ye:z,kt=!Re||typeof Re=="function"||ht;return T.createElement("div",Object.assign({},St,{"aria-selected":ht,className:Dt,title:Ae,onMouseMove:function(){if(Fe===re||de)return;We(re)},onClick:function(){de||je(ve)},style:qe}),T.createElement("div",{className:"".concat($e,"-content")},Ot||ve),T.isValidElement(Re)||ht,kt&&T.createElement(n.a,{className:"".concat(Te,"-option-state"),customizeIcon:Re,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},l=T.forwardRef(u);l.displayName="OptionList";var e=l,t=function(){return null};t.isSelectOption=!0;var i=t,b=function(){return null};b.isSelectOptGroup=!0;var _=b,p=te("VTBJ"),y=te("Zm9Q");function m(I){var k=I.key,H=I.props,J=H.children,$=H.value,fe=Object(M.a)(H,["children","value"]);return Object(p.a)({key:k,value:$!==void 0?$:k,children:J},fe)}function f(I){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(y.a)(I).map(function(H,J){if(!T.isValidElement(H)||!H.type)return null;var $=H.type.isSelectOptGroup,fe=H.key,he=H.props,ce=he.children,pe=Object(M.a)(he,["children"]);return k||!$?m(H):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(fe===null?J:fe,"__"),label:fe},pe),{},{options:f(ce)})}).filter(function(H){return H})}var d=te("2Qr1"),a=te("qNPg"),o=te("U8pU"),c=te("Kwbf"),h=te("WKfj");function E(I){var k=I.mode,H=I.options,J=I.children,$=I.backfill,fe=I.allowClear,he=I.placeholder,ce=I.getInputElement,pe=I.showSearch,_e=I.onSearch,oe=I.defaultOpen,ne=I.autoFocus,Ee=I.labelInValue,ke=I.value,we=I.inputValue,Re=I.optionLabelProp,Ue=k==="multiple"||k==="tags",be=pe!==void 0?pe:Ue||k==="combobox",Se=H||f(J);if(Object(c.a)(k!=="tags"||Se.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),k==="tags"||k==="combobox"){var Ie=Se.some(function(Te){return Te.options?Te.options.some(function(ye){return typeof("value"in ye?ye.value:ye.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(c.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(c.a)(k!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(c.a)(k==="combobox"||!$,"`backfill` only works with `combobox` mode."),Object(c.a)(k==="combobox"||!ce,"`getInputElement` only work with `combobox` mode."),Object(c.b)(k!=="combobox"||!ce||!fe||!he,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!be&&k!=="combobox"&&k!=="tags"&&Object(c.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(c.b)(!oe||ne,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ke!=null){var Me=Object(h.d)(ke);Object(c.a)(!Ee||Me.every(function(Te){return Object(o.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(c.a)(!Ue||Array.isArray(ke),"`value` should be array when `mode` is `multiple` or `tags`")}if(J){var De=null;Object(y.a)(J).some(function(Te){if(!T.isValidElement(Te)||!Te.type)return!1;var ye=Te.type;if(ye.isSelectOption)return!1;if(ye.isSelectOptGroup){var Ge=Object(y.a)(Te.props.children).every(function(Be){return!T.isValidElement(Be)||!Te.type||Be.type.isSelectOption?!0:(De=Be.type,!1)});return!Ge}return De=ye,!0}),De&&Object(c.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(De.displayName||De.name||De,"`.")),Object(c.a)(we===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var R=E,w=Object(a.a)({prefixCls:"rc-select",components:{optionList:e},convertChildrenToData:f,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:R,fillOptionsWithMissingValue:d.a}),P=function(I){Object(O.a)(H,I);var k=Object(L.a)(H);function H(){var J;return Object(le.a)(this,H),J=k.apply(this,arguments),J.selectRef=T.createRef(),J.focus=function(){J.selectRef.current.focus()},J.blur=function(){J.selectRef.current.blur()},J}return Object(N.a)(H,[{key:"render",value:function(){return T.createElement(w,Object.assign({ref:this.selectRef},this.props))}}]),H}(T.Component);P.Option=i,P.OptGroup=_;var D=P,U=tt.c=D},SJMd:function(ut,tt){/**
* @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 te,le,N,O=!1,L,T;window.PR_SHOULD_USE_CONTINUATION=!0;var A,M;(function(){var C=window,S=["break,continue,do,else,for,if,return,while"],x=[S,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[x,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],s=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],r=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],n="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",u=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",e=[S,"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"],t=[S,"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"],i=[S,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],b=[g,r,s,u,l,e,t,i],_=/^(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",y="kwd",m="com",f="typ",d="lit",a="pun",o="pln",c="tag",h="dec",E="src",R="atn",w="atv",P="nocode",D="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(be){for(var Se=0,Ie=!1,Me=!1,De=0,Te=be.length;De<Te;++De){var ye=be[De];if(ye.ignoreCase)Me=!0;else if(/[a-z]/i.test(ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,Me=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Be(Fe){var Ce=Fe.charCodeAt(0);if(Ce!==92)return Ce;var We=Fe.charAt(1);return Ce=Ge[We],Ce||("0"<=We&&We<="7"?parseInt(Fe.substring(1),8):We==="u"||We==="x"?parseInt(Fe.substring(2),16):Fe.charCodeAt(1))}function He(Fe){if(Fe<32)return(Fe<16?"\\x0":"\\x")+Fe.toString(16);var Ce=String.fromCharCode(Fe);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function Ne(Fe){var Ce=Fe.substring(1,Fe.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")),We=[],je=Ce[0]==="^",me=["["];je&&me.push("^");for(var Le=je?1:0,re=Ce.length;Le<re;++Le){var q=Ce[Le];if(/\\[bdsw]/i.test(q))me.push(q);else{var Z=Be(q),B;Le+2<re&&Ce[Le+1]==="-"?(B=Be(Ce[Le+2]),Le+=2):B=Z,We.push([Z,B]),B<65||Z>122||(B<65||Z>90||We.push([Math.max(65,Z)|32,Math.min(B,90)|32]),B<97||Z>122||We.push([Math.max(97,Z)&~32,Math.min(B,122)&~32]))}}We.sort(function(de,ve){return de[0]-ve[0]||ve[1]-de[1]});for(var W=[],z=[],Le=0;Le<We.length;++Le){var Q=We[Le];Q[0]<=z[1]+1?z[1]=Math.max(z[1],Q[1]):W.push(z=Q)}for(var Le=0;Le<W.length;++Le){var Q=W[Le];me.push(He(Q[0])),Q[1]>Q[0]&&(Q[1]+1>Q[0]&&me.push("-"),me.push(He(Q[1])))}return me.push("]"),me.join("")}function Ve(Fe){for(var Ce=Fe.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")),We=Ce.length,je=[],me=0,Le=0;me<We;++me){var re=Ce[me];if(re==="(")++Le;else if(re.charAt(0)==="\\"){var q=+re.substring(1);q&&(q<=Le?je[q]=-1:Ce[me]=He(q))}}for(var me=1;me<je.length;++me)je[me]===-1&&(je[me]=++Se);for(var me=0,Le=0;me<We;++me){var re=Ce[me];if(re==="(")++Le,je[Le]||(Ce[me]="(?:");else if(re.charAt(0)==="\\"){var q=+re.substring(1);q&&q<=Le&&(Ce[me]="\\"+je[q])}}for(var me=0;me<We;++me)Ce[me]==="^"&&Ce[me+1]!=="^"&&(Ce[me]="");if(Fe.ignoreCase&&Ie)for(var me=0;me<We;++me){var re=Ce[me],Z=re.charAt(0);re.length>=2&&Z==="["?Ce[me]=Ne(re):Z!=="\\"&&(Ce[me]=re.replace(/[a-zA-Z]/g,function(z){var Q=z.charCodeAt(0);return"["+String.fromCharCode(Q&~32,Q|32)+"]"}))}return Ce.join("")}for(var ze=[],De=0,Te=be.length;De<Te;++De){var ye=be[De];if(ye.global||ye.multiline)throw new Error(""+ye);ze.push("(?:"+Ve(ye)+")")}return new RegExp(ze.join("|"),Me?"gi":"g")}function I(be,Se){var Ie=/(?:^|\s)nocode(?:\s|$)/,Me=[],De=0,Te=[],ye=0;function Ge(Be){var He=Be.nodeType;if(He==1){if(Ie.test(Be.className))return;for(var Ne=Be.firstChild;Ne;Ne=Ne.nextSibling)Ge(Ne);var Ve=Be.nodeName.toLowerCase();(Ve==="br"||Ve==="li")&&(Me[ye]=`
`,Te[ye<<1]=De++,Te[ye++<<1|1]=Be)}else if(He==3||He==4){var ze=Be.nodeValue;ze.length&&(Se?ze=ze.replace(/\r\n?/g,`
`):ze=ze.replace(/[ \t\r\n]+/g," "),Me[ye]=ze,Te[ye<<1]=De,De+=ze.length,Te[ye++<<1|1]=Be)}}return Ge(be),{sourceCode:Me.join("").replace(/\n$/,""),spans:Te}}function k(be,Se,Ie,Me,De){if(!Ie)return;var Te={sourceNode:be,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Se,decorations:null};Me(Te),De.push.apply(De,Te.decorations)}var H=/\S/;function J(be){for(var Se=void 0,Ie=be.firstChild;Ie;Ie=Ie.nextSibling){var Me=Ie.nodeType;Se=Me===1?Se?be:Ie:Me===3&&H.test(Ie.nodeValue)?be:Se}return Se===be?void 0:Se}function $(be,Se){var Ie={},Me;(function(){for(var ye=be.concat(Se),Ge=[],Be={},He=0,Ne=ye.length;He<Ne;++He){var Ve=ye[He],ze=Ve[3];if(ze)for(var Fe=ze.length;--Fe>=0;)Ie[ze.charAt(Fe)]=Ve;var Ce=Ve[1],We=""+Ce;Be.hasOwnProperty(We)||(Ge.push(Ce),Be[We]=null)}Ge.push(/[\0-\uffff]/),Me=U(Ge)})();var De=Se.length,Te=function(ye){for(var Ge=ye.sourceCode,Be=ye.basePos,He=ye.sourceNode,Ne=[Be,o],Ve=0,ze=Ge.match(Me)||[],Fe={},Ce=0,We=ze.length;Ce<We;++Ce){var je=ze[Ce],me=Fe[je],Le=void 0,re;if(typeof me=="string")re=!1;else{var q=Ie[je.charAt(0)];if(q)Le=je.match(q[1]),me=q[0];else{for(var Z=0;Z<De;++Z)if(q=Se[Z],Le=je.match(q[1]),Le){me=q[0];break}Le||(me=o)}re=me.length>=5&&me.substring(0,5)==="lang-",re&&!(Le&&typeof Le[1]=="string")&&(re=!1,me=E),re||(Fe[je]=me)}var B=Ve;if(Ve+=je.length,!re)Ne.push(Be+B,me);else{var W=Le[1],z=je.indexOf(W),Q=z+W.length;Le[2]&&(Q=je.length-Le[2].length,z=Q-W.length);var de=me.substring(5);k(He,Be+B,je.substring(0,z),Te,Ne),k(He,Be+B+z,W,ne(de,W),Ne),k(He,Be+B+Q,je.substring(Q),Te,Ne)}}ye.decorations=Ne};return Te}function fe(be){var Se=[],Ie=[];be.tripleQuotedStrings?Se.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):be.multiLineStrings?Se.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),be.verbatimStrings&&Ie.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=be.hashComments;Me&&(be.cStyleComments?(Me>1?Se.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([m,/^#[^\r\n]*/,null,"#"])),be.cStyleComments&&(Ie.push([m,/^\/\/[^\r\n]*/,null]),Ie.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var De=be.regexLiterals;if(De){var Te=De>1?"":`
\r`,ye=Te?".":"[\\S\\s]",Ge="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+ye+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+ye+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+D+"("+Ge+")")])}var Be=be.types;Be&&Ie.push([f,Be]);var He=(""+be.keywords).replace(/^ | $/g,"");He.length&&Ie.push([y,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([o,/^\s+/,null,` \r
\xA0`]);var Ne="^.[^\\s\\w.$@'\"`/\\\\]*";return be.regexLiterals&&(Ne+="(?!s*/)"),Ie.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[a,new RegExp(Ne),null]),$(Se,Ie)}var he=fe({keywords:b,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ce(be,Se,Ie){for(var Me=/(?:^|\s)nocode(?:\s|$)/,De=/\r\n?|\n/,Te=be.ownerDocument,ye=Te.createElement("li");be.firstChild;)ye.appendChild(be.firstChild);var Ge=[ye];function Be(Ce){var We=Ce.nodeType;if(We==1&&!Me.test(Ce.className))if(Ce.nodeName==="br")He(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var je=Ce.firstChild;je;je=je.nextSibling)Be(je);else if((We==3||We==4)&&Ie){var me=Ce.nodeValue,Le=me.match(De);if(Le){var re=me.substring(0,Le.index);Ce.nodeValue=re;var q=me.substring(Le.index+Le[0].length);if(q){var Z=Ce.parentNode;Z.insertBefore(Te.createTextNode(q),Ce.nextSibling)}He(Ce),re||Ce.parentNode.removeChild(Ce)}}}function He(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function We(Le,re){var q=re?Le.cloneNode(!1):Le,Z=Le.parentNode;if(Z){var B=We(Z,1),W=Le.nextSibling;B.appendChild(q);for(var z=W;z;z=W)W=z.nextSibling,B.appendChild(z)}return q}for(var je=We(Ce.nextSibling,0),me;(me=je.parentNode)&&me.nodeType===1;)je=me;Ge.push(je)}for(var Ne=0;Ne<Ge.length;++Ne)Be(Ge[Ne]);Se===(Se|0)&&Ge[0].setAttribute("value",Se);var Ve=Te.createElement("ol");Ve.className="linenums";for(var ze=Math.max(0,Se-1|0)||0,Ne=0,Fe=Ge.length;Ne<Fe;++Ne)ye=Ge[Ne],ye.className="L"+(Ne+ze)%10,ye.firstChild||ye.appendChild(Te.createTextNode("\xA0")),Ve.appendChild(ye);be.appendChild(Ve)}function pe(be){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var Ie=/\n/g,Me=be.sourceCode,De=Me.length,Te=0,ye=be.spans,Ge=ye.length,Be=0,He=be.decorations,Ne=He.length,Ve=0;He[Ne]=De;var ze,Fe;for(Fe=ze=0;Fe<Ne;)He[Fe]!==He[Fe+2]?(He[ze++]=He[Fe++],He[ze++]=He[Fe++]):Fe+=2;for(Ne=ze,Fe=ze=0;Fe<Ne;){for(var Ce=He[Fe],We=He[Fe+1],je=Fe+2;je+2<=Ne&&He[je+1]===We;)je+=2;He[ze++]=Ce,He[ze++]=We,Fe=je}Ne=He.length=ze;var me=be.sourceNode,Le="";me&&(Le=me.style.display,me.style.display="none");try{for(var re=null;Be<Ge;){var q=ye[Be],Z=ye[Be+2]||De,B=He[Ve+2]||De,je=Math.min(Z,B),W=ye[Be+1],z;if(W.nodeType!==1&&(z=Me.substring(Te,je))){Se&&(z=z.replace(Ie,"\r")),W.nodeValue=z;var Q=W.ownerDocument,de=Q.createElement("span");de.className=He[Ve+1];var ve=W.parentNode;ve.replaceChild(de,W),de.appendChild(W),Te<Z&&(ye[Be+1]=W=Q.createTextNode(Me.substring(je,Z)),ve.insertBefore(W,de.nextSibling))}Te=je,Te>=Z&&(Be+=2),Te>=B&&(Ve+=2)}}finally{me&&(me.style.display=Le)}}var _e={};function oe(be,Se){for(var Ie=Se.length;--Ie>=0;){var Me=Se[Ie];_e.hasOwnProperty(Me)?C.console&&console.warn("cannot override language handler %s",Me):_e[Me]=be}}function ne(be,Se){return be&&_e.hasOwnProperty(be)||(be=/^\s*</.test(Se)?"default-markup":"default-code"),_e[be]}oe(he,["default-code"]),oe($([],[[o,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[a,/^(?:<[%?]|[%?]>)/],["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"]),oe($([[o,/^[\s]+/,null,` \r
`],[w,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[c,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[a,/^[=<>\/]+/],["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"]),oe($([],[[w,/^[\s\S]+/]]),["uq.val"]),oe(fe({keywords:g,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),oe(fe({keywords:"null,true,false"}),["json"]),oe(fe({keywords:r,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),oe(fe({keywords:s,cStyleComments:!0}),["java"]),oe(fe({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),oe(fe({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),oe(fe({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),oe(fe({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),oe(fe({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),oe(fe({keywords:n,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),oe($([],[[p,/^[\s\S]+/]]),["regex"]);function Ee(be){var Se=be.langExtension;try{var Ie=I(be.sourceNode,be.pre),Me=Ie.sourceCode;be.sourceCode=Me,be.spans=Ie.spans,be.basePos=0,ne(Se,Me)(be),pe(be)}catch(De){C.console&&console.log(De&&De.stack||De)}}function ke(be,Se,Ie){var Me=Ie||!1,De=Se||null,Te=document.createElement("div");Te.innerHTML="<pre>"+be+"</pre>",Te=Te.firstChild,Me&&ce(Te,Me,!0);var ye={langExtension:De,numberLines:Me,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ee(ye),Te.innerHTML}function we(be,Se){var Ie=Se||document.body,Me=Ie.ownerDocument||document;function De(q){return Ie.getElementsByTagName(q)}for(var Te=[De("pre"),De("code"),De("xmp")],ye=[],Ge=0;Ge<Te.length;++Ge)for(var Be=0,He=Te[Ge].length;Be<He;++Be)ye.push(Te[Ge][Be]);Te=null;var Ne=Date;Ne.now||(Ne={now:function(){return+new Date}});var Ve=0,ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,Fe=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,We=/pre|xmp/i,je=/^code$/i,me=/^(?:pre|code|xmp)$/i,Le={};function re(){for(var q=C.PR_SHOULD_USE_CONTINUATION?Ne.now()+250:Infinity;Ve<ye.length&&Ne.now()<q;Ve++){for(var Z=ye[Ve],B=Le,W=Z;W=W.previousSibling;){var z=W.nodeType,Q=(z===7||z===8)&&W.nodeValue;if(Q?!/^\??prettify\b/.test(Q):z!==3||/\S/.test(W.nodeValue))break;if(Q){B={},Q.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Nt,dt,Wt){B[dt]=Wt});break}}var de=Z.className;if((B!==Le||Fe.test(de))&&!Ce.test(de)){for(var ve=!1,Ae=Z.parentNode;Ae;Ae=Ae.parentNode){var Ye=Ae.tagName;if(me.test(Ye)&&Ae.className&&Fe.test(Ae.className)){ve=!0;break}}if(!ve){Z.className+=" prettyprinted";var qe=B.lang;if(!qe){qe=de.match(ze);var Qe;!qe&&(Qe=J(Z))&&je.test(Qe.tagName)&&(qe=Qe.className.match(ze)),qe&&(qe=qe[1])}var St;if(We.test(Z.tagName))St=1;else{var ht=Z.currentStyle,$e=Me.defaultView,Dt=ht?ht.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(Z,null).getPropertyValue("white-space"):0;St=Dt&&Dt.substring(0,3)==="pre"}var Ot=B.linenums;(Ot=Ot==="true"||+Ot)||(Ot=de.match(/\blinenums\b(?::(\d+))?/),Ot=Ot?Ot[1]&&Ot[1].length?+Ot[1]:!0:!1),Ot&&ce(Z,Ot,St);var kt={langExtension:qe,sourceNode:Z,numberLines:Ot,pre:St,sourceCode:null,basePos:null,spans:null,decorations:null};Ee(kt)}}}Ve<ye.length?C.setTimeout(re,250):typeof be=="function"&&be()}re()}var Re=C.PR={createSimpleLexer:$,registerLangHandler:oe,sourceDecorator:fe,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:w,PR_COMMENT:m,PR_DECLARATION:h,PR_KEYWORD:y,PR_LITERAL:d,PR_NOCODE:P,PR_PLAIN:o,PR_PUNCTUATION:a,PR_SOURCE:E,PR_STRING:p,PR_TAG:c,PR_TYPE:f,prettyPrintOne:O?C.prettyPrintOne=ke:A=ke,prettyPrint:M=O?C.prettyPrint=we:M=we},Ue=C.define;typeof Ue=="function"&&Ue.amd&&Ue("google-code-prettify",[],function(){return Re})})()},TXwP:function(ut,tt,te){var le,N;(function(){var O;(function(){"use strict";var T=[,,function(S){function x(s){this.__parent=s,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=[]}x.prototype.clone_empty=function(){var s=new x(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},x.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},x.prototype.has_match=function(s){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(s))return!0;return!1},x.prototype.set_indent=function(s,r){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},x.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)},x.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},x.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},x.prototype.is_empty=function(){return this.__items.length===0},x.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},x.prototype.push=function(s){this.__items.push(s);var r=s.lastIndexOf(`
`);r!==-1?this.__character_count=s.length-r:this.__character_count+=s.length},x.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},x.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},x.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},x.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},x.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function v(s,r){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),r=r||"",s.indent_level>0&&(r=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}v.prototype.get_indent_size=function(s,r){var n=this.__base_string_length;return r=r||0,s<0&&(n=0),n+=s*this.__indent_size,n+=r,n},v.prototype.get_indent_string=function(s,r){var n=this.__base_string;return r=r||0,s<0&&(s=0,n=""),r+=s*this.__indent_size,this.__ensure_cache(r),n+=this.__cache[r],n},v.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var s=this.__cache.length,r=0,n="";this.__indent_size&&s>=this.__indent_size&&(r=Math.floor(s/this.__indent_size),s-=r*this.__indent_size,n=new Array(r+1).join(this.__indent_string)),s&&(n+=new Array(s+1).join(" ")),this.__cache.push(n)};function g(s,r){this.__indent_cache=new v(s,r),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new x(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(s,r){return this.__indent_cache.get_indent_string(s,r)},g.prototype.get_indent_size=function(s,r){return this.__indent_cache.get_indent_size(s,r)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(s){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
`);return s!==`
`&&(n=n.replace(/[\n]/g,s)),n},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(s,r){return s=s||0,r=r||0,this.next_line.set_indent(s,r),this.__lines.length>1?(this.current_line.set_indent(s,r),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(s){for(var r=0;r<s.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(s){for(var r=this.__lines.length;s<r;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(s,r){for(var n=this.__lines.length-2;n>=0;){var u=this.__lines[n];if(u.is_empty())break;if(u.item(0).indexOf(s)!==0&&u.item(-1)!==r){this.__lines.splice(n+1,0,new x(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},S.exports.Output=g},,,,function(S){function x(s,r){this.raw_options=v(s,r),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"])}x.prototype._get_array=function(s,r){var n=this.raw_options[s],u=r||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(u=n.concat()):typeof n=="string"&&(u=n.split(/[^a-zA-Z0-9_\/\-]+/)),u},x.prototype._get_boolean=function(s,r){var n=this.raw_options[s],u=n===void 0?!!r:!!n;return u},x.prototype._get_characters=function(s,r){var n=this.raw_options[s],u=r||"";return typeof n=="string"&&(u=n.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},x.prototype._get_number=function(s,r){var n=this.raw_options[s];r=parseInt(r,10),isNaN(r)&&(r=0);var u=parseInt(n,10);return isNaN(u)&&(u=r),u},x.prototype._get_selection=function(s,r,n){var u=this._get_selection_list(s,r,n);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[s]+"'");return u[0]},x.prototype._get_selection_list=function(s,r,n){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[r[0]],!this._is_valid_selection(n,r))throw new Error("Invalid Default Value!");var u=this._get_array(s,n);if(!this._is_valid_selection(u,r))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[s]+"'");return u},x.prototype._is_valid_selection=function(s,r){return s.length&&r.length&&!s.some(function(n){return r.indexOf(n)===-1})};function v(s,r){var n={};s=g(s);var u;for(u in s)u!==r&&(n[u]=s[u]);if(r&&s[r])for(u in s[r])n[u]=s[r][u];return n}function g(s){var r={},n;for(n in s){var u=n.replace(/-/g,"_");r[u]=s[n]}return r}S.exports.Options=x,S.exports.normalizeOpts=g,S.exports.mergeOpts=v},,function(S){var x=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var s=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(s=this.__input.charAt(g)),s},v.prototype.__match=function(g,s){g.lastIndex=s;var r=g.exec(this.__input);return r&&!(x&&g.sticky)&&(r.index!==s&&(r=null)),r},v.prototype.test=function(g,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(g,s):!1},v.prototype.testChar=function(g,s){var r=this.peek(s);return g.lastIndex=0,r!==null&&g.test(r)},v.prototype.match=function(g){var s=this.__match(g,this.__position);return s?this.__position+=s[0].length:s=null,s},v.prototype.read=function(g,s,r){var n="",u;return g&&(u=this.match(g),u&&(n+=u[0])),s&&(u||!g)&&(n+=this.readUntil(s,r)),n},v.prototype.readUntil=function(g,s){var r="",n=this.__position;g.lastIndex=this.__position;var u=g.exec(this.__input);return u?(n=u.index,s&&(n+=u[0].length)):n=this.__input_length,r=this.__input.substring(this.__position,n),this.__position=n,r},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,s){var r=null,n="g";return s&&x&&(n="y"),typeof g=="string"&&g!==""?r=new RegExp(g,n):g&&(r=new RegExp(g.source,n)),r},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var s=this.__position,r=this.readUntilAfter(g);return this.__position=s,r},v.prototype.lookBack=function(g){var s=this.__position-1;return s>=g.length&&this.__input.substring(s-g.length,s).toLowerCase()===g},S.exports.InputScanner=v},,,,,function(S){function x(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}x.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(v);s;)g[s[1]]=s[2],s=this.__directive_pattern.exec(v);return g},x.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},S.exports.Directives=x},,function(S,x,v){var g=v(16).Beautifier,s=v(17).Options;function r(n,u){var l=new g(n,u);return l.beautify()}S.exports=r,S.exports.defaultOptions=function(){return new s}},function(S,x,v){var g=v(17).Options,s=v(2).Output,r=v(8).InputScanner,n=v(13).Directives,u=new n(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,e=/\r\n|[\r\n]/g,t=/\s/,i=/(?:\s|\n)+/g,b=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function p(y,m){this._source_text=y||"",this._options=new g(m),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(y){var m="";for(this._ch=this._input.next();this._ch;){if(m+=this._ch,this._ch==="\\")m+=this._input.next();else if(y.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return m},p.prototype.eatWhitespace=function(y){for(var m=t.test(this._input.peek()),f=0;t.test(this._input.peek());)this._ch=this._input.next(),y&&this._ch===`
`&&((f===0||f<this._options.max_preserve_newlines)&&(f++,this._output.add_new_line(!0)));return m},p.prototype.foundNestedPseudoClass=function(){for(var y=0,m=1,f=this._input.peek(m);f;){if(f==="{")return!0;if(f==="(")y+=1;else if(f===")"){if(y===0)return!1;y-=1}else if(f===";"||f==="}")return!1;m++,f=this._input.peek(m)}return!1},p.prototype.print_string=function(y){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(y)},p.prototype.preserveSingleSpace=function(y){y&&(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 y=this._source_text,m=this._options.eol;m==="auto"&&(m=`
`,y&&l.test(y||"")&&(m=y.match(l)[0])),y=y.replace(e,`
`);var f=y.match(/^[\t ]*/)[0];this._output=new s(this._options,f),this._input=new r(y),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var d=0,a=!1,o=!1,c=!1,h=!1,E=!1,R=!1,w=this._ch,P=!1,D,U,I;D=this._input.read(i),U=D!=="",I=w,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var k=this._input.read(b),H=u.get_directives(k);H&&H.ignore==="start"&&(k+=u.readIgnored(this._input)),this.print_string(k),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(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var J=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);J.match(/[ :]$/)&&(J=this.eatString(": ").replace(/\s$/,""),this.print_string(J),this._output.space_before_token=!0),J=J.replace(/\s$/,""),J==="extend"?h=!0:J==="import"&&(E=!0),J in this.NESTED_AT_RULE?(this._nestedLevel+=1,J in this.CONDITIONAL_GROUP_RULE&&(c=!0)):!a&&d===0&&J.indexOf(":")!==-1&&(o=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")o&&(o=!1,this.outdent()),c?(c=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&(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),E=!1,h=!1,o&&(this.outdent(),o=!1),this.print_string(this._ch),a=!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 $=0;$<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;$++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[$])){P=!0;break}(a||c)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!h&&d===0?(this.print_string(":"),o||(o=!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 fe=I==='"'||I==="'";this.preserveSingleSpace(fe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")P=!1,d===0?(o&&(this.outdent(),o=!1),h=!1,E=!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(),d++,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(")")),d&&(d--,this.outdent()));else{var he=!1;this._input.lookBack("with")&&(he=!0),this.preserveSingleSpace(U||he),this.print_string(this._ch),o&&I==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),R=!0):(this.eatWhitespace(),d++,this.indent())}else if(this._ch===")")d&&(d--,this.outdent()),R&&this._input.peek()===";"&&this._options.selector_separator_newline&&(R=!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&&(!o||R)&&d===0&&!E&&!h?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!o&&d===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&&t.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),t.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ce=I==='"'||I==="'";this.preserveSingleSpace(ce||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&P&&this._output.add_new_line()}var pe=this._output.get_code(m);return pe},S.exports.Beautifier=p},function(S,x,v){var g=v(6).Options;function s(r){g.call(this,r,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<u.length;l++)u[l]!=="expand"?this.brace_style="collapse":this.brace_style=u[l]}s.prototype=new g,S.exports.Options=s}],A={};function M(S){var x=A[S];if(x!==void 0)return x.exports;var v=A[S]={exports:{}};return T[S](v,v.exports,M),v.exports}var C=M(15);O=C})();var L=O;!(le=[],N=function(){return{css_beautify:L}}.apply(tt,le),N!==void 0&&(ut.exports=N))})()},ZW9T:function(ut,tt,te){"use strict";te.d(tt,"a",function(){return D});var le=te("k1fw"),N=te("miYZ"),O=te("tsqr"),L=te("rAM+"),T=te("tJVT"),A=te("PpiC"),M=te("cDcd"),C=te.n(M),S=te("bdgK"),x=te("oBTY"),v=te("9og8"),g=te("WmNS"),s=te.n(g),r={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"]},n={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},u={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","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:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $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 <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={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(`
`)}]},e=te("5VLF"),t=te.n(e),i={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"]}},b=function(I,k){return k.map(function(H){return{label:H,kind:I.languages.CompletionItemKind.Keyword,insertText:H}})},_=function(I){return Object.keys(i.tables).map(function(k){return{label:k,kind:I.languages.CompletionItemKind.Variable,insertText:k}})},p=function(I,k){var H=i.tables[I];return H?H.map(function(J){return{label:J,kind:k.languages.CompletionItemKind.Field,insertText:J}}):[]};function y(U,I,k,H,J){var $=I.getWordUntilPosition(k),fe={startLineNumber:k.lineNumber,endLineNumber:k.lineNumber,startColumn:$.startColumn,endColumn:$.endColumn},he=H.map(function(ce){return{label:ce,kind:U.languages.CompletionItemKind.Keyword,insertText:ce,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}});return J.map(function(ce){he.push(Object(le.a)(Object(le.a)({},ce),{},{range:fe}))}),he}var m=function(U){i.languages.map(function(J){return U.languages.registerDocumentFormattingEditProvider(J,{provideDocumentFormattingEdits:function(fe,he,ce){return Object(v.a)(s.a.mark(function pe(){var _e;return s.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return _e=t()(fe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:fe.getFullModelRange(),text:_e}]);case 2:case"end":return ne.stop()}},pe)}))()}}),J});var I=u.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),k=l.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),H=n.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(x.a)(u.keywords),Object(x.a)(u.quickKey.map(function(J){return J.label}))),provideCompletionItems:function($,fe){var he=$.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),ce=he.match(/cu/gim);console.log("match:",ce,fe,he,$);var pe=[],_e=fe.lineNumber,oe=fe.column,ne=$.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:oe}),Ee=ne.trim().split(/\s+/),ke=Ee[Ee.length-1];if(ke.endsWith(".")){var we=ke.slice(0,ke.length-1);Object.keys(i.tables).includes(we)&&(pe=Object(x.a)(p(we,U)))}else ke==="."?pe=[]:pe=[].concat(Object(x.a)(_(U)),Object(x.a)(b(U,u.keywords)),Object(x.a)(I));return{suggestions:pe}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(x.a)(r.keywords)),provideCompletionItems:function($,fe){var he=$.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),ce=he.match(/cu/gim);console.log("match:",ce,fe,he,$);var pe=[],_e=fe.lineNumber,oe=fe.column,ne=$.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:oe}),Ee=ne.trim().split(/\s+/),ke=Ee[Ee.length-1];if(ke.endsWith(".")){var we=ke.slice(0,ke.length-1);Object.keys(i.tables).includes(we)&&(pe=Object(x.a)(p(we,U)))}else ke==="."?pe=[]:pe=[].concat(Object(x.a)(_(U)),Object(x.a)(b(U,r.keywords)));return{suggestions:pe}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(x.a)(n.keywords)),provideCompletionItems:function($,fe){var he=[],ce=fe.lineNumber,pe=fe.column,_e=$.getValueInRange({startLineNumber:ce,startColumn:0,endLineNumber:ce,endColumn:pe}),oe=_e.trim().split(/\s+/),ne=oe[oe.length-1];if(ne.endsWith(".")){var Ee=ne.slice(0,ne.length-1);Object.keys(i.tables).includes(Ee)&&(he=Object(x.a)(p(Ee,U)))}else ne==="."?he=[]:he=[].concat(Object(x.a)(_(U)),Object(x.a)(b(U,n.keywords)),Object(x.a)(H));return{suggestions:he}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(x.a)(l.keywords)),provideCompletionItems:function($,fe){var he=[],ce=fe.lineNumber,pe=fe.column,_e=$.getValueInRange({startLineNumber:ce,startColumn:0,endLineNumber:ce,endColumn:pe}),oe=_e.trim().split(/\s+/),ne=oe[oe.length-1];if(ne.endsWith(".")){var Ee=ne.slice(0,ne.length-1);Object.keys(i.tables).includes(Ee)&&(he=Object(x.a)(p(Ee,U)))}else ne==="."?he=[]:he=[].concat(Object(x.a)(_(U)),Object(x.a)(b(U,l.keywords)),Object(x.a)(k));return{suggestions:he}}})},f="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",d=te("LvDl"),a=te("+ua5");function o(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function c(){}var h=!1,E={"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 R(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],I=U;if(Array.isArray(U)){for(var k=0;k<U.length;k++){var H=E[U[k]];if(H)return H}return I[0]}return E[I]||I}var w=null,P=tt.b=function(U){var I=U.width,k=I===void 0?"100%":I,H=U.height,J=H===void 0?"100%":H,$=U.value,fe=U.language,he=fe===void 0?"javascript":fe,ce=U.style,pe=ce===void 0?{}:ce,_e=U.options,oe=_e===void 0?{}:_e,ne=U.overrideServices,Ee=ne===void 0?{}:ne,ke=U.theme,we=ke===void 0?"vs-dark":ke,Re=U.onEditBlur,Ue=U.onSave,be=U.autoHeight,Se=be===void 0?!1:be,Ie=U.forbidCopy,Me=Ie===void 0?!1:Ie,De=U.onChange,Te=De===void 0?c:De,ye=U.editorDidMount,Ge=ye===void 0?c:ye,Be=U.onFocus,He=Be===void 0?c:Be,Ne=U.filename,Ve=Ne===void 0?"educoder.txt":Ne,ze=U.errorLine,Fe=U.errorContent,Ce=Fe===void 0?"":Fe,We=Object(A.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),je=Object(M.useRef)(),me=Object(M.useRef)({}),Le=Object(M.useRef)(),re=Object(M.useRef)(!1),q=Object(M.useRef)(),Z=Object(M.useState)(!1),B=Object(T.a)(Z,2),W=B[0],z=B[1];function Q(){var et;return je.current&&(et=new S.default(function(it){var xt=Object(L.a)(it),wt;try{for(xt.s();!(wt=xt.n()).done;){var Jt=wt.value;(Jt.target.offsetHeight>0||Jt.target.offsetWidth>0)&&me.current.instance.layout()}}catch(_n){xt.e(_n)}finally{xt.f()}}),et.observe(je.current)),et}function de(){O.b.warn(decodeURIComponent(f))}var ve=function(){var it=me.current.instance;if($!=null&&it&&W){var xt=it.getModel();xt&&$!==xt.getValue()&&(h=!0,xt.setValue($),it.layout(),h=!1)}};Object(M.useEffect)(function(){Le.current&&clearTimeout(Le.current),Le.current=setTimeout(function(){ve()},500)},[$,W,me.current]),Object(M.useEffect)(function(){if(ze&&me.current&&me.current.instance){var et=me.current.instance;et.changeViewZones(function(xt){var wt=document.createElement("div");wt.style.padding="10px 20px",wt.style.width="calc(100% - 20px)",wt.className="my-error-line-wrp",wt.innerHTML=Ce,xt.addZone({afterLineNumber:ze||11,heightInLines:3,domNode:wt})});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}};et.addOverlayWidget(it),et.revealPositionInCenter({lineNumber:20,column:1})}},[ze,me.current,W]);function Ae(){var et=me.current.instance;if(et){var it=et.getSelection(),xt=me.current.pastePos||{},wt=new w.Range(xt.startLineNumber||it.endLineNumber,xt.startColumn||it.endColumn,xt.endLineNumber||it.endLineNumber,xt.endColumn||it.endColumn);setTimeout(function(){et.executeEdits("",[{range:wt,text:""}])},300)}}function Ye(et){(window.navigator.platform.match("Mac")?et.metaKey:et.ctrlKey)&&et.keyCode==83&&(et.preventDefault(),Ue())}var qe=function(){if(Se&&me.current.instance){var it=me.current.instance.getContentHeight();Wt(it<J?J:it)}else Wt(J)};function Qe(et){var it=document.createEvent("MouseEvents");it.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),et.dispatchEvent(it)}function St(et,it){var xt=window.URL||window.webkitURL||window,wt=new Blob([it]),Jt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Jt.href=xt.createObjectURL(wt),Jt.download=et,Qe(Jt)}Object(M.useEffect)(function(){qe()},[qe]),Object(M.useEffect)(function(){je.current&&!W&&te.e(27).then(te.t.bind(null,"M/lh",7)).then(function(et){try{w=et,me.current.instance=w.editor.create(je.current,{value:$,language:R(he),theme:we,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Ee);var it=me.current.instance;if(Ge(it,w),setTimeout(function(){qe(),me.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){St(Ve||"educoder.txt",it.getValue())}})},500),me.current.subscription=it.onDidChangeModelContent(function(wt){re.current?clearTimeout(q.current):(qe(),Te(it.getValue(),wt)),q.current=setTimeout(function(){re.current=!1},500)}),window.Monaco||m(w),Me&&(it.addCommand(w.KeyMod.CtrlCmd|w.KeyMod.Shift|w.KeyCode.KEY_V,function(){return de(),null}),it.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_C,function(){return de(),null})),window.Monaco=w,Re&&it.onDidBlurEditorWidget(function(){Re(it.getValue())}),He&&it.onDidFocusEditorText(function(){He(it.getValue())}),Me){it.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return de(),null}),it.onDidPaste(function(wt){me.current.pastePos=wt});try{window.addEventListener("paste",Ae)}catch(wt){}}var xt=Q();return z(!0),function(){var wt=me.current.instance;wt.dispose();var Jt=wt.getModel();Jt&&Jt.dispose(),me.current.subscription&&me.current.subscription.dispose(),Me&&window.removeEventListener("paste",Ae),xt.unobserve(je.current)}}catch(wt){}})},[]),Object(M.useEffect)(function(){var et=me.current.instance;if(et&&W)return document.addEventListener("keydown",Ye,!1),function(){document.removeEventListener("keydown",Ye)}},[Ue,W]),Object(M.useEffect)(function(){var et=me.current.instance;if(et&&W){var it=R(he);w.editor.setModelLanguage(et.getModel(),it),console.log("language:",he,et.getModel(),it)}},[he,W]),Object(M.useEffect)(function(){var et=me.current.instance;et&&W&&w.editor.setTheme(we)},[we,W]),Object(M.useEffect)(function(){var et=me.current.instance;et&&W&&(et.updateOptions(Object(le.a)({},oe)),setTimeout(function(){et.getModel().updateOptions(Object(le.a)({},oe))},200))},[JSON.stringify(oe),W]),Object(M.useEffect)(function(){var et=me.current.instance;et&&W&&et.layout()},[k,J,W]);var ht=Object(M.useState)(o(k)),$e=Object(T.a)(ht,2),Dt=$e[0],Ot=$e[1],kt=Object(M.useState)(o(J)),Nt=Object(T.a)(kt,2),dt=Nt[0],Wt=Nt[1],$t=Object(le.a)(Object(le.a)({},pe),{},{width:Dt,height:dt});return C.a.createElement("div",{className:"my-monaco-editor",ref:je,style:$t})};function D(U){var I=U.width,k=I===void 0?"100%":I,H=U.height,J=H===void 0?"100%":H,$=U.original,fe=U.modified,he=U.language,ce=U.options,pe=ce===void 0?{}:ce,_e=Object(M.useRef)(),oe=Object(M.useState)(null),ne=Object(T.a)(oe,2),Ee=ne[0],ke=ne[1];function we(Se){var Ie;return _e.current&&(Ie=new S.default(function(Me){var De=Object(L.a)(Me),Te;try{for(De.s();!(Te=De.n()).done;){var ye=Te.value;(ye.target.offsetHeight>0||ye.target.offsetWidth>0)&&Se.layout()}}catch(Ge){De.e(Ge)}finally{De.f()}}),Ie.observe(_e.current)),Ie}Object(M.useEffect)(function(){_e.current&&te.e(27).then(te.t.bind(null,"M/lh",7)).then(function(Se){w=Se;var Ie=w.editor.createDiffEditor(_e.current,Object(le.a)(Object(le.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},pe),{},{wordWrap:!0}));ke(Ie);var Me=we(Ie);return function(){Ie.dispose();var De=Ie.getModel();De&&De.dispose(),Me.unobserve(_e.current)}})},[]),Object(M.useEffect)(function(){Ee&&Ee.setModel({original:w.editor.createModel($,he),modified:w.editor.createModel(fe,he)})},[$,fe,he,Ee]);var Re=o(k),Ue=o(J),be={width:Re,height:Ue};return C.a.createElement("div",{className:"my-diff-editor",ref:_e,style:be})}},bT9E:function(ut,tt,te){"use strict";te.d(tt,"a",function(){return N});var le=te("VTBJ");function N(O,L){var T=Object(le.a)({},O);return Array.isArray(L)&&L.forEach(function(A){delete T[A]}),T}},k3GJ:function(ut,tt,te){"use strict";te.d(tt,"a",function(){return pi});var le=te("rePB"),N=te("ODXe"),O=te("Ff2n"),L=te("VTBJ"),T=te("cDcd"),A=te("TSYQ"),M=te.n(A),C=te("Zm9Q"),S=te("6cGi"),x=te("KQm4"),v=te("xEkU"),g=te.n(v),s=te("t23M");function r(G){var ee=Object(T.useRef)(),ae=Object(T.useRef)(!1);function Y(){for(var F=arguments.length,K=new Array(F),j=0;j<F;j++)K[j]=arguments[j];ae.current||(g.a.cancel(ee.current),ee.current=g()(function(){G.apply(void 0,K)}))}return Object(T.useEffect)(function(){return function(){ae.current=!0,g.a.cancel(ee.current)}},[]),Y}function n(G){var ee=Object(T.useRef)([]),ae=Object(T.useState)({}),Y=Object(N.a)(ae,2),F=Y[1],K=Object(T.useRef)(typeof G=="function"?G():G),j=r(function(){var X=K.current;ee.current.forEach(function(se){X=se(X)}),ee.current=[],K.current=X,F({})});function V(X){ee.current.push(X),j()}return[K.current,V]}var u=te("4IlW");function l(G,ee){var ae,Y=G.prefixCls,F=G.id,K=G.active,j=G.rtl,V=G.tab,X=V.key,se=V.tab,ie=V.disabled,ue=V.closeIcon,ge=G.tabBarGutter,Oe=G.tabPosition,xe=G.closable,Pe=G.renderWrapper,Ze=G.removeAriaLabel,st=G.editable,nt=G.onClick,lt=G.onRemove,ot=G.onFocus,rt="".concat(Y,"-tab");T.useEffect(function(){return lt},[]);var at={};Oe==="top"||Oe==="bottom"?at[j?"marginLeft":"marginRight"]=ge:at.marginBottom=ge;var gt=st&&xe!==!1&&!ie;function ct(Je){if(ie)return;nt(Je)}function Lt(Je){Je.preventDefault(),Je.stopPropagation(),st.onEdit("remove",{key:X,event:Je})}var bt=T.createElement("div",{key:X,ref:ee,className:M()(rt,(ae={},Object(le.a)(ae,"".concat(rt,"-with-remove"),gt),Object(le.a)(ae,"".concat(rt,"-active"),K),Object(le.a)(ae,"".concat(rt,"-disabled"),ie),ae)),style:at,onClick:ct},T.createElement("div",{role:"tab","aria-selected":K,id:F&&"".concat(F,"-tab-").concat(X),className:"".concat(rt,"-btn"),"aria-controls":F&&"".concat(F,"-panel-").concat(X),"aria-disabled":ie,tabIndex:ie?null:0,onClick:function(Xe){Xe.stopPropagation(),ct(Xe)},onKeyDown:function(Xe){[u.a.SPACE,u.a.ENTER].includes(Xe.which)&&(Xe.preventDefault(),ct(Xe))},onFocus:ot},se),gt&&T.createElement("button",{type:"button","aria-label":Ze||"remove",tabIndex:0,className:"".concat(rt,"-remove"),onClick:function(Xe){Xe.stopPropagation(),Lt(Xe)}},ue||st.removeIcon||"\xD7"));return Pe&&(bt=Pe(bt)),bt}var e=T.forwardRef(l),t={width:0,height:0,left:0,top:0};function i(G,ee,ae){return Object(T.useMemo)(function(){for(var Y,F=new Map,K=ee.get((Y=G[0])===null||Y===void 0?void 0:Y.key)||t,j=K.left+K.width,V=0;V<G.length;V+=1){var X=G[V].key,se=ee.get(X);if(!se){var ie;se=ee.get((ie=G[V-1])===null||ie===void 0?void 0:ie.key)||t}var ue=F.get(X)||Object(L.a)({},se);ue.right=j-ue.left-ue.width,F.set(X,ue)}return F},[G.map(function(Y){return Y.key}).join("_"),ee,ae])}var b={width:0,height:0,left:0,top:0,right:0};function _(G,ee,ae,Y,F){var K=F.tabs,j=F.tabPosition,V=F.rtl,X,se,ie;["top","bottom"].includes(j)?(X="width",se=V?"right":"left",ie=Math.abs(ee.left)):(X="height",se="top",ie=-ee.top);var ue=ee[X],ge=ae[X],Oe=Y[X],xe=ue;return ge+Oe>ue&&(xe=ue-Oe),Object(T.useMemo)(function(){if(!K.length)return[0,0];for(var Pe=K.length,Ze=Pe,st=0;st<Pe;st+=1){var nt=G.get(K[st].key)||b;if(nt[se]+nt[X]>ie+xe){Ze=st-1;break}}for(var lt=0,ot=Pe-1;ot>=0;ot-=1){var rt=G.get(K[ot].key)||b;if(rt[se]<ie){lt=ot+1;break}}return[lt,Ze]},[G,ie,xe,j,K.map(function(Pe){return Pe.key}).join("_"),V])}var p=te("wx14"),y=te("1OyB"),m=te("vuIU"),f=te("JX7q"),d=te("Ji7U"),a=te("LK+K"),o=te("I8Z2"),c=te("bT9E"),h=te("2GS6"),E=te("Gytx"),R=te.n(E),w=te("U8pU"),P=/iPhone/i,D=/iPod/i,U=/iPad/i,I=/\bAndroid(?:.+)Mobile\b/i,k=/Android/i,H=/\bAndroid(?:.+)SD4930UR\b/i,J=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,$=/Windows Phone/i,fe=/\bWindows(?:.+)ARM\b/i,he=/BlackBerry/i,ce=/BB10/i,pe=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,oe=/Mobile(?:.+)Firefox\b/i;function ne(G,ee){return G.test(ee)}function Ee(G){var ee=G||(typeof navigator!="undefined"?navigator.userAgent:""),ae=(ee||"").split("[FBAN");if(typeof ae[1]!="undefined"){var Y=ae,F=Object(N.a)(Y,1);ee=F[0]}if(ae=ee.split("Twitter"),typeof ae[1]!="undefined"){var K=ae,j=Object(N.a)(K,1);ee=j[0]}var V={apple:{phone:ne(P,ee)&&!ne($,ee),ipod:ne(D,ee),tablet:!ne(P,ee)&&ne(U,ee)&&!ne($,ee),device:(ne(P,ee)||ne(D,ee)||ne(U,ee))&&!ne($,ee)},amazon:{phone:ne(H,ee),tablet:!ne(H,ee)&&ne(J,ee),device:ne(H,ee)||ne(J,ee)},android:{phone:!ne($,ee)&&ne(H,ee)||!ne($,ee)&&ne(I,ee),tablet:!ne($,ee)&&!ne(H,ee)&&!ne(I,ee)&&(ne(J,ee)||ne(k,ee)),device:!ne($,ee)&&(ne(H,ee)||ne(J,ee)||ne(I,ee)||ne(k,ee))||ne(/\bokhttp\b/i,ee)},windows:{phone:ne($,ee),tablet:ne(fe,ee),device:ne($,ee)||ne(fe,ee)},other:{blackberry:ne(he,ee),blackberry10:ne(ce,ee),opera:ne(pe,ee),firefox:ne(oe,ee),chrome:ne(_e,ee),device:ne(he,ee)||ne(ce,ee)||ne(pe,ee)||ne(oe,ee)||ne(_e,ee)},any:null,phone:null,tablet:null};return V.any=V.apple.device||V.android.device||V.windows.device||V.other.device,V.phone=V.apple.phone||V.android.phone||V.windows.phone,V.tablet=V.apple.tablet||V.android.tablet||V.windows.tablet,V}var ke=Object(L.a)(Object(L.a)({},Ee()),{},{isMobile:Ee}),we=ke;function Re(){}function Ue(G,ee,ae){var Y=ee||"";return G.key||"".concat(Y,"item_").concat(ae)}function be(G){return"".concat(G,"-menu-")}function Se(G,ee){var ae=-1;T.Children.forEach(G,function(Y){ae+=1,Y&&Y.type&&Y.type.isMenuItemGroup?T.Children.forEach(Y.props.children,function(F){ae+=1,ee(F,ae)}):ee(Y,ae)})}function Ie(G,ee,ae){if(!G||ae.find)return;T.Children.forEach(G,function(Y){if(Y){var F=Y.type;if(!F||!(F.isSubMenu||F.isMenuItem||F.isMenuItemGroup))return;ee.indexOf(Y.key)!==-1?ae.find=!0:Y.props.children&&Ie(Y.props.children,ee,ae)}})}var Me=["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"],De=function(ee){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Y=ee&&typeof ee.getBoundingClientRect=="function"&&ee.getBoundingClientRect().width;if(Y){if(ae){var F=getComputedStyle(ee),K=F.marginLeft,j=F.marginRight;Y+=+K.replace("px","")+ +j.replace("px","")}Y=+Y.toFixed(6)}return Y||0},Te=function(ee,ae,Y){ee&&Object(w.a)(ee.style)==="object"&&(ee.style[ae]=Y)},ye=function(){return we.any},Ge=te("bdgK"),Be=te("faye"),He=te.n(Be),Ne=te("wgJM"),Ve=te("l4aY"),ze=te("m+aA"),Fe=te("c+Xe"),Ce=te("zT1h"),We=te("QC+M");function je(G,ee,ae){return ae?G[0]===ee[0]:G[0]===ee[0]&&G[1]===ee[1]}function me(G,ee,ae){var Y=G[ee]||{};return Object(L.a)(Object(L.a)({},Y),ae)}function Le(G,ee,ae,Y){for(var F=ae.points,K=Object.keys(G),j=0;j<K.length;j+=1){var V=K[j];if(je(G[V].points,F,Y))return"".concat(ee,"-placement-").concat(V)}return""}var re=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var G=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(G)||/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(G==null?void 0:G.substr(0,4)))},q=te("MNnm");function Z(G,ee){var ae={};return ae[G.toLowerCase()]=ee.toLowerCase(),ae["Webkit".concat(G)]="webkit".concat(ee),ae["Moz".concat(G)]="moz".concat(ee),ae["ms".concat(G)]="MS".concat(ee),ae["O".concat(G)]="o".concat(ee.toLowerCase()),ae}function B(G,ee){var ae={animationend:Z("Animation","AnimationEnd"),transitionend:Z("Transition","TransitionEnd")};return G&&("AnimationEvent"in ee||delete ae.animationend.animation,"TransitionEvent"in ee||delete ae.transitionend.transition),ae}var W=B(Object(q.a)(),typeof window!="undefined"?window:{}),z={};if(Object(q.a)()){var Q=document.createElement("div");z=Q.style}var de={};function ve(G){if(de[G])return de[G];var ee=W[G];if(ee)for(var ae=Object.keys(ee),Y=ae.length,F=0;F<Y;F+=1){var K=ae[F];if(Object.prototype.hasOwnProperty.call(ee,K)&&K in z)return de[G]=ee[K],de[G]}return""}var Ae=ve("animationend"),Ye=ve("transitionend"),qe=!!(Ae&&Ye),Qe=Ae||"animationend",St=Ye||"transitionend";function ht(G,ee){if(!G)return null;if(Object(w.a)(G)==="object"){var ae=ee.replace(/-\w/g,function(Y){return Y[1].toUpperCase()});return G[ae]}return"".concat(G,"-").concat(ee)}var $e="none",Dt="appear",Ot="enter",kt="leave",Nt="none",dt="prepare",Wt="start",$t="active",et="end";function it(G){var ee=Object(T.useRef)(!1),ae=Object(T.useState)(G),Y=Object(N.a)(ae,2),F=Y[0],K=Y[1];function j(V){ee.current||K(V)}return Object(T.useEffect)(function(){return function(){ee.current=!0}},[]),[F,j]}var xt=Object(q.a)()?T.useLayoutEffect:T.useEffect,wt=xt,Jt=function(){var G=T.useRef(null);function ee(){Ne.a.cancel(G.current)}function ae(Y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;ee();var K=Object(Ne.a)(function(){F<=1?Y({isCanceled:function(){return K!==G.current}}):ae(Y,F-1)});G.current=K}return T.useEffect(function(){return function(){ee()}},[]),[ae,ee]},_n=[dt,Wt,$t,et],Hn=!1,Hi=!0;function Wn(G){return G===$t||G===et}var Wi=function(G,ee){var ae=T.useState(Nt),Y=Object(N.a)(ae,2),F=Y[0],K=Y[1],j=Jt(),V=Object(N.a)(j,2),X=V[0],se=V[1];function ie(){K(dt)}return wt(function(){if(F!==Nt&&F!==et){var ue=_n.indexOf(F),ge=_n[ue+1],Oe=ee(F);Oe===Hn?K(ge):X(function(xe){function Pe(){if(xe.isCanceled())return;K(ge)}Oe===!0?Pe():Promise.resolve(Oe).then(Pe)})}},[G,F]),T.useEffect(function(){return function(){se()}},[]),[ie,F]},Ki=function(G){var ee=Object(T.useRef)(),ae=Object(T.useRef)(G);ae.current=G;var Y=T.useCallback(function(j){ae.current(j)},[]);function F(j){j&&(j.removeEventListener(St,Y),j.removeEventListener(Qe,Y))}function K(j){ee.current&&ee.current!==j&&F(ee.current),j&&j!==ee.current&&(j.addEventListener(St,Y),j.addEventListener(Qe,Y),ee.current=j)}return T.useEffect(function(){return function(){F(ee.current)}},[]),[K,F]};function Gi(G,ee,ae,Y){var F=Y.motionEnter,K=F===void 0?!0:F,j=Y.motionAppear,V=j===void 0?!0:j,X=Y.motionLeave,se=X===void 0?!0:X,ie=Y.motionDeadline,ue=Y.motionLeaveImmediately,ge=Y.onAppearPrepare,Oe=Y.onEnterPrepare,xe=Y.onLeavePrepare,Pe=Y.onAppearStart,Ze=Y.onEnterStart,st=Y.onLeaveStart,nt=Y.onAppearActive,lt=Y.onEnterActive,ot=Y.onLeaveActive,rt=Y.onAppearEnd,at=Y.onEnterEnd,gt=Y.onLeaveEnd,ct=Y.onVisibleChanged,Lt=it(),bt=Object(N.a)(Lt,2),Je=bt[0],Xe=bt[1],ft=it($e),mt=Object(N.a)(ft,2),Ke=mt[0],vt=mt[1],At=it(null),_t=Object(N.a)(At,2),Tt=_t[0],Ct=_t[1],jt=Object(T.useRef)(!1),Gt=Object(T.useRef)(null),Pt=Object(T.useRef)(!1),zt=Object(T.useRef)(null);function Qt(){var It=ae();return It||zt.current}var Vt=Object(T.useRef)(!1);function Yt(It){var yt=Qt();if(It&&!It.deadline&&It.target!==yt)return;var Ht;Ke===Dt&&Vt.current?Ht=rt==null?void 0:rt(yt,It):Ke===Ot&&Vt.current?Ht=at==null?void 0:at(yt,It):Ke===kt&&Vt.current&&(Ht=gt==null?void 0:gt(yt,It)),Ht!==!1&&!Pt.current&&(vt($e),Ct(null))}var Mt=Ki(Yt),Kt=Object(N.a)(Mt,1),Bt=Kt[0],Ut=T.useMemo(function(){var It,yt,Ht;switch(Ke){case"appear":return It={},Object(le.a)(It,dt,ge),Object(le.a)(It,Wt,Pe),Object(le.a)(It,$t,nt),It;case"enter":return yt={},Object(le.a)(yt,dt,Oe),Object(le.a)(yt,Wt,Ze),Object(le.a)(yt,$t,lt),yt;case"leave":return Ht={},Object(le.a)(Ht,dt,xe),Object(le.a)(Ht,Wt,st),Object(le.a)(Ht,$t,ot),Ht;default:return{}}},[Ke]),en=Wi(Ke,function(It){if(It===dt){var yt=Ut[dt];return yt?yt(Qt()):Hn}if(Rt in Ut){var Ht;Ct(((Ht=Ut[Rt])===null||Ht===void 0?void 0:Ht.call(Ut,Qt(),null))||null)}return Rt===$t&&(Bt(Qt()),ie>0&&(clearTimeout(Gt.current),Gt.current=setTimeout(function(){Yt({deadline:!0})},ie))),Hi}),tn=Object(N.a)(en,2),rn=tn[0],Rt=tn[1],Zt=Wn(Rt);Vt.current=Zt,wt(function(){Xe(ee);var It=jt.current;if(jt.current=!0,!G)return;var yt;!It&&ee&&V&&(yt=Dt),It&&ee&&K&&(yt=Ot),(It&&!ee&&se||!It&&ue&&!ee&&se)&&(yt=kt),yt&&(vt(yt),rn())},[ee]),Object(T.useEffect)(function(){(Ke===Dt&&!V||Ke===Ot&&!K||Ke===kt&&!se)&&vt($e)},[V,K,se]),Object(T.useEffect)(function(){return function(){clearTimeout(Gt.current),Pt.current=!0}},[]),Object(T.useEffect)(function(){Je!==void 0&&Ke===$e&&(ct==null||ct(Je))},[Je,Ke]);var an=Tt;return Ut[dt]&&Rt===Wt&&(an=Object(L.a)({transition:"none"},an)),[Ke,Rt,an,Je!=null?Je:ee]}var zi=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(){return Object(y.a)(this,ae),ee.apply(this,arguments)}return Object(m.a)(ae,[{key:"render",value:function(){return this.props.children}}]),ae}(T.Component),Vi=zi;function Yi(G){var ee=G;Object(w.a)(G)==="object"&&(ee=G.transitionSupport);function ae(F){return!!(F.motionName&&ee)}var Y=T.forwardRef(function(F,K){var j=F.visible,V=j===void 0?!0:j,X=F.removeOnLeave,se=X===void 0?!0:X,ie=F.forceRender,ue=F.children,ge=F.motionName,Oe=F.leavedClassName,xe=F.eventProps,Pe=ae(F),Ze=Object(T.useRef)(),st=Object(T.useRef)();function nt(){try{return Object(ze.a)(Ze.current||st.current)}catch(vt){return null}}var lt=Gi(Pe,V,nt,F),ot=Object(N.a)(lt,4),rt=ot[0],at=ot[1],gt=ot[2],ct=ot[3],Lt=T.useRef(ct);ct&&(Lt.current=!0);var bt=Object(T.useRef)(K);bt.current=K;var Je=T.useCallback(function(vt){Ze.current=vt,Object(Fe.b)(bt.current,vt)},[]),Xe,ft=Object(L.a)(Object(L.a)({},xe),{},{visible:V});if(!ue)Xe=null;else if(rt===$e||!ae(F))ct?Xe=ue(Object(L.a)({},ft),Je):!se&&Lt.current?Xe=ue(Object(L.a)(Object(L.a)({},ft),{},{className:Oe}),Je):ie?Xe=ue(Object(L.a)(Object(L.a)({},ft),{},{style:{display:"none"}}),Je):Xe=null;else{var mt,Ke;at===dt?Ke="prepare":Wn(at)?Ke="active":at===Wt&&(Ke="start"),Xe=ue(Object(L.a)(Object(L.a)({},ft),{},{className:M()(ht(ge,rt),(mt={},Object(le.a)(mt,ht(ge,"".concat(rt,"-").concat(Ke)),Ke),Object(le.a)(mt,ge,typeof ge=="string"),mt)),style:gt}),Je)}return T.createElement(Vi,{ref:st},Xe)});return Y.displayName="CSSMotion",Y}var Kn=Yi(qe),On="add",Sn="keep",wn="remove",Gn="removed";function Xi(G){var ee;return G&&Object(w.a)(G)==="object"&&"key"in G?ee=G:ee={key:G},Object(L.a)(Object(L.a)({},ee),{},{key:String(ee.key)})}function Rn(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return G.map(Xi)}function $i(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ae=[],Y=0,F=ee.length,K=Rn(G),j=Rn(ee);K.forEach(function(se){for(var ie=!1,ue=Y;ue<F;ue+=1){var ge=j[ue];if(ge.key===se.key){Y<ue&&(ae=ae.concat(j.slice(Y,ue).map(function(Oe){return Object(L.a)(Object(L.a)({},Oe),{},{status:On})})),Y=ue),ae.push(Object(L.a)(Object(L.a)({},ge),{},{status:Sn})),Y+=1,ie=!0;break}}ie||ae.push(Object(L.a)(Object(L.a)({},se),{},{status:wn}))}),Y<F&&(ae=ae.concat(j.slice(Y).map(function(se){return Object(L.a)(Object(L.a)({},se),{},{status:On})})));var V={};ae.forEach(function(se){var ie=se.key;V[ie]=(V[ie]||0)+1});var X=Object.keys(V).filter(function(se){return V[se]>1});return X.forEach(function(se){ae=ae.filter(function(ie){var ue=ie.key,ge=ie.status;return ue!==se||ge!==wn}),ae.forEach(function(ie){ie.key===se&&(ie.status=Sn)})}),ae}var Ji=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Qi(G){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kn,ae=function(Y){Object(d.a)(K,Y);var F=Object(a.a)(K);function K(){var j;return Object(y.a)(this,K),j=F.apply(this,arguments),j.state={keyEntities:[]},j.removeKey=function(V){j.setState(function(X){var se=X.keyEntities;return{keyEntities:se.map(function(ie){return ie.key!==V?ie:Object(L.a)(Object(L.a)({},ie),{},{status:Gn})})}})},j}return Object(m.a)(K,[{key:"render",value:function(){var V=this,X=this.state.keyEntities,se=this.props,ie=se.component,ue=se.children,ge=se.onVisibleChanged,Oe=Object(O.a)(se,["component","children","onVisibleChanged"]),xe=ie||T.Fragment,Pe={};return Ji.forEach(function(Ze){Pe[Ze]=Oe[Ze],delete Oe[Ze]}),delete Oe.keys,T.createElement(xe,Oe,X.map(function(Ze){var st=Ze.status,nt=Object(O.a)(Ze,["status"]),lt=st===On||st===Sn;return T.createElement(ee,Object(p.a)({},Pe,{key:nt.key,visible:lt,eventProps:nt,onVisibleChanged:function(rt){ge==null||ge(rt,{key:nt.key}),rt||V.removeKey(nt.key)}}),ue)}))}}],[{key:"getDerivedStateFromProps",value:function(V,X){var se=V.keys,ie=X.keyEntities,ue=Rn(se),ge=$i(ie,ue);return{keyEntities:ge.filter(function(Oe){var xe=ie.find(function(Pe){var Ze=Pe.key;return Oe.key===Ze});return!(xe&&xe.status===Gn&&Oe.status===wn)})}}}]),K}(T.Component);return ae.defaultProps={component:"div"},ae}var ca=Qi(qe),yn=Kn;function zn(G){var ee=G.prefixCls,ae=G.motion,Y=G.animation,F=G.transitionName;return ae||(Y?{motionName:"".concat(ee,"-").concat(Y)}:F?{motionName:F}:null)}function Zi(G){var ee=G.prefixCls,ae=G.visible,Y=G.zIndex,F=G.mask,K=G.maskMotion,j=G.maskAnimation,V=G.maskTransitionName;if(!F)return null;var X={};return(K||V||j)&&(X=Object(L.a)({motionAppear:!0},zn({motion:K,prefixCls:ee,transitionName:V,animation:j}))),T.createElement(yn,Object(p.a)({},X,{visible:ae,removeOnLeave:!0}),function(se){var ie=se.className;return T.createElement("div",{style:{zIndex:Y},className:M()("".concat(ee,"-mask"),ie)})})}var qi=te("9mu1"),er=te("o0o1"),Vn=te.n(er),tr=te("HaE+"),Yn=["measure","align",null,"motion"],nr=function(G,ee){var ae=Object(T.useState)(null),Y=Object(N.a)(ae,2),F=Y[0],K=Y[1],j=Object(T.useRef)(),V=Object(T.useRef)(!1);function X(ue){V.current||K(ue)}function se(){Ne.a.cancel(j.current)}function ie(ue){se(),j.current=Object(Ne.a)(function(){X(function(ge){switch(F){case"align":return"motion";case"motion":return"stable";default:}return ge}),ue==null||ue()})}return Object(T.useEffect)(function(){X("measure")},[G]),Object(T.useEffect)(function(){switch(F){case"measure":ee();break;default:}F&&(j.current=Object(Ne.a)(Object(tr.a)(Vn.a.mark(function ue(){var ge,Oe;return Vn.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:ge=Yn.indexOf(F),Oe=Yn[ge+1],Oe&&ge!==-1&&X(Oe);case 3:case"end":return Pe.stop()}},ue)}))))},[F]),Object(T.useEffect)(function(){return function(){V.current=!0,se()}},[]),[F,ie]},ir=function(G){var ee=T.useState({width:0,height:0}),ae=Object(N.a)(ee,2),Y=ae[0],F=ae[1];function K(V){F({width:V.offsetWidth,height:V.offsetHeight})}var j=T.useMemo(function(){var V={};if(G){var X=Y.width,se=Y.height;G.indexOf("height")!==-1&&se?V.height=se:G.indexOf("minHeight")!==-1&&se&&(V.minHeight=se),G.indexOf("width")!==-1&&X?V.width=X:G.indexOf("minWidth")!==-1&&X&&(V.minWidth=X)}return V},[G,Y]);return[j,K]},Xn=T.forwardRef(function(G,ee){var ae=G.visible,Y=G.prefixCls,F=G.className,K=G.style,j=G.children,V=G.zIndex,X=G.stretch,se=G.destroyPopupOnHide,ie=G.forceRender,ue=G.align,ge=G.point,Oe=G.getRootDomNode,xe=G.getClassNameFromAlign,Pe=G.onAlign,Ze=G.onMouseEnter,st=G.onMouseLeave,nt=G.onMouseDown,lt=G.onTouchStart,ot=Object(T.useRef)(),rt=Object(T.useRef)(),at=Object(T.useState)(),gt=Object(N.a)(at,2),ct=gt[0],Lt=gt[1],bt=ir(X),Je=Object(N.a)(bt,2),Xe=Je[0],ft=Je[1];function mt(){X&&ft(Oe())}var Ke=nr(ae,mt),vt=Object(N.a)(Ke,2),At=vt[0],_t=vt[1],Tt=Object(T.useRef)();function Ct(){return ge||Oe}function jt(){var Mt;(Mt=ot.current)===null||Mt===void 0||Mt.forceAlign()}function Gt(Mt,Kt){var Bt=xe(Kt);ct!==Bt&&Lt(Bt),At==="align"&&(ct!==Bt?Promise.resolve().then(function(){jt()}):_t(function(){var Ut;(Ut=Tt.current)===null||Ut===void 0||Ut.call(Tt)}),Pe==null||Pe(Mt,Kt))}var Pt=Object(L.a)({},zn(G));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Mt){var Kt=Pt[Mt];Pt[Mt]=function(Bt,Ut){return _t(),Kt==null?void 0:Kt(Bt,Ut)}});function zt(){return new Promise(function(Mt){Tt.current=Mt})}T.useEffect(function(){!Pt.motionName&&At==="motion"&&_t()},[Pt.motionName,At]),T.useImperativeHandle(ee,function(){return{forceAlign:jt,getElement:function(){return rt.current}}});var Qt=Object(L.a)(Object(L.a)({},Xe),{},{zIndex:V,opacity:At==="motion"||At==="stable"||!ae?void 0:0,pointerEvents:At==="stable"?void 0:"none"},K),Vt=!0;(ue==null?void 0:ue.points)&&(At==="align"||At==="stable")&&(Vt=!1);var Yt=j;return T.Children.count(j)>1&&(Yt=T.createElement("div",{className:"".concat(Y,"-content")},j)),T.createElement(yn,Object(p.a)({visible:ae,ref:rt,leavedClassName:"".concat(Y,"-hidden")},Pt,{onAppearPrepare:zt,onEnterPrepare:zt,removeOnLeave:se,forceRender:ie}),function(Mt,Kt){var Bt=Mt.className,Ut=Mt.style,en=M()(Y,F,ct,Bt);return T.createElement(qi.a,{target:Ct(),key:"popup",ref:ot,monitorWindowResize:!0,disabled:Vt,align:ue,onAlign:Gt},T.createElement("div",{ref:Kt,className:en,onMouseEnter:Ze,onMouseLeave:st,onMouseDownCapture:nt,onTouchStartCapture:lt,style:Object(L.a)(Object(L.a)({},Ut),Qt)},Yt))})});Xn.displayName="PopupInner";var rr=Xn,$n=T.forwardRef(function(G,ee){var ae=G.prefixCls,Y=G.visible,F=G.zIndex,K=G.children,j=G.mobile;j=j===void 0?{}:j;var V=j.popupClassName,X=j.popupStyle,se=j.popupMotion,ie=se===void 0?{}:se,ue=j.popupRender,ge=T.useRef();T.useImperativeHandle(ee,function(){return{forceAlign:function(){},getElement:function(){return ge.current}}});var Oe=Object(L.a)({zIndex:F},X),xe=K;return T.Children.count(K)>1&&(xe=T.createElement("div",{className:"".concat(ae,"-content")},K)),ue&&(xe=ue(xe)),T.createElement(yn,Object(p.a)({visible:Y,ref:ge,removeOnLeave:!0},ie),function(Pe,Ze){var st=Pe.className,nt=Pe.style,lt=M()(ae,V,st);return T.createElement("div",{ref:Ze,className:lt,style:Object(L.a)(Object(L.a)({},nt),Oe)},xe)})});$n.displayName="MobilePopupInner";var ar=$n,sr=["visible","mobile"],Jn=T.forwardRef(function(G,ee){var ae=G.visible,Y=G.mobile,F=Object(O.a)(G,sr),K=Object(T.useState)(ae),j=Object(N.a)(K,2),V=j[0],X=j[1],se=Object(T.useState)(!1),ie=Object(N.a)(se,2),ue=ie[0],ge=ie[1],Oe=Object(L.a)(Object(L.a)({},F),{},{visible:V});Object(T.useEffect)(function(){X(ae),ae&&Y&&ge(re())},[ae,Y]);var xe=ue?T.createElement(ar,Object(p.a)({},Oe,{mobile:Y,ref:ee})):T.createElement(rr,Object(p.a)({},Oe,{ref:ee}));return T.createElement("div",null,T.createElement(Zi,Oe),xe)});Jn.displayName="Popup";var or=Jn,lr=T.createContext(null),Qn=lr;function An(){}function ur(){return""}function dr(G){return G?G.ownerDocument:window.document}var cr=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function hr(G){var ee=function(ae){Object(d.a)(F,ae);var Y=Object(a.a)(F);function F(K){var j;Object(y.a)(this,F),j=Y.call(this,K),j.popupRef=T.createRef(),j.triggerRef=T.createRef(),j.attachId=void 0,j.clickOutsideHandler=void 0,j.touchOutsideHandler=void 0,j.contextMenuOutsideHandler1=void 0,j.contextMenuOutsideHandler2=void 0,j.mouseDownTimeout=void 0,j.focusTime=void 0,j.preClickTime=void 0,j.preTouchTime=void 0,j.delayTimer=void 0,j.hasPopupMouseDown=void 0,j.onMouseEnter=function(X){var se=j.props.mouseEnterDelay;j.fireEvents("onMouseEnter",X),j.delaySetPopupVisible(!0,se,se?null:X)},j.onMouseMove=function(X){j.fireEvents("onMouseMove",X),j.setPoint(X)},j.onMouseLeave=function(X){j.fireEvents("onMouseLeave",X),j.delaySetPopupVisible(!1,j.props.mouseLeaveDelay)},j.onPopupMouseEnter=function(){j.clearDelayTimer()},j.onPopupMouseLeave=function(X){var se;if(X.relatedTarget&&!X.relatedTarget.setTimeout&&Object(Ve.a)((se=j.popupRef.current)===null||se===void 0?void 0:se.getElement(),X.relatedTarget))return;j.delaySetPopupVisible(!1,j.props.mouseLeaveDelay)},j.onFocus=function(X){j.fireEvents("onFocus",X),j.clearDelayTimer(),j.isFocusToShow()&&(j.focusTime=Date.now(),j.delaySetPopupVisible(!0,j.props.focusDelay))},j.onMouseDown=function(X){j.fireEvents("onMouseDown",X),j.preClickTime=Date.now()},j.onTouchStart=function(X){j.fireEvents("onTouchStart",X),j.preTouchTime=Date.now()},j.onBlur=function(X){j.fireEvents("onBlur",X),j.clearDelayTimer(),j.isBlurToHide()&&j.delaySetPopupVisible(!1,j.props.blurDelay)},j.onContextMenu=function(X){X.preventDefault(),j.fireEvents("onContextMenu",X),j.setPopupVisible(!0,X)},j.onContextMenuClose=function(){j.isContextMenuToShow()&&j.close()},j.onClick=function(X){if(j.fireEvents("onClick",X),j.focusTime){var se;if(j.preClickTime&&j.preTouchTime?se=Math.min(j.preClickTime,j.preTouchTime):j.preClickTime?se=j.preClickTime:j.preTouchTime&&(se=j.preTouchTime),Math.abs(se-j.focusTime)<20)return;j.focusTime=0}j.preClickTime=0,j.preTouchTime=0,j.isClickToShow()&&(j.isClickToHide()||j.isBlurToHide())&&X&&X.preventDefault&&X.preventDefault();var ie=!j.state.popupVisible;(j.isClickToHide()&&!ie||ie&&j.isClickToShow())&&j.setPopupVisible(!j.state.popupVisible,X)},j.onPopupMouseDown=function(){if(j.hasPopupMouseDown=!0,clearTimeout(j.mouseDownTimeout),j.mouseDownTimeout=window.setTimeout(function(){j.hasPopupMouseDown=!1},0),j.context){var X;(X=j.context).onPopupMouseDown.apply(X,arguments)}},j.onDocumentClick=function(X){if(j.props.mask&&!j.props.maskClosable)return;var se=X.target,ie=j.getRootDomNode(),ue=j.getPopupDomNode();(!Object(Ve.a)(ie,se)||j.isContextMenuOnly())&&!Object(Ve.a)(ue,se)&&!j.hasPopupMouseDown&&j.close()},j.getRootDomNode=function(){var X=j.props.getTriggerDOMNode;if(X)return X(j.triggerRef.current);try{var se=Object(ze.a)(j.triggerRef.current);if(se)return se}catch(ie){}return He.a.findDOMNode(Object(f.a)(j))},j.getPopupClassNameFromAlign=function(X){var se=[],ie=j.props,ue=ie.popupPlacement,ge=ie.builtinPlacements,Oe=ie.prefixCls,xe=ie.alignPoint,Pe=ie.getPopupClassNameFromAlign;return ue&&ge&&se.push(Le(ge,Oe,X,xe)),Pe&&se.push(Pe(X)),se.join(" ")},j.getComponent=function(){var X=j.props,se=X.prefixCls,ie=X.destroyPopupOnHide,ue=X.popupClassName,ge=X.onPopupAlign,Oe=X.popupMotion,xe=X.popupAnimation,Pe=X.popupTransitionName,Ze=X.popupStyle,st=X.mask,nt=X.maskAnimation,lt=X.maskTransitionName,ot=X.maskMotion,rt=X.zIndex,at=X.popup,gt=X.stretch,ct=X.alignPoint,Lt=X.mobile,bt=X.forceRender,Je=j.state,Xe=Je.popupVisible,ft=Je.point,mt=j.getPopupAlign(),Ke={};return j.isMouseEnterToShow()&&(Ke.onMouseEnter=j.onPopupMouseEnter),j.isMouseLeaveToHide()&&(Ke.onMouseLeave=j.onPopupMouseLeave),Ke.onMouseDown=j.onPopupMouseDown,Ke.onTouchStart=j.onPopupMouseDown,T.createElement(or,Object(p.a)({prefixCls:se,destroyPopupOnHide:ie,visible:Xe,point:ct&&ft,className:ue,align:mt,onAlign:ge,animation:xe,getClassNameFromAlign:j.getPopupClassNameFromAlign},Ke,{stretch:gt,getRootDomNode:j.getRootDomNode,style:Ze,mask:st,zIndex:rt,transitionName:Pe,maskAnimation:nt,maskTransitionName:lt,maskMotion:ot,ref:j.popupRef,motion:Oe,mobile:Lt,forceRender:bt}),typeof at=="function"?at():at)},j.attachParent=function(X){Ne.a.cancel(j.attachId);var se=j.props,ie=se.getPopupContainer,ue=se.getDocument,ge=j.getRootDomNode(),Oe;ie?(ge||ie.length===0)&&(Oe=ie(ge)):Oe=ue(j.getRootDomNode()).body,Oe?Oe.appendChild(X):j.attachId=Object(Ne.a)(function(){j.attachParent(X)})},j.getContainer=function(){var X=j.props.getDocument,se=X(j.getRootDomNode()).createElement("div");return se.style.position="absolute",se.style.top="0",se.style.left="0",se.style.width="100%",j.attachParent(se),se},j.setPoint=function(X){var se=j.props.alignPoint;if(!se||!X)return;j.setState({point:{pageX:X.pageX,pageY:X.pageY}})},j.handlePortalUpdate=function(){j.state.prevPopupVisible!==j.state.popupVisible&&j.props.afterPopupVisibleChange(j.state.popupVisible)},j.triggerContextValue={onPopupMouseDown:j.onPopupMouseDown};var V;return"popupVisible"in K?V=!!K.popupVisible:V=!!K.defaultPopupVisible,j.state={prevPopupVisible:V,popupVisible:V},cr.forEach(function(X){j["fire".concat(X)]=function(se){j.fireEvents(X,se)}}),j}return Object(m.a)(F,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var j=this.props,V=this.state;if(V.popupVisible){var X;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(X=j.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ce.a)(X,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(X=X||j.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ce.a)(X,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(X=X||j.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ce.a)(X,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ce.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ne.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var j;return((j=this.popupRef.current)===null||j===void 0?void 0:j.getElement())||null}},{key:"getPopupAlign",value:function(){var j=this.props,V=j.popupPlacement,X=j.popupAlign,se=j.builtinPlacements;return V&&se?me(se,V,X):X}},{key:"setPopupVisible",value:function(j,V){var X=this.props.alignPoint,se=this.state.popupVisible;this.clearDelayTimer(),se!==j&&("popupVisible"in this.props||this.setState({popupVisible:j,prevPopupVisible:se}),this.props.onPopupVisibleChange(j)),X&&V&&j&&this.setPoint(V)}},{key:"delaySetPopupVisible",value:function(j,V,X){var se=this,ie=V*1e3;if(this.clearDelayTimer(),ie){var ue=X?{pageX:X.pageX,pageY:X.pageY}:null;this.delayTimer=window.setTimeout(function(){se.setPopupVisible(j,ue),se.clearDelayTimer()},ie)}else this.setPopupVisible(j,X)}},{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(j){var V=this.props.children.props,X=this.props;return V[j]&&X[j]?this["fire".concat(j)]:V[j]||X[j]}},{key:"isClickToShow",value:function(){var j=this.props,V=j.action,X=j.showAction;return V.indexOf("click")!==-1||X.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var j=this.props.action;return j==="contextMenu"||j.length===1&&j[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var j=this.props,V=j.action,X=j.showAction;return V.indexOf("contextMenu")!==-1||X.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var j=this.props,V=j.action,X=j.hideAction;return V.indexOf("click")!==-1||X.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var j=this.props,V=j.action,X=j.showAction;return V.indexOf("hover")!==-1||X.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var j=this.props,V=j.action,X=j.hideAction;return V.indexOf("hover")!==-1||X.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var j=this.props,V=j.action,X=j.showAction;return V.indexOf("focus")!==-1||X.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var j=this.props,V=j.action,X=j.hideAction;return V.indexOf("focus")!==-1||X.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var j;(j=this.popupRef.current)===null||j===void 0||j.forceAlign()}}},{key:"fireEvents",value:function(j,V){var X=this.props.children.props[j];X&&X(V);var se=this.props[j];se&&se(V)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var j=this.state.popupVisible,V=this.props,X=V.children,se=V.forceRender,ie=V.alignPoint,ue=V.className,ge=V.autoDestroy,Oe=T.Children.only(X),xe={key:"trigger"};this.isContextMenuToShow()?xe.onContextMenu=this.onContextMenu:xe.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(xe.onClick=this.onClick,xe.onMouseDown=this.onMouseDown,xe.onTouchStart=this.onTouchStart):(xe.onClick=this.createTwoChains("onClick"),xe.onMouseDown=this.createTwoChains("onMouseDown"),xe.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(xe.onMouseEnter=this.onMouseEnter,ie&&(xe.onMouseMove=this.onMouseMove)):xe.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?xe.onMouseLeave=this.onMouseLeave:xe.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(xe.onFocus=this.onFocus,xe.onBlur=this.onBlur):(xe.onFocus=this.createTwoChains("onFocus"),xe.onBlur=this.createTwoChains("onBlur"));var Pe=M()(Oe&&Oe.props&&Oe.props.className,ue);Pe&&(xe.className=Pe);var Ze=Object(L.a)({},xe);Object(Fe.c)(Oe)&&(Ze.ref=Object(Fe.a)(this.triggerRef,Oe.ref));var st=T.cloneElement(Oe,Ze),nt;return(j||this.popupRef.current||se)&&(nt=T.createElement(G,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!j&&ge&&(nt=null),T.createElement(Qn.Provider,{value:this.triggerContextValue},st,nt)}}],[{key:"getDerivedStateFromProps",value:function(j,V){var X=j.popupVisible,se={};return X!==void 0&&V.popupVisible!==X&&(se.popupVisible=X,se.prevPopupVisible=V.popupVisible),se}}]),F}(T.Component);return ee.contextType=Qn,ee.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ur,getDocument:dr,onPopupVisibleChange:An,afterPopupVisibleChange:An,onPopupAlign:An,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},ee}var fr=hr(We.a),qt={adjustX:1,adjustY:1},Zn={topLeft:{points:["bl","tl"],overflow:qt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qt,offset:[4,0]}},pr={topLeft:{points:["bl","tl"],overflow:qt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qt,offset:[4,0]}},ha=Zn,qn=0,mr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},un=function(ee,ae,Y){var F=be(ae),K=ee.getState();ee.setState({defaultActiveFirst:Object(L.a)(Object(L.a)({},K.defaultActiveFirst),{},Object(le.a)({},F,Y))})},ei=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(Y){var F;Object(y.a)(this,ae),F=ee.call(this,Y),F.onDestroy=function(ie){F.props.onDestroy(ie)},F.onKeyDown=function(ie){var ue=ie.keyCode,ge=F.menuInstance,Oe=F.props.store,xe=F.getVisible();if(ue===u.a.ENTER)return F.onTitleClick(ie),un(Oe,F.props.eventKey,!0),!0;if(ue===u.a.RIGHT)return xe?ge.onKeyDown(ie):(F.triggerOpenChange(!0),un(Oe,F.props.eventKey,!0)),!0;if(ue===u.a.LEFT){var Pe;if(xe)Pe=ge.onKeyDown(ie);else return;return Pe||(F.triggerOpenChange(!1),Pe=!0),Pe}return xe&&(ue===u.a.UP||ue===u.a.DOWN)?ge.onKeyDown(ie):void 0},F.onOpenChange=function(ie){F.props.onOpenChange(ie)},F.onPopupVisibleChange=function(ie){F.triggerOpenChange(ie,ie?"mouseenter":"mouseleave")},F.onMouseEnter=function(ie){var ue=F.props,ge=ue.eventKey,Oe=ue.onMouseEnter,xe=ue.store;un(xe,F.props.eventKey,!1),Oe({key:ge,domEvent:ie})},F.onMouseLeave=function(ie){var ue=F.props,ge=ue.parentMenu,Oe=ue.eventKey,xe=ue.onMouseLeave;ge.subMenuInstance=Object(f.a)(F),xe({key:Oe,domEvent:ie})},F.onTitleMouseEnter=function(ie){var ue=F.props,ge=ue.eventKey,Oe=ue.onItemHover,xe=ue.onTitleMouseEnter;Oe({key:ge,hover:!0}),xe({key:ge,domEvent:ie})},F.onTitleMouseLeave=function(ie){var ue=F.props,ge=ue.parentMenu,Oe=ue.eventKey,xe=ue.onItemHover,Pe=ue.onTitleMouseLeave;ge.subMenuInstance=Object(f.a)(F),xe({key:Oe,hover:!1}),Pe({key:Oe,domEvent:ie})},F.onTitleClick=function(ie){var ue=Object(f.a)(F),ge=ue.props;if(ge.onTitleClick({key:ge.eventKey,domEvent:ie}),ge.triggerSubMenuAction==="hover")return;F.triggerOpenChange(!F.getVisible(),"click"),un(ge.store,F.props.eventKey,!1)},F.onSubMenuClick=function(ie){typeof F.props.onClick=="function"&&F.props.onClick(F.addKeyPath(ie))},F.onSelect=function(ie){F.props.onSelect(ie)},F.onDeselect=function(ie){F.props.onDeselect(ie)},F.getPrefixCls=function(){return"".concat(F.props.rootPrefixCls,"-submenu")},F.getActiveClassName=function(){return"".concat(F.getPrefixCls(),"-active")},F.getDisabledClassName=function(){return"".concat(F.getPrefixCls(),"-disabled")},F.getSelectedClassName=function(){return"".concat(F.getPrefixCls(),"-selected")},F.getOpenClassName=function(){return"".concat(F.props.rootPrefixCls,"-submenu-open")},F.getVisible=function(){return F.state.isOpen},F.getMode=function(){return F.state.mode},F.saveMenuInstance=function(ie){F.menuInstance=ie},F.addKeyPath=function(ie){return Object(L.a)(Object(L.a)({},ie),{},{keyPath:(ie.keyPath||[]).concat(F.props.eventKey)})},F.triggerOpenChange=function(ie,ue){var ge=F.props.eventKey,Oe=function(){F.onOpenChange({key:ge,item:Object(f.a)(F),trigger:ue,open:ie})};ue==="mouseenter"?F.mouseenterTimeout=setTimeout(function(){Oe()},0):Oe()},F.isChildrenSelected=function(){var ie={find:!1};return Ie(F.props.children,F.props.selectedKeys,ie),ie.find},F.isInlineMode=function(){return F.getMode()==="inline"},F.adjustWidth=function(){if(!F.subMenuTitle||!F.menuInstance)return;var ie=Be.findDOMNode(F.menuInstance);if(ie.offsetWidth>=F.subMenuTitle.offsetWidth)return;ie.style.minWidth="".concat(F.subMenuTitle.offsetWidth,"px")},F.saveSubMenuTitle=function(ie){F.subMenuTitle=ie},F.getBaseProps=function(){var ie=Object(f.a)(F),ue=ie.props,ge=F.getMode();return{mode:ge==="horizontal"?"vertical":ge,visible:F.getVisible(),level:ue.level+1,inlineIndent:ue.inlineIndent,focusable:!1,onClick:F.onSubMenuClick,onSelect:F.onSelect,onDeselect:F.onDeselect,onDestroy:F.onDestroy,selectedKeys:ue.selectedKeys,eventKey:"".concat(ue.eventKey,"-menu-"),openKeys:ue.openKeys,motion:ue.motion,onOpenChange:F.onOpenChange,subMenuOpenDelay:ue.subMenuOpenDelay,parentMenu:Object(f.a)(F),subMenuCloseDelay:ue.subMenuCloseDelay,forceSubMenuRender:ue.forceSubMenuRender,triggerSubMenuAction:ue.triggerSubMenuAction,builtinPlacements:ue.builtinPlacements,defaultActiveFirst:ue.store.getState().defaultActiveFirst[be(ue.eventKey)],multiple:ue.multiple,prefixCls:ue.rootPrefixCls,id:F.internalMenuId,manualRef:F.saveMenuInstance,itemIcon:ue.itemIcon,expandIcon:ue.expandIcon,direction:ue.direction}},F.getMotion=function(ie,ue){var ge=Object(f.a)(F),Oe=ge.haveRendered,xe=F.props,Pe=xe.motion,Ze=xe.rootPrefixCls,st=Object(L.a)(Object(L.a)({},Pe),{},{leavedClassName:"".concat(Ze,"-hidden"),removeOnLeave:!1,motionAppear:Oe||!ue||ie!=="inline"});return st};var K=Y.store,j=Y.eventKey,V=K.getState(),X=V.defaultActiveFirst;F.isRootMenu=!1;var se=!1;return X&&(se=X[j]),un(K,j,se),F.state={mode:Y.mode,isOpen:Y.isOpen},F}return Object(m.a)(ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var F=this,K=this.props,j=K.mode,V=K.parentMenu,X=K.manualRef,se=K.isOpen,ie=function(){F.setState({mode:j,isOpen:se})},ue=se!==this.state.isOpen,ge=j!==this.state.mode;if((ge||ue)&&(Ne.a.cancel(this.updateStateRaf),ge?this.updateStateRaf=Object(Ne.a)(ie):ie()),X&&X(this),j!=="horizontal"||!(V==null?void 0:V.isRootMenu)||!se)return;this.minWidthTimeout=setTimeout(function(){return F.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var F=this.props,K=F.onDestroy,j=F.eventKey;K&&K(j),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ne.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(F,K){var j=this.getBaseProps();return T.createElement(ai,Object(p.a)({},j,{id:this.internalMenuId,className:F,style:K}),this.props.children)}},{key:"renderChildren",value:function(){var F=this,K=this.getBaseProps(),j=K.mode,V=K.visible,X=K.forceSubMenuRender,se=K.direction,ie=this.getMotion(j,V);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||V||X,!this.haveOpened)return T.createElement("div",null);var ue=M()("".concat(K.prefixCls,"-sub"),Object(le.a)({},"".concat(K.prefixCls,"-rtl"),se==="rtl"));return this.isInlineMode()?T.createElement(yn,Object(p.a)({visible:K.visible,forceRender:X},ie),function(ge){var Oe=ge.className,xe=ge.style,Pe=M()(ue,Oe);return F.renderPopupMenu(Pe,xe)}):this.renderPopupMenu(ue)}},{key:"render",value:function(){var F,K,j,V=Object(L.a)({},this.props),X=this.getVisible(),se=this.getPrefixCls(),ie=this.isInlineMode(),ue=this.getMode(),ge=M()(se,"".concat(se,"-").concat(ue),(F={},Object(le.a)(F,V.className,!!V.className),Object(le.a)(F,this.getOpenClassName(),X),Object(le.a)(F,this.getActiveClassName(),V.active||X&&!ie),Object(le.a)(F,this.getDisabledClassName(),V.disabled),Object(le.a)(F,this.getSelectedClassName(),this.isChildrenSelected()),F));this.internalMenuId||(V.eventKey?this.internalMenuId="".concat(V.eventKey,"$Menu"):(qn+=1,this.internalMenuId="$__$".concat(qn,"$Menu")));var Oe={},xe={},Pe={};V.disabled||(Oe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},xe={onClick:this.onTitleClick},Pe={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ze={},st=V.direction,nt=st==="rtl";ie&&(nt?Ze.paddingRight=V.inlineIndent*V.level:Ze.paddingLeft=V.inlineIndent*V.level);var lt={};this.getVisible()&&(lt={"aria-owns":this.internalMenuId});var ot=null;ue!=="horizontal"&&(ot=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ot=T.createElement(this.props.expandIcon,Object(L.a)({},this.props))));var rt=T.createElement("div",Object(p.a)({ref:this.saveSubMenuTitle,style:Ze,className:"".concat(se,"-title"),role:"button"},Pe,xe,{"aria-expanded":X},lt,{"aria-haspopup":"true",title:typeof V.title=="string"?V.title:void 0}),V.title,ot||T.createElement("i",{className:"".concat(se,"-arrow")})),at=this.renderChildren(),gt=((K=V.parentMenu)===null||K===void 0?void 0:K.isRootMenu)?V.parentMenu.props.getPopupContainer:function(Ct){return Ct.parentNode},ct=mr[ue],Lt=V.popupOffset?{offset:V.popupOffset}:{},bt=M()((j={},Object(le.a)(j,V.popupClassName,V.popupClassName&&!ie),Object(le.a)(j,"".concat(se,"-rtl"),nt),j)),Je=V.disabled,Xe=V.triggerSubMenuAction,ft=V.subMenuOpenDelay,mt=V.forceSubMenuRender,Ke=V.subMenuCloseDelay,vt=V.builtinPlacements;Me.forEach(function(Ct){return delete V[Ct]}),delete V.onClick;var At=nt?Object(L.a)(Object(L.a)({},pr),vt):Object(L.a)(Object(L.a)({},Zn),vt);delete V.direction;var _t=this.getBaseProps(),Tt=ie?null:this.getMotion(_t.mode,_t.visible);return T.createElement("li",Object(p.a)({},V,Oe,{className:ge,role:"menuitem"}),T.createElement(fr,{prefixCls:se,popupClassName:M()("".concat(se,"-popup"),bt),getPopupContainer:gt,builtinPlacements:At,popupPlacement:ct,popupVisible:ie?!1:X,popupAlign:Lt,popup:ie?null:at,action:Je||ie?[]:[Xe],mouseEnterDelay:ft,mouseLeaveDelay:Ke,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:mt,popupMotion:Tt},rt),ie?at:null)}}]),ae}(T.Component);ei.defaultProps={onMouseEnter:Re,onMouseLeave:Re,onTitleMouseEnter:Re,onTitleMouseLeave:Re,onTitleClick:Re,manualRef:Re,mode:"vertical",title:""};var ti=Object(o.b)(function(G,ee){var ae=G.openKeys,Y=G.activeKey,F=G.selectedKeys,K=ee.eventKey,j=ee.subMenuKey;return{isOpen:ae.indexOf(K)>-1,active:Y[j]===K,selectedKeys:F}})(ei);ti.isSubMenu=!0;var gr=ti,ni="menuitem-overflowed",vr=.5,ii=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(){var Y;return Object(y.a)(this,ae),Y=ee.apply(this,arguments),Y.resizeObserver=null,Y.mutationObserver=null,Y.originalTotalWidth=0,Y.overflowedItems=[],Y.menuItemSizes=[],Y.cancelFrameId=null,Y.state={lastVisibleIndex:void 0},Y.childRef=T.createRef(),Y.getMenuItemNodes=function(){var F=Y.props.prefixCls,K=Y.childRef.current;return K?[].slice.call(K.children).filter(function(j){return j.className.split(" ").indexOf("".concat(F,"-overflowed-submenu"))<0}):[]},Y.getOverflowedSubMenuItem=function(F,K,j){var V=Y.props,X=V.overflowedIndicator,se=V.level,ie=V.mode,ue=V.prefixCls,ge=V.theme;if(se!==1||ie!=="horizontal")return null;var Oe=Y.props.children[0],xe=Oe.props,Pe=xe.children,Ze=xe.title,st=xe.style,nt=Object(O.a)(xe,["children","title","style"]),lt=Object(L.a)({},st),ot="".concat(F,"-overflowed-indicator"),rt="".concat(F,"-overflowed-indicator");K.length===0&&j!==!0?lt=Object(L.a)(Object(L.a)({},lt),{},{display:"none"}):j&&(lt=Object(L.a)(Object(L.a)({},lt),{},{visibility:"hidden",position:"absolute"}),ot="".concat(ot,"-placeholder"),rt="".concat(rt,"-placeholder"));var at=ge?"".concat(ue,"-").concat(ge):"",gt={};return Me.forEach(function(ct){nt[ct]!==void 0&&(gt[ct]=nt[ct])}),T.createElement(gr,Object(p.a)({title:X,className:"".concat(ue,"-overflowed-submenu"),popupClassName:at},gt,{key:ot,eventKey:rt,disabled:!1,style:lt}),K)},Y.setChildrenWidthAndResize=function(){if(Y.props.mode!=="horizontal")return;var F=Y.childRef.current;if(!F)return;var K=F.children;if(!K||K.length===0)return;var j=F.children[K.length-1];Te(j,"display","inline-block");var V=Y.getMenuItemNodes(),X=V.filter(function(se){return se.className.split(" ").indexOf(ni)>=0});X.forEach(function(se){Te(se,"display","inline-block")}),Y.menuItemSizes=V.map(function(se){return De(se,!0)}),X.forEach(function(se){Te(se,"display","none")}),Y.overflowedIndicatorWidth=De(F.children[F.children.length-1],!0),Y.originalTotalWidth=Y.menuItemSizes.reduce(function(se,ie){return se+ie},0),Y.handleResize(),Te(j,"display","none")},Y.handleResize=function(){if(Y.props.mode!=="horizontal")return;var F=Y.childRef.current;if(!F)return;var K=De(F);Y.overflowedItems=[];var j=0,V;Y.originalTotalWidth>K+vr&&(V=-1,Y.menuItemSizes.forEach(function(X){j+=X,j+Y.overflowedIndicatorWidth<=K&&(V+=1)})),Y.setState({lastVisibleIndex:V})},Y}return Object(m.a)(ae,[{key:"componentDidMount",value:function(){var F=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var K=this.childRef.current;if(!K)return;this.resizeObserver=new Ge.default(function(j){j.forEach(function(){var V=F.cancelFrameId;cancelAnimationFrame(V),F.cancelFrameId=requestAnimationFrame(F.setChildrenWidthAndResize)})}),[].slice.call(K.children).concat(K).forEach(function(j){F.resizeObserver.observe(j)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){F.resizeObserver.disconnect(),[].slice.call(K.children).concat(K).forEach(function(j){F.resizeObserver.observe(j)}),F.setChildrenWidthAndResize()}),this.mutationObserver.observe(K,{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(F){var K=this,j=this.state.lastVisibleIndex;return(F||[]).reduce(function(V,X,se){var ie=X;if(K.props.mode==="horizontal"){var ue=K.getOverflowedSubMenuItem(X.props.eventKey,[]);j!==void 0&&K.props.className.indexOf("".concat(K.props.prefixCls,"-root"))!==-1&&(se>j&&(ie=T.cloneElement(X,{style:{display:"none"},eventKey:"".concat(X.props.eventKey,"-hidden"),className:"".concat(ni)})),se===j+1&&(K.overflowedItems=F.slice(j+1).map(function(Oe){return T.cloneElement(Oe,{key:Oe.props.eventKey,mode:"vertical-left"})}),ue=K.getOverflowedSubMenuItem(X.props.eventKey,K.overflowedItems)));var ge=[].concat(Object(x.a)(V),[ue,ie]);return se===F.length-1&&ge.push(K.getOverflowedSubMenuItem(X.props.eventKey,[],!0)),ge}return[].concat(Object(x.a)(V),[ie])},[])}},{key:"render",value:function(){var F=this.props,K=F.visible,j=F.prefixCls,V=F.overflowedIndicator,X=F.mode,se=F.level,ie=F.tag,ue=F.children,ge=F.theme,Oe=Object(O.a)(F,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),xe=ie;return T.createElement(xe,Object(p.a)({ref:this.childRef},Oe),this.renderChildren(ue))}}]),ae}(T.Component);ii.defaultProps={tag:"div",className:""};var _r=ii;function yr(G){return G.length?G.every(function(ee){return!!ee.props.disabled}):!0}function bn(G,ee,ae){var Y=G.getState();G.setState({activeKey:Object(L.a)(Object(L.a)({},Y.activeKey),{},Object(le.a)({},ee,ae))})}function sn(G){return G.eventKey||"0-menu-"}function En(G,ee){var ae=ee,Y=G.children,F=G.eventKey;if(ae){var K;if(Se(Y,function(j,V){j&&j.props&&!j.props.disabled&&ae===Ue(j,F,V)&&(K=!0)}),K)return ae}return ae=null,G.defaultActiveFirst&&Se(Y,function(j,V){!ae&&j&&!j.props.disabled&&(ae=Ue(j,F,V))}),ae}function br(G){if(!G)return;var ee=this.instanceArray.indexOf(G);ee!==-1?this.instanceArray[ee]=G:this.instanceArray.push(G)}var ri=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(Y){var F;return Object(y.a)(this,ae),F=ee.call(this,Y),F.onKeyDown=function(K,j){var V=K.keyCode,X;if(F.getFlatInstanceArray().forEach(function(ie){ie&&ie.props.active&&ie.onKeyDown&&(X=ie.onKeyDown(K))}),X)return 1;var se=null;return(V===u.a.UP||V===u.a.DOWN)&&(se=F.step(V===u.a.UP?-1:1)),se?(K.preventDefault(),bn(F.props.store,sn(F.props),se.props.eventKey),typeof j=="function"&&j(se),1):void 0},F.onItemHover=function(K){var j=K.key,V=K.hover;bn(F.props.store,sn(F.props),V?j:null)},F.onDeselect=function(K){F.props.onDeselect(K)},F.onSelect=function(K){F.props.onSelect(K)},F.onClick=function(K){F.props.onClick(K)},F.onOpenChange=function(K){F.props.onOpenChange(K)},F.onDestroy=function(K){F.props.onDestroy(K)},F.getFlatInstanceArray=function(){return F.instanceArray},F.step=function(K){var j=F.getFlatInstanceArray(),V=F.props.store.getState().activeKey[sn(F.props)],X=j.length;if(!X)return null;K<0&&(j=j.concat().reverse());var se=-1;if(j.every(function(Oe,xe){return Oe&&Oe.props.eventKey===V?(se=xe,!1):!0}),!F.props.defaultActiveFirst&&se!==-1&&yr(j.slice(se,X-1)))return;var ie=(se+1)%X,ue=ie;do{var ge=j[ue];if(!ge||ge.props.disabled)ue=(ue+1)%X;else return ge}while(ue!==ie);return null},F.renderCommonMenuItem=function(K,j,V){var X=F.props.store.getState(),se=Object(f.a)(F),ie=se.props,ue=Ue(K,ie.eventKey,j),ge=K.props;if(!ge||typeof K.type=="string")return K;var Oe=ue===X.activeKey,xe=Object(L.a)(Object(L.a)({mode:ge.mode||ie.mode,level:ie.level,inlineIndent:ie.inlineIndent,renderMenuItem:F.renderMenuItem,rootPrefixCls:ie.prefixCls,index:j,parentMenu:ie.parentMenu,manualRef:ge.disabled?void 0:Object(h.a)(K.ref,br.bind(Object(f.a)(F))),eventKey:ue,active:!ge.disabled&&Oe,multiple:ie.multiple,onClick:function(Ze){(ge.onClick||Re)(Ze),F.onClick(Ze)},onItemHover:F.onItemHover,motion:ie.motion,subMenuOpenDelay:ie.subMenuOpenDelay,subMenuCloseDelay:ie.subMenuCloseDelay,forceSubMenuRender:ie.forceSubMenuRender,onOpenChange:F.onOpenChange,onDeselect:F.onDeselect,onSelect:F.onSelect,builtinPlacements:ie.builtinPlacements,itemIcon:ge.itemIcon||F.props.itemIcon,expandIcon:ge.expandIcon||F.props.expandIcon},V),{},{direction:ie.direction});return(ie.mode==="inline"||ye())&&(xe.triggerSubMenuAction="click"),T.cloneElement(K,Object(L.a)(Object(L.a)({},xe),{},{key:ue||j}))},F.renderMenuItem=function(K,j,V){if(!K)return null;var X=F.props.store.getState(),se={openKeys:X.openKeys,selectedKeys:X.selectedKeys,triggerSubMenuAction:F.props.triggerSubMenuAction,subMenuKey:V};return F.renderCommonMenuItem(K,j,se)},Y.store.setState({activeKey:Object(L.a)(Object(L.a)({},Y.store.getState().activeKey),{},Object(le.a)({},Y.eventKey,En(Y,Y.activeKey)))}),F.instanceArray=[],F}return Object(m.a)(ae,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(F){return this.props.visible||F.visible||this.props.className!==F.className||!R()(this.props.style,F.style)}},{key:"componentDidUpdate",value:function(F){var K=this.props,j="activeKey"in K?K.activeKey:K.store.getState().activeKey[sn(K)],V=En(K,j);if(V!==j)bn(K.store,sn(K),V);else if("activeKey"in F){var X=En(F,F.activeKey);V!==X&&bn(K.store,sn(K),V)}}},{key:"render",value:function(){var F=this,K=Object(p.a)({},this.props);this.instanceArray=[];var j=M()(K.prefixCls,K.className,"".concat(K.prefixCls,"-").concat(K.mode)),V={className:j,role:K.role||"menu"};K.id&&(V.id=K.id),K.focusable&&(V.tabIndex=0,V.onKeyDown=this.onKeyDown);var X=K.prefixCls,se=K.eventKey,ie=K.visible,ue=K.level,ge=K.mode,Oe=K.overflowedIndicator,xe=K.theme;return Me.forEach(function(Pe){return delete K[Pe]}),delete K.onClick,T.createElement(_r,Object(p.a)({},K,{prefixCls:X,mode:ge,tag:"ul",level:ue,theme:xe,visible:ie,overflowedIndicator:Oe},V),Object(C.a)(K.children).map(function(Pe,Ze){return F.renderMenuItem(Pe,Ze,se||"0-menu-")}))}}]),ae}(T.Component);ri.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Re};var Er=Object(o.b)()(ri),ai=Er,Tr=te("Kwbf");function xr(G,ee,ae){var Y=G.prefixCls,F=G.motion,K=G.defaultMotions,j=K===void 0?{}:K,V=G.openAnimation,X=G.openTransitionName,se=ee.switchingModeFromInline;if(F)return F;if(Object(w.a)(V)==="object"&&V)Object(Tr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof V=="string")return{motionName:"".concat(Y,"-open-").concat(V)};if(X)return{motionName:X};var ie=j[ae];return ie||(se?null:j.other)}var si=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(Y){var F;Object(y.a)(this,ae),F=ee.call(this,Y),F.onSelect=function(V){var X=Object(f.a)(F),se=X.props;if(se.selectable){var ie=F.store.getState(),ue=ie.selectedKeys,ge=V.key;se.multiple?ue=ue.concat([ge]):ue=[ge],"selectedKeys"in se||F.store.setState({selectedKeys:ue}),se.onSelect(Object(L.a)(Object(L.a)({},V),{},{selectedKeys:ue}))}},F.onClick=function(V){var X=F.getRealMenuMode(),se=Object(f.a)(F),ie=se.store,ue=se.props.onOpenChange;X!=="inline"&&!("openKeys"in F.props)&&(ie.setState({openKeys:[]}),ue([])),F.props.onClick(V)},F.onKeyDown=function(V,X){F.innerMenu.getWrappedInstance().onKeyDown(V,X)},F.onOpenChange=function(V){var X=Object(f.a)(F),se=X.props,ie=F.store.getState().openKeys.concat(),ue=!1,ge=function(xe){var Pe=!1;if(xe.open)Pe=ie.indexOf(xe.key)===-1,Pe&&ie.push(xe.key);else{var Ze=ie.indexOf(xe.key);Pe=Ze!==-1,Pe&&ie.splice(Ze,1)}ue=ue||Pe};Array.isArray(V)?V.forEach(ge):ge(V),ue&&("openKeys"in F.props||F.store.setState({openKeys:ie}),se.onOpenChange(ie))},F.onDeselect=function(V){var X=Object(f.a)(F),se=X.props;if(se.selectable){var ie=F.store.getState().selectedKeys.concat(),ue=V.key,ge=ie.indexOf(ue);ge!==-1&&ie.splice(ge,1),"selectedKeys"in se||F.store.setState({selectedKeys:ie}),se.onDeselect(Object(L.a)(Object(L.a)({},V),{},{selectedKeys:ie}))}},F.onMouseEnter=function(V){F.restoreModeVerticalFromInline();var X=F.props.onMouseEnter;X&&X(V)},F.onTransitionEnd=function(V){var X=V.propertyName==="width"&&V.target===V.currentTarget,se=V.target.className,ie=Object.prototype.toString.call(se)==="[object SVGAnimatedString]"?se.animVal:se,ue=V.propertyName==="font-size"&&ie.indexOf("anticon")>=0;(X||ue)&&F.restoreModeVerticalFromInline()},F.setInnerMenu=function(V){F.innerMenu=V},F.isRootMenu=!0;var K=Y.defaultSelectedKeys,j=Y.defaultOpenKeys;return"selectedKeys"in Y&&(K=Y.selectedKeys||[]),"openKeys"in Y&&(j=Y.openKeys||[]),F.store=Object(o.c)({selectedKeys:K,openKeys:j,activeKey:{"0-menu-":En(Y,Y.activeKey)}}),F.state={switchingModeFromInline:!1,prevProps:Y,inlineOpenKeys:[],store:F.store},F}return Object(m.a)(ae,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(F){var K=this.props,j=K.siderCollapsed,V=K.inlineCollapsed,X=K.onOpenChange;(!F.inlineCollapsed&&V||!F.siderCollapsed&&j)&&X([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var F=this.props.collapsedWidth,K=this.store,j=this.prevOpenKeys,V=this.getInlineCollapsed()&&(F===0||F==="0"||F==="0px");V?(this.prevOpenKeys=K.getState().openKeys.concat(),this.store.setState({openKeys:[]})):j&&(this.store.setState({openKeys:j}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var F=this.props.mode,K=this.state.switchingModeFromInline,j=this.getInlineCollapsed();return K&&j?"inline":j?"vertical":F}},{key:"getInlineCollapsed",value:function(){var F=this.props,K=F.inlineCollapsed,j=F.siderCollapsed;return j!==void 0?j:K}},{key:"restoreModeVerticalFromInline",value:function(){var F=this.state.switchingModeFromInline;F&&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 F=Object(L.a)({},Object(c.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),K=this.getRealMenuMode();return F.className+=" ".concat(F.prefixCls,"-root"),F.direction==="rtl"&&(F.className+=" ".concat(F.prefixCls,"-rtl")),F=Object(L.a)(Object(L.a)({},F),{},{mode:K,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:xr(this.props,this.state,K)}),delete F.openAnimation,delete F.openTransitionName,T.createElement(o.a,{store:this.store},T.createElement(ai,Object(p.a)({},F,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(F,K){var j=K.prevProps,V=K.store,X=V.getState(),se={},ie={prevProps:F};return j.mode==="inline"&&F.mode!=="inline"&&(ie.switchingModeFromInline=!0),"openKeys"in F?se.openKeys=F.openKeys||[]:((F.inlineCollapsed&&!j.inlineCollapsed||F.siderCollapsed&&!j.siderCollapsed)&&(ie.switchingModeFromInline=!0,ie.inlineOpenKeys=X.openKeys,se.openKeys=[]),(!F.inlineCollapsed&&j.inlineCollapsed||!F.siderCollapsed&&j.siderCollapsed)&&(se.openKeys=K.inlineOpenKeys,ie.inlineOpenKeys=[])),Object.keys(se).length&&V.setState(se),ie}}]),ae}(T.Component);si.defaultProps={selectable:!0,onClick:Re,onSelect:Re,onOpenChange:Re,onDeselect:Re,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Or=si,In=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(){var Y;return Object(y.a)(this,ae),Y=ee.apply(this,arguments),Y.onKeyDown=function(F){var K=F.keyCode;return K===u.a.ENTER?(Y.onClick(F),!0):void 0},Y.onMouseLeave=function(F){var K=Y.props,j=K.eventKey,V=K.onItemHover,X=K.onMouseLeave;V({key:j,hover:!1}),X({key:j,domEvent:F})},Y.onMouseEnter=function(F){var K=Y.props,j=K.eventKey,V=K.onItemHover,X=K.onMouseEnter;V({key:j,hover:!0}),X({key:j,domEvent:F})},Y.onClick=function(F){var K=Y.props,j=K.eventKey,V=K.multiple,X=K.onClick,se=K.onSelect,ie=K.onDeselect,ue=K.isSelected,ge={key:j,keyPath:[j],item:Object(f.a)(Y),domEvent:F};X(ge),V?ue?ie(ge):se(ge):ue||se(ge)},Y.saveNode=function(F){Y.node=F},Y}return Object(m.a)(ae,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var F=this.props;F.onDestroy&&F.onDestroy(F.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 F,K=Object(L.a)({},this.props),j=M()(this.getPrefixCls(),K.className,(F={},Object(le.a)(F,this.getActiveClassName(),!K.disabled&&K.active),Object(le.a)(F,this.getSelectedClassName(),K.isSelected),Object(le.a)(F,this.getDisabledClassName(),K.disabled),F)),V=Object(L.a)(Object(L.a)({},K.attribute),{},{title:typeof K.title=="string"?K.title:void 0,className:j,role:K.role||"menuitem","aria-disabled":K.disabled});K.role==="option"?V=Object(L.a)(Object(L.a)({},V),{},{role:"option","aria-selected":K.isSelected}):(K.role===null||K.role==="none")&&(V.role="none");var X={onClick:K.disabled?null:this.onClick,onMouseLeave:K.disabled?null:this.onMouseLeave,onMouseEnter:K.disabled?null:this.onMouseEnter},se=Object(L.a)({},K.style);K.mode==="inline"&&(K.direction==="rtl"?se.paddingRight=K.inlineIndent*K.level:se.paddingLeft=K.inlineIndent*K.level),Me.forEach(function(ue){return delete K[ue]}),delete K.direction;var ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ie=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object(p.a)({},Object(c.a)(K,["onClick","onMouseEnter","onMouseLeave","onSelect"]),V,X,{style:se,ref:this.saveNode}),K.children,ie)}}]),ae}(T.Component);In.isMenuItem=!0,In.defaultProps={onSelect:Re,onMouseEnter:Re,onMouseLeave:Re,manualRef:Re};var Sr=Object(o.b)(function(G,ee){var ae=G.activeKey,Y=G.selectedKeys,F=ee.eventKey,K=ee.subMenuKey;return{active:ae[K]===F,isSelected:Array.isArray(Y)?Y.indexOf(F)!==-1:Y===F}})(In),wr=Sr,Cn=function(G){Object(d.a)(ae,G);var ee=Object(a.a)(ae);function ae(){var Y;return Object(y.a)(this,ae),Y=ee.apply(this,arguments),Y.renderInnerMenuItem=function(F){var K=Y.props,j=K.renderMenuItem,V=K.index;return j(F,V,Y.props.subMenuKey)},Y}return Object(m.a)(ae,[{key:"render",value:function(){var F=Object(p.a)({},this.props),K=F.className,j=K===void 0?"":K,V=F.rootPrefixCls,X="".concat(V,"-item-group-title"),se="".concat(V,"-item-group-list"),ie=F.title,ue=F.children;return Me.forEach(function(ge){return delete F[ge]}),delete F.direction,T.createElement("li",Object(p.a)({},F,{onClick:function(Oe){return Oe.stopPropagation()},className:"".concat(j," ").concat(V,"-item-group")}),T.createElement("div",{className:X,title:typeof ie=="string"?ie:void 0},ie),T.createElement("ul",{className:se},T.Children.map(ue,this.renderInnerMenuItem)))}}]),ae}(T.Component);Cn.isMenuItemGroup=!0,Cn.defaultProps={disabled:!0};var fa=Cn,oi=function(ee){var ae=ee.className,Y=ee.rootPrefixCls,F=ee.style;return T.createElement("li",{className:"".concat(ae," ").concat(Y,"-item-divider"),style:F})};oi.defaultProps={disabled:!0,className:"",style:{}};var pa=oi,Rr=Or,Ar=te("eDIo");function Ir(G,ee){var ae=G.prefixCls,Y=G.editable,F=G.locale,K=G.style;return!Y||Y.showAdd===!1?null:T.createElement("button",{ref:ee,type:"button",className:"".concat(ae,"-nav-add"),style:K,"aria-label":(F==null?void 0:F.addAriaLabel)||"Add tab",onClick:function(V){Y.onEdit("add",{event:V})}},Y.addIcon||"+")}var li=T.forwardRef(Ir);function Cr(G,ee){var ae=G.prefixCls,Y=G.id,F=G.tabs,K=G.locale,j=G.mobile,V=G.moreIcon,X=V===void 0?"More":V,se=G.moreTransitionName,ie=G.style,ue=G.className,ge=G.editable,Oe=G.tabBarGutter,xe=G.rtl,Pe=G.onTabClick,Ze=Object(T.useState)(!1),st=Object(N.a)(Ze,2),nt=st[0],lt=st[1],ot=Object(T.useState)(null),rt=Object(N.a)(ot,2),at=rt[0],gt=rt[1],ct="".concat(Y,"-more-popup"),Lt="".concat(ae,"-dropdown"),bt=at!==null?"".concat(ct,"-").concat(at):null,Je=K==null?void 0:K.dropdownAriaLabel,Xe=T.createElement(Rr,{onClick:function(Tt){var Ct=Tt.key,jt=Tt.domEvent;Pe(Ct,jt),lt(!1)},id:ct,tabIndex:-1,role:"listbox","aria-activedescendant":bt,selectedKeys:[at],"aria-label":Je!==void 0?Je:"expanded dropdown"},F.map(function(_t){return T.createElement(wr,{key:_t.key,id:"".concat(ct,"-").concat(_t.key),role:"option","aria-controls":Y&&"".concat(Y,"-panel-").concat(_t.key),disabled:_t.disabled},_t.tab)}));function ft(_t){for(var Tt=F.filter(function(zt){return!zt.disabled}),Ct=Tt.findIndex(function(zt){return zt.key===at})||0,jt=Tt.length,Gt=0;Gt<jt;Gt+=1){Ct=(Ct+_t+jt)%jt;var Pt=Tt[Ct];if(!Pt.disabled){gt(Pt.key);return}}}function mt(_t){var Tt=_t.which;if(!nt){[u.a.DOWN,u.a.SPACE,u.a.ENTER].includes(Tt)&&(lt(!0),_t.preventDefault());return}switch(Tt){case u.a.UP:ft(-1),_t.preventDefault();break;case u.a.DOWN:ft(1),_t.preventDefault();break;case u.a.ESC:lt(!1);break;case u.a.SPACE:case u.a.ENTER:at!==null&&Pe(at,_t);break}}Object(T.useEffect)(function(){var _t=document.getElementById(bt);_t&&_t.scrollIntoView&&_t.scrollIntoView(!1)},[at]),Object(T.useEffect)(function(){nt||gt(null)},[nt]);var Ke=Object(le.a)({},xe?"marginLeft":"marginRight",Oe);F.length||(Ke.visibility="hidden",Ke.order=1);var vt=M()(Object(le.a)({},"".concat(Lt,"-rtl"),xe)),At=j?null:T.createElement(Ar.a,{prefixCls:Lt,overlay:Xe,trigger:["hover"],visible:nt,transitionName:se,onVisibleChange:lt,overlayClassName:vt,mouseEnterDelay:.1,mouseLeaveDelay:.1},T.createElement("button",{type:"button",className:"".concat(ae,"-nav-more"),style:Ke,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":ct,id:"".concat(Y,"-more"),"aria-expanded":nt,onKeyDown:mt},X));return T.createElement("div",{className:M()("".concat(ae,"-nav-operations"),ue),style:ie,ref:ee},At,T.createElement(li,{prefixCls:ae,locale:K,editable:ge}))}var Lr=T.forwardRef(Cr),Ln=Object(T.createContext)(null),Dr=.1,ui=.01,Tn=20,di=Math.pow(.995,Tn);function Pr(){var G=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(G)||/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(G.substr(0,4)))}function Mr(G,ee){var ae=Object(T.useState)(),Y=Object(N.a)(ae,2),F=Y[0],K=Y[1],j=Object(T.useState)(0),V=Object(N.a)(j,2),X=V[0],se=V[1],ie=Object(T.useState)(0),ue=Object(N.a)(ie,2),ge=ue[0],Oe=ue[1],xe=Object(T.useState)(),Pe=Object(N.a)(xe,2),Ze=Pe[0],st=Pe[1],nt=Object(T.useRef)();function lt(Je){var Xe=Je.touches[0],ft=Xe.screenX,mt=Xe.screenY;K({x:ft,y:mt}),window.clearInterval(nt.current)}function ot(Je){if(!F)return;Je.preventDefault();var Xe=Je.touches[0],ft=Xe.screenX,mt=Xe.screenY;K({x:ft,y:mt});var Ke=ft-F.x,vt=mt-F.y;ee(Ke,vt);var At=Date.now();se(At),Oe(At-X),st({x:Ke,y:vt})}function rt(){if(!F)return;if(K(null),st(null),Ze){var Je=Ze.x/ge,Xe=Ze.y/ge,ft=Math.abs(Je),mt=Math.abs(Xe);if(Math.max(ft,mt)<Dr)return;var Ke=Je,vt=Xe;nt.current=window.setInterval(function(){if(Math.abs(Ke)<ui&&Math.abs(vt)<ui){window.clearInterval(nt.current);return}Ke*=di,vt*=di,ee(Ke*Tn,vt*Tn)},Tn)}}var at=Object(T.useRef)(0),gt=Object(T.useRef)(!1),ct=Object(T.useRef)();function Lt(Je){var Xe=Je.deltaX,ft=Je.deltaY,mt=0,Ke=Math.abs(Xe),vt=Math.abs(ft);Ke===vt?mt=ct.current==="x"?Xe:ft:Ke>vt?(mt=Xe,ct.current="x"):(mt=ft,ct.current="y");var At=Date.now();At-at.current>100&&(gt.current=!1),(ee(-mt,-mt)||gt.current)&&(Je.preventDefault(),gt.current=!0),at.current=At}var bt=Object(T.useRef)(null);bt.current={onTouchStart:lt,onTouchMove:ot,onTouchEnd:rt,onWheel:Lt},T.useEffect(function(){function Je(Ke){bt.current.onTouchStart(Ke)}function Xe(Ke){bt.current.onTouchMove(Ke)}function ft(Ke){bt.current.onTouchEnd(Ke)}function mt(Ke){bt.current.onWheel(Ke)}return document.addEventListener("touchmove",Xe,{passive:!1}),document.addEventListener("touchend",ft,{passive:!1}),G.current.addEventListener("touchstart",Je,{passive:!1}),G.current.addEventListener("wheel",mt),function(){document.removeEventListener("touchmove",Xe),document.removeEventListener("touchend",ft)}},[])}function Nr(){var G=Object(T.useRef)(new Map);function ee(Y){return G.current.has(Y)||G.current.set(Y,T.createRef()),G.current.get(Y)}function ae(Y){G.current.delete(Y)}return[ee,ae]}function ci(G,ee){var ae=T.useRef(G),Y=T.useState({}),F=Object(N.a)(Y,2),K=F[1];function j(V){var X=typeof V=="function"?V(ae.current):V;X!==ae.current&&ee(X,ae.current),ae.current=X,K({})}return[ae.current,j]}var hi=function(ee){var ae=ee.position,Y=ee.prefixCls,F=ee.extra;if(!F)return null;var K,j=F;return ae==="right"&&(K=j.right||!j.left&&j||null),ae==="left"&&(K=j.left||null),K?T.createElement("div",{className:"".concat(Y,"-extra-content")},K):null};function kr(G,ee){var ae,Y=T.useContext(Ln),F=Y.prefixCls,K=Y.tabs,j=G.className,V=G.style,X=G.id,se=G.animated,ie=G.activeKey,ue=G.rtl,ge=G.extra,Oe=G.editable,xe=G.locale,Pe=G.tabPosition,Ze=G.tabBarGutter,st=G.children,nt=G.onTabClick,lt=G.onTabScroll,ot=Object(T.useRef)(),rt=Object(T.useRef)(),at=Object(T.useRef)(),gt=Object(T.useRef)(),ct=Nr(),Lt=Object(N.a)(ct,2),bt=Lt[0],Je=Lt[1],Xe=Pe==="top"||Pe==="bottom",ft=ci(0,function(Et,pt){Xe&&lt&&lt({direction:Et>pt?"left":"right"})}),mt=Object(N.a)(ft,2),Ke=mt[0],vt=mt[1],At=ci(0,function(Et,pt){!Xe&&lt&&lt({direction:Et>pt?"top":"bottom"})}),_t=Object(N.a)(At,2),Tt=_t[0],Ct=_t[1],jt=Object(T.useState)(0),Gt=Object(N.a)(jt,2),Pt=Gt[0],zt=Gt[1],Qt=Object(T.useState)(0),Vt=Object(N.a)(Qt,2),Yt=Vt[0],Mt=Vt[1],Kt=Object(T.useState)(0),Bt=Object(N.a)(Kt,2),Ut=Bt[0],en=Bt[1],tn=Object(T.useState)(0),rn=Object(N.a)(tn,2),Rt=rn[0],Zt=rn[1],an=Object(T.useState)(null),It=Object(N.a)(an,2),yt=It[0],Ht=It[1],Hr=Object(T.useState)(null),vi=Object(N.a)(Hr,2),on=vi[0],Wr=vi[1],Kr=Object(T.useState)(0),_i=Object(N.a)(Kr,2),Gr=_i[0],zr=_i[1],Vr=Object(T.useState)(0),yi=Object(N.a)(Vr,2),Yr=yi[0],Xr=yi[1],$r=n(new Map),bi=Object(N.a)($r,2),Jr=bi[0],Qr=bi[1],xn=i(K,Jr,Pt),Ei="".concat(F,"-nav-operations-hidden"),dn=0,cn=0;Xe?ue?(dn=0,cn=Math.max(0,Pt-yt)):(dn=Math.min(0,yt-Pt),cn=0):(dn=Math.min(0,on-Yt),cn=0);function Dn(Et){return Et<dn?[dn,!1]:Et>cn?[cn,!1]:[Et,!0]}var Ti=Object(T.useRef)(),Zr=Object(T.useState)(),xi=Object(N.a)(Zr,2),Pn=xi[0],Oi=xi[1];function Mn(){Oi(Date.now())}function Nn(){window.clearTimeout(Ti.current)}Mr(ot,function(Et,pt){var Ft=!1;function Xt(fn,pn){fn(function(mn){var gn=Dn(mn+pn),ln=Object(N.a)(gn,2),jn=ln[0],Bn=ln[1];return Ft=Bn,jn})}if(Xe){if(yt>=Pt)return Ft;Xt(vt,Et)}else{if(on>=Yt)return Ft;Xt(Ct,pt)}return Nn(),Mn(),Ft}),Object(T.useEffect)(function(){return Nn(),Pn&&(Ti.current=window.setTimeout(function(){Oi(0)},100)),Nn},[Pn]);function Si(){var Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie,pt=xn.get(Et);if(!pt)return;if(Xe){var Ft=Ke;ue?pt.right<Ke?Ft=pt.right:pt.right+pt.width>Ke+yt&&(Ft=pt.right+pt.width-yt):pt.left<-Ke?Ft=-pt.left:pt.left+pt.width>-Ke+yt&&(Ft=-(pt.left+pt.width-yt)),Ct(0),vt(Dn(Ft)[0])}else{var Xt=Tt;pt.top<-Tt?Xt=-pt.top:pt.top+pt.height>-Tt+on&&(Xt=-(pt.top+pt.height-on)),vt(0),Ct(Dn(Xt)[0])}}var qr=_(xn,{width:yt,height:on,left:Ke,top:Tt},{width:Ut,height:Rt},{width:Gr,height:Yr},Object(L.a)(Object(L.a)({},G),{},{tabs:K})),wi=Object(N.a)(qr,2),ea=wi[0],ta=wi[1],na=K.map(function(Et){var pt=Et.key;return T.createElement(e,{id:X,prefixCls:F,key:pt,rtl:ue,tab:Et,closable:Et.closable,editable:Oe,active:pt===ie,tabPosition:Pe,tabBarGutter:Ze,renderWrapper:st,removeAriaLabel:xe==null?void 0:xe.removeAriaLabel,ref:bt(pt),onClick:function(Xt){nt(pt,Xt)},onRemove:function(){Je(pt)},onFocus:function(){Si(pt),Mn(),ue||(ot.current.scrollLeft=0),ot.current.scrollTop=0}})}),kn=r(function(){var Et,pt,Ft,Xt,fn,pn,mn,gn,ln,jn=((Et=ot.current)===null||Et===void 0?void 0:Et.offsetWidth)||0,Bn=((pt=ot.current)===null||pt===void 0?void 0:pt.offsetHeight)||0,Mi=((Ft=gt.current)===null||Ft===void 0?void 0:Ft.offsetWidth)||0,Ni=((Xt=gt.current)===null||Xt===void 0?void 0:Xt.offsetHeight)||0,la=((fn=at.current)===null||fn===void 0?void 0:fn.offsetWidth)||0,ua=((pn=at.current)===null||pn===void 0?void 0:pn.offsetHeight)||0;Ht(jn),Wr(Bn),zr(Mi),Xr(Ni);var ki=(((mn=rt.current)===null||mn===void 0?void 0:mn.offsetWidth)||0)-Mi,Ui=(((gn=rt.current)===null||gn===void 0?void 0:gn.offsetHeight)||0)-Ni;zt(ki),Mt(Ui);var Fi=(ln=at.current)===null||ln===void 0?void 0:ln.className.includes(Ei);en(ki-(Fi?0:la)),Zt(Ui-(Fi?0:ua)),Qr(function(){var ji=new Map;return K.forEach(function(da){var Bi=da.key,vn=bt(Bi).current;vn&&ji.set(Bi,{width:vn.offsetWidth,height:vn.offsetHeight,left:vn.offsetLeft,top:vn.offsetTop})}),ji})}),ia=K.slice(0,ea),ra=K.slice(ta+1),Ri=[].concat(Object(x.a)(ia),Object(x.a)(ra)),aa=Object(T.useState)(),Ai=Object(N.a)(aa,2),sa=Ai[0],oa=Ai[1],nn=xn.get(ie),Ii=Object(T.useRef)();function Ci(){g.a.cancel(Ii.current)}Object(T.useEffect)(function(){var Et={};return nn&&(Xe?(ue?Et.right=nn.right:Et.left=nn.left,Et.width=nn.width):(Et.top=nn.top,Et.height=nn.height)),Ci(),Ii.current=g()(function(){oa(Et)}),Ci},[nn,Xe,ue]),Object(T.useEffect)(function(){Si()},[ie,nn,xn,Xe]),Object(T.useEffect)(function(){kn()},[ue,Ze,ie,K.map(function(Et){return Et.key}).join("_")]);var Li=!!Ri.length,hn="".concat(F,"-nav-wrap"),Un,Fn,Di,Pi;return Xe?ue?(Fn=Ke>0,Un=Ke+yt<Pt):(Un=Ke<0,Fn=-Ke+yt<Pt):(Di=Tt<0,Pi=-Tt+on<Yt),T.createElement("div",{ref:ee,role:"tablist",className:M()("".concat(F,"-nav"),j),style:V,onKeyDown:function(){Mn()}},T.createElement(hi,{position:"left",extra:ge,prefixCls:F}),T.createElement(s.a,{onResize:kn},T.createElement("div",{className:M()(hn,(ae={},Object(le.a)(ae,"".concat(hn,"-ping-left"),Un),Object(le.a)(ae,"".concat(hn,"-ping-right"),Fn),Object(le.a)(ae,"".concat(hn,"-ping-top"),Di),Object(le.a)(ae,"".concat(hn,"-ping-bottom"),Pi),ae)),ref:ot},T.createElement(s.a,{onResize:kn},T.createElement("div",{ref:rt,className:"".concat(F,"-nav-list"),style:{transform:"translate(".concat(Ke,"px, ").concat(Tt,"px)"),transition:Pn?"none":void 0}},na,T.createElement(li,{ref:gt,prefixCls:F,locale:xe,editable:Oe,style:{visibility:Li?"hidden":null}}),T.createElement("div",{className:M()("".concat(F,"-ink-bar"),Object(le.a)({},"".concat(F,"-ink-bar-animated"),se.inkBar)),style:sa}))))),T.createElement(Lr,Object.assign({},G,{ref:at,prefixCls:F,tabs:Ri,className:!Li&&Ei})),T.createElement(hi,{position:"right",extra:ge,prefixCls:F}))}var fi=T.forwardRef(kr);function Ur(G){var ee=G.id,ae=G.activeKey,Y=G.animated,F=G.tabPosition,K=G.rtl,j=G.destroyInactiveTabPane,V=T.useContext(Ln),X=V.prefixCls,se=V.tabs,ie=Y.tabPane,ue=se.findIndex(function(ge){return ge.key===ae});return T.createElement("div",{className:M()("".concat(X,"-content-holder"))},T.createElement("div",{className:M()("".concat(X,"-content"),"".concat(X,"-content-").concat(F),Object(le.a)({},"".concat(X,"-content-animated"),ie)),style:ue&&ie?Object(le.a)({},K?"marginRight":"marginLeft","-".concat(ue,"00%")):null},se.map(function(ge){return T.cloneElement(ge.node,{key:ge.key,prefixCls:X,tabKey:ge.key,id:ee,animated:ie,active:ge.key===ae,destroyInactiveTabPane:j})})))}function pi(G){var ee=G.prefixCls,ae=G.forceRender,Y=G.className,F=G.style,K=G.id,j=G.active,V=G.animated,X=G.destroyInactiveTabPane,se=G.tabKey,ie=G.children,ue=T.useState(ae),ge=Object(N.a)(ue,2),Oe=ge[0],xe=ge[1];T.useEffect(function(){j?xe(!0):X&&xe(!1)},[j,X]);var Pe={};return j||(V?(Pe.visibility="hidden",Pe.height=0,Pe.overflowY="hidden"):Pe.display="none"),T.createElement("div",{id:K&&"".concat(K,"-panel-").concat(se),role:"tabpanel",tabIndex:j?0:-1,"aria-labelledby":K&&"".concat(K,"-tab-").concat(se),"aria-hidden":!j,style:Object(L.a)(Object(L.a)({},Pe),F),className:M()("".concat(ee,"-tabpane"),j&&"".concat(ee,"-tabpane-active"),Y)},(j||Oe||ae)&&ie)}var mi=0;function Fr(G){return Object(C.a)(G).map(function(ee){if(T.isValidElement(ee)){var ae=ee.key!==void 0?String(ee.key):void 0;return Object(L.a)(Object(L.a)({key:ae},ee.props),{},{node:ee})}return null}).filter(function(ee){return ee})}function jr(G,ee){var ae,Y=G.id,F=G.prefixCls,K=F===void 0?"rc-tabs":F,j=G.className,V=G.children,X=G.direction,se=G.activeKey,ie=G.defaultActiveKey,ue=G.editable,ge=G.animated,Oe=G.tabPosition,xe=Oe===void 0?"top":Oe,Pe=G.tabBarGutter,Ze=G.tabBarStyle,st=G.tabBarExtraContent,nt=G.locale,lt=G.moreIcon,ot=G.moreTransitionName,rt=G.destroyInactiveTabPane,at=G.renderTabBar,gt=G.onChange,ct=G.onTabClick,Lt=G.onTabScroll,bt=Object(O.a)(G,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Je=Fr(V),Xe=X==="rtl",ft;ge===!1?ft={inkBar:!1,tabPane:!1}:ft=Object(L.a)({inkBar:!0,tabPane:!1},ge!==!0?ge:null);var mt=Object(T.useState)(!1),Ke=Object(N.a)(mt,2),vt=Ke[0],At=Ke[1];Object(T.useEffect)(function(){At(Pr())},[]);var _t=Object(S.a)(function(){var Rt;return(Rt=Je[0])===null||Rt===void 0?void 0:Rt.key},{value:se,defaultValue:ie}),Tt=Object(N.a)(_t,2),Ct=Tt[0],jt=Tt[1],Gt=Object(T.useState)(function(){return Je.findIndex(function(Rt){return Rt.key===Ct})}),Pt=Object(N.a)(Gt,2),zt=Pt[0],Qt=Pt[1];Object(T.useEffect)(function(){var Rt=Je.findIndex(function(an){return an.key===Ct});if(Rt===-1){var Zt;Rt=Math.max(0,Math.min(zt,Je.length-1)),jt((Zt=Je[Rt])===null||Zt===void 0?void 0:Zt.key)}Qt(Rt)},[Je.map(function(Rt){return Rt.key}).join("_"),Ct,zt]);var Vt=Object(S.a)(null,{value:Y}),Yt=Object(N.a)(Vt,2),Mt=Yt[0],Kt=Yt[1],Bt=xe;vt&&!["left","right"].includes(xe)&&(Bt="top"),Object(T.useEffect)(function(){Y||(Kt("rc-tabs-".concat(mi)),mi+=1)},[]);function Ut(Rt,Zt){ct==null||ct(Rt,Zt),jt(Rt),gt==null||gt(Rt)}var en={id:Mt,activeKey:Ct,animated:ft,tabPosition:Bt,rtl:Xe,mobile:vt},tn,rn=Object(L.a)(Object(L.a)({},en),{},{editable:ue,locale:nt,moreIcon:lt,moreTransitionName:ot,tabBarGutter:Pe,onTabClick:Ut,onTabScroll:Lt,extra:st,style:Ze,panes:V});return at?tn=at(rn,fi):tn=T.createElement(fi,Object.assign({},rn)),T.createElement(Ln.Provider,{value:{tabs:Je,prefixCls:K}},T.createElement("div",Object.assign({ref:ee,id:Y,className:M()(K,"".concat(K,"-").concat(Bt),(ae={},Object(le.a)(ae,"".concat(K,"-mobile"),vt),Object(le.a)(ae,"".concat(K,"-editable"),ue),Object(le.a)(ae,"".concat(K,"-rtl"),Xe),ae),j)},bt),tn,T.createElement(Ur,Object.assign({destroyInactiveTabPane:rt},en,{animated:ft}))))}var gi=T.forwardRef(jr);gi.TabPane=pi;var Br=gi,ma=tt.b=Br},kUb9:function(ut,tt,te){"use strict";te.r(tt);var le=te("DjyN"),N=te("NUBc"),O=te("Znn+"),L=te("ZTPi"),T=te("+L6B"),A=te("2/Rp"),M=te("sPJy"),C=te("bE4q"),S=te("9og8"),x=te("k1fw"),v=te("tJVT"),g=te("WmNS"),s=te.n(g),r=te("cDcd"),n=te.n(r),u=te("Ty5D"),l=te("55Ip"),e=te("9kvl"),t=te("xKgJ"),i=te("ErOA"),b=te("BdwD"),_=te("INg4"),p=te.n(_),y=te("479L"),m=te.n(y),f=te("/zsF"),d=te("PArb"),a=te("rAM+"),o=te("9Bee"),c=te("m3rI"),h=function(D){var U,I=D.user,k=D.item,H=D.getdata,J=D.params,$=Object(r.useRef)(),fe=Object(r.useState)(),he=Object(v.a)(fe,2),ce=he[0],pe=he[1],_e=Object(r.useState)(!0),oe=Object(v.a)(_e,2),ne=oe[0],Ee=oe[1];return Object(r.useEffect)(function(){if(!$.current)return;function ke(){var Re,Ue=new ResizeObserver(function(be){var Se=Object(a.a)(be),Ie;try{for(Se.s();!(Ie=Se.n()).done;){var Me=Ie.value;console.log("----",Me,be),pe(Me.target.offsetHeight>=52)}}catch(De){Se.e(De)}finally{Se.f()}});return Ue.observe((Re=$.current)===null||Re===void 0?void 0:Re.firstElementChild),Ue}var we=ke();return function(){var Re,Ue;((Re=$.current)===null||Re===void 0?void 0:Re.firstElementChild)&&we.unobserve((Ue=$.current)===null||Ue===void 0?void 0:Ue.firstElementChild)}},[$.current]),n.a.createElement("div",{onClick:function(){e.d.push("/classrooms/".concat(J.coursesId,"/program_homework/").concat(J.categoryId,"/answer/").concat(k.id,"/detail"))},style:{marginTop:30,padding:"0px 20px",cursor:"pointer"}},n.a.createElement("div",{className:p.a.titles,style:{fontWeight:600,fontSize:18,color:"#000000"}},k.name),n.a.createElement("div",{style:{display:"flex",marginTop:10}},n.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",color:"#5F6368"}},n.a.createElement("img",{style:{width:24,borderRadius:50},src:"".concat(c.a.IMG_SERVER,"/images/").concat(k.author.image_url)}),n.a.createElement("span",{style:{margin:"0px 12px 0px 8px"}},k==null||((U=k.author)===null||U===void 0)?void 0:U.name),n.a.createElement("span",null,"\u53D1\u8868\u4E8E",k.created_at)),n.a.createElement("div",null,n.a.createElement("span",{style:{color:"#5F6368",cursor:"pointer"},onClick:function(){}},"\u56DE\u590D\uFF08",(k==null?void 0:k.descendants_count)||0,"\uFF09"),Object(t.j)()&&n.a.createElement("span",{onClick:function(){var ke=Object(S.a)(s.a.mark(function we(Re){var Ue;return s.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Re.stopPropagation(),Se.next=3,Object(i.a)("/api/hack_messages/".concat(k.id,"/update_public"),{method:"post"});case 3:Ue=Se.sent,Ue.status===0&&H();case 5:case"end":return Se.stop()}},we)}));return function(we){return ke.apply(this,arguments)}}(),style:{color:"#44D7B6",cursor:"pointer",marginLeft:20}},k.is_public?"\u53D6\u6D88\u516C\u5F00":"\u516C\u5F00"))),n.a.createElement("div",{ref:$,style:{margin:"15px 0px",maxHeight:ne?52:"",overflow:"hidden"}},n.a.createElement(o.a,{style:{color:"#434D6C",fontSize:14},value:k.content})),(k==null?void 0:k.hack_identifier)&&n.a.createElement("span",{onClick:function(){var ke=Object(S.a)(s.a.mark(function we(Re){var Ue,be;return s.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(Re.stopPropagation(),!Object(t.s)()){Ie.next=3;break}return Ie.abrupt("return");case 3:return Ie.next=5,Object(i.a)("/api/problems/".concat(k==null?void 0:k.hack_identifier,"/start.json"),{method:"get",params:{hack_user_id:k==null||((Ue=k.author)===null||Ue===void 0)?void 0:Ue.id}});case 5:be=Ie.sent,be&&(window.open("/myproblems/".concat(be==null?void 0:be.identifier,"?type=1")),localStorage.setItem("program_homework",[J.coursesId,J.categoryId]));case 7:case"end":return Ie.stop()}},we)}));return function(we){return ke.apply(this,arguments)}}(),className:p.a.tips},k==null?void 0:k.hack_name),ce&&n.a.createElement("div",{onClick:function(we){we.stopPropagation(),Ee(!ne)}},n.a.createElement(d.a,{dashed:!1,className:"",style:{cursor:"pointer"}},n.a.createElement("a",{className:"font14 ".concat(p.a.color999)},ne?"\u9605\u8BFB\u5168\u6587 ":"\u6536\u8D77\u5168\u6587 ",n.a.createElement("i",{className:"iconfont font14 ".concat(ne?"icon-jiantou9":"icon-changyongtubiao-xianxingdaochu-zhuanqu-")})))))},E=Object(e.a)(function(P){var D=P.user;return{user:D}})(h),R=function(D){var U,I,k,H,J=D.user,$=Object(r.useState)(Object(x.a)(Object(x.a)({},Object(u.i)()),{},{page:1,per_page:10,type:1,sort_by:"",course_group:Object(t.s)()?[J.userInfo.course.course_group_id]:[]})),fe=Object(v.a)($,2),he=fe[0],ce=fe[1],pe=Object(r.useState)([]),_e=Object(v.a)(pe,2),oe=_e[0],ne=_e[1];Object(r.useEffect)(function(){Ee()},[]);function Ee(){return ke.apply(this,arguments)}function ke(){return ke=Object(S.a)(s.a.mark(function we(){var Re;return s.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return be.next=2,Object(i.a)("/api/homework_commons/".concat(he.categoryId,"/hack_messages"),{method:"get",params:Object(x.a)(Object(x.a)({},he),{},{type:1})});case 2:Re=be.sent,ne(Re);case 4:case"end":return be.stop()}},we)})),ke.apply(this,arguments)}return n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},n.a.createElement(C.a,{separator:">",style:{marginTop:20}},n.a.createElement(C.a.Item,null,n.a.createElement(l.a,{to:"/classrooms/".concat(oe==null?void 0:oe.course_id,"/program_homework")},oe==null?void 0:oe.course_name)),n.a.createElement(C.a.Item,null,n.a.createElement(l.a,{to:"/classrooms/".concat(oe==null?void 0:oe.course_id,"/program_homework/").concat(oe==null?void 0:oe.homework_id,"/detail")},oe==null?void 0:oe.homework_name)),n.a.createElement(C.a.Item,null,"\u9898\u89E3&\u95EE\u7B54")),n.a.createElement("div",{style:{marginTop:10,display:"flex"}},n.a.createElement("div",{style:{width:"860px",marginRight:30,background:"#fff"}},n.a.createElement(L.a,{tabBarStyle:{padding:"0px 10px"},style:{width:"850px"},tabBarExtraContent:Object(t.s)()&&n.a.createElement(A.a,{type:"primary",style:{width:88},onClick:function(){e.d.push("/classrooms/".concat(he.coursesId,"/program_homework/").concat(he.categoryId,"/answer/add"))}},"\u53D1\u8868\u7B54\u7591 "),onChange:function(Re){Re==="1"?he.sort_by="":he.sort_by="created_at",ce(Object(x.a)({},he)),Ee()}},n.a.createElement(L.a.TabPane,{key:"1",tab:"\u6700\u65B0\u56DE\u590D"}),n.a.createElement(L.a.TabPane,{key:"2",tab:"\u6700\u65B0\u53D1\u8868"})),(oe==null||((U=oe.data)===null||U===void 0)?void 0:U.length)<=0&&n.a.createElement(b.a,{customText:"\u6682\u65E0\u8BA8\u8BBA"}),oe==null||((I=oe.data)===null||I===void 0)?void 0:I.map(function(we){return n.a.createElement(E,{item:we,params:he,getdata:Ee})}),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(N.a,{current:he.page,pageSize:he.per_page,total:oe==null?void 0:oe.count,hideOnSinglePage:!0,onChange:function(Re,Ue){he.page=Re,he.per_page=Ue,ce(Object(x.a)({},he)),Ee()}}))),n.a.createElement("div",{className:p.a.right,style:{width:300,height:"100%"}},n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},n.a.createElement("span",{style:{marginRight:3,fontSize:20,fontWeight:600,color:"#000"}},"\u5E7F\u64AD"),n.a.createElement("img",{width:21,src:m.a})," "),Object(t.c)()&&n.a.createElement(A.a,{type:"primary",onClick:function(){e.d.push("/classrooms/".concat(he.coursesId,"/program_homework/").concat(he.categoryId,"/answer/add"))}},"\u53D1\u5E03\u5E7F\u64AD")),(oe==null||((k=oe.radio_messages)===null||k===void 0)?void 0:k.length)<=0&&n.a.createElement(b.a,null),oe==null||((H=oe.radio_messages)===null||H===void 0)?void 0:H.map(function(we){return n.a.createElement("div",{onClick:function(){e.d.push("/classrooms/".concat(he.coursesId,"/program_homework/").concat(he.categoryId,"/answer/").concat(we.id,"/detail"))},style:{marginTop:30,cursor:"pointer"}},n.a.createElement("div",{className:p.a.title,style:{fontSize:"16px",fontWeight:600}},n.a.createElement("span",{style:{color:(we==null?void 0:we.message_type)===2?"#4C7BE6":"#E17E7E"}},(we==null?void 0:we.message_type)===2?"\u3010\u9898\u89E3\u3011":"\u3010\u901A\u77E5\u3011"),n.a.createElement("span",{title:we.name},we.name)),n.a.createElement("div",{style:{marginTop:15,color:"#5F6368"}},"\u53D1\u8868\u4E8E",we.created_at))}))))},w=tt.default=Object(e.a)(function(P){var D=P.user;return{user:D}})(R)},p5ED:function(ut,tt,te){"use strict";var le=te("+L6B"),N=te("2/Rp"),O=te("5Dmo"),L=te("3S7+"),T=te("k1fw"),A=te("tJVT"),M=te("cDcd"),C=te.n(M),S=te("vHTk"),x=te.n(S),v=te("yEEn"),g=te("ZW9T"),s=te("1vsH");tt.a=function(r){var n=r.name,u=r.data,l=r.theme,e=r.type,t=r.filename,i=r.monacoEditor,b=r.className,_=r.style,p=r.close,y=r.onClose,m=r.hasMask,f=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),d=Object(A.a)(f,2),a=d[0],o=d[1],c=Object(M.useState)(""),h=Object(A.a)(c,2),E=h[0],R=h[1],w,P=1024*1024,D=10*P,U=Object(M.useRef)();e==="office"&&(w=Object(s.V)(u).filesize,w>D&&(e="other")),t&&(i.filename=t),Object(M.useEffect)(function(){var H,J,$=(H=document.cookie)===null||H===void 0||((J=H.replace(/\s/g,""))===null||J===void 0)?void 0:J.split(";");$==null||$.map(function(fe){var he=fe.split("=");he[0]==="_educoder_session"&&R(he[1])})},[]);var I=function(){if(u.startsWith("http")||u.startsWith("/")){k();return}Object(s.z)(t||"educoder",u,t)},k=function(){Object(s.x)(t||n,u)};return console.log("data:",u,"fileanme:",t," name:",n),C.a.createElement("div",{style:Object(T.a)({},_||{}),className:"".concat(m&&x.a.bgBlack," ").concat(e?x.a.wrp:"hide")},p&&C.a.createElement("div",{className:x.a.close,ref:U},C.a.createElement(L.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},C.a.createElement("span",{onClick:k},C.a.createElement("i",{className:"icon-quxiaozhiding"}))),C.a.createElement(L.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},C.a.createElement("span",{className:"",onClick:y},C.a.createElement("i",{className:"icon-guanbi1"})))),C.a.createElement("div",{className:"".concat(x.a[b]," ").concat(b," ").concat(x.a.monaco," ").concat(e==="txt"?"show":"hide")},e==="txt"&&C.a.createElement(g.b,i)),e==="audio"&&C.a.createElement("audio",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?u:"data:audio/mp3;base64,").concat(u),autoPlay:!0}),e==="video"&&C.a.createElement(C.a.Fragment,null,u!=null&&u.startsWith("/")?C.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):C.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),e==="html"&&C.a.createElement("iframe",{src:u+"&disposition=inline"}),e==="pdf"&&C.a.createElement("embed",{className:x.a.embed,src:u}),e==="image"&&C.a.createElement(C.a.Fragment,null,C.a.createElement("img",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)})),e==="other"&&C.a.createElement("div",null,C.a.createElement(N.a,{type:"primary",size:"large",onClick:I},C.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(e==="download"||e==="office")&&C.a.createElement(N.a,{type:"primary",size:"large",onClick:I},C.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},psGv:function(ut,tt,te){var le,N;(function(){var O;(function(){"use strict";var M=[,,function(v){function g(n){this.__parent=n,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=[]}g.prototype.clone_empty=function(){var n=new g(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},g.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},g.prototype.has_match=function(n){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(n))return!0;return!1},g.prototype.set_indent=function(n,u){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(n){this.__items.push(n);var u=n.lastIndexOf(`
`);u!==-1?this.__character_count=n.length-u:this.__character_count+=n.length},g.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function s(n,u){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),u=u||"",n.indent_level>0&&(u=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}s.prototype.get_indent_size=function(n,u){var l=this.__base_string_length;return u=u||0,n<0&&(l=0),l+=n*this.__indent_size,l+=u,l},s.prototype.get_indent_string=function(n,u){var l=this.__base_string;return u=u||0,n<0&&(n=0,l=""),u+=n*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},s.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},s.prototype.__add_column=function(){var n=this.__cache.length,u=0,l="";this.__indent_size&&n>=this.__indent_size&&(u=Math.floor(n/this.__indent_size),n-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),n&&(l+=new Array(n+1).join(" ")),this.__cache.push(l)};function r(n,u){this.__indent_cache=new s(n,u),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new g(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(n,u){return this.__indent_cache.get_indent_string(n,u)},r.prototype.get_indent_size=function(n,u){return this.__indent_cache.get_indent_size(n,u)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(n){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return n!==`
`&&(l=l.replace(/[\n]/g,n)),l},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(n,u){return n=n||0,u=u||0,this.next_line.set_indent(n,u),this.__lines.length>1?(this.current_line.set_indent(n,u),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(n){for(var u=0;u<n.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(n){for(var u=this.__lines.length;n<u;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(n,u){for(var l=this.__lines.length-2;l>=0;){var e=this.__lines[l];if(e.is_empty())break;if(e.item(0).indexOf(n)!==0&&e.item(-1)!==u){this.__lines.splice(l+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},v.exports.Output=r},function(v){function g(s,r,n,u){this.type=s,this.text=r,this.comments_before=null,this.newlines=n||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=g},,,function(v){function g(n,u){this.raw_options=s(n,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}g.prototype._get_array=function(n,u){var l=this.raw_options[n],e=u||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(e=l.concat()):typeof l=="string"&&(e=l.split(/[^a-zA-Z0-9_\/\-]+/)),e},g.prototype._get_boolean=function(n,u){var l=this.raw_options[n],e=l===void 0?!!u:!!l;return e},g.prototype._get_characters=function(n,u){var l=this.raw_options[n],e=u||"";return typeof l=="string"&&(e=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),e},g.prototype._get_number=function(n,u){var l=this.raw_options[n];u=parseInt(u,10),isNaN(u)&&(u=0);var e=parseInt(l,10);return isNaN(e)&&(e=u),e},g.prototype._get_selection=function(n,u,l){var e=this._get_selection_list(n,u,l);if(e.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[n]+"'");return e[0]},g.prototype._get_selection_list=function(n,u,l){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[u[0]],!this._is_valid_selection(l,u))throw new Error("Invalid Default Value!");var e=this._get_array(n,l);if(!this._is_valid_selection(e,u))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[n]+"'");return e},g.prototype._is_valid_selection=function(n,u){return n.length&&u.length&&!n.some(function(l){return u.indexOf(l)===-1})};function s(n,u){var l={};n=r(n);var e;for(e in n)e!==u&&(l[e]=n[e]);if(u&&n[u])for(e in n[u])l[e]=n[u][e];return l}function r(n){var u={},l;for(l in n){var e=l.replace(/-/g,"_");u[e]=n[l]}return u}v.exports.Options=g,v.exports.normalizeOpts=r,v.exports.mergeOpts=s},,function(v){var g=RegExp.prototype.hasOwnProperty("sticky");function s(r){this.__input=r||"",this.__input_length=this.__input.length,this.__position=0}s.prototype.restart=function(){this.__position=0},s.prototype.back=function(){this.__position>0&&(this.__position-=1)},s.prototype.hasNext=function(){return this.__position<this.__input_length},s.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__input.charAt(this.__position),this.__position+=1),r},s.prototype.peek=function(r){var n=null;return r=r||0,r+=this.__position,r>=0&&r<this.__input_length&&(n=this.__input.charAt(r)),n},s.prototype.__match=function(r,n){r.lastIndex=n;var u=r.exec(this.__input);return u&&!(g&&r.sticky)&&(u.index!==n&&(u=null)),u},s.prototype.test=function(r,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(r,n):!1},s.prototype.testChar=function(r,n){var u=this.peek(n);return r.lastIndex=0,u!==null&&r.test(u)},s.prototype.match=function(r){var n=this.__match(r,this.__position);return n?this.__position+=n[0].length:n=null,n},s.prototype.read=function(r,n,u){var l="",e;return r&&(e=this.match(r),e&&(l+=e[0])),n&&(e||!r)&&(l+=this.readUntil(n,u)),l},s.prototype.readUntil=function(r,n){var u="",l=this.__position;r.lastIndex=this.__position;var e=r.exec(this.__input);return e?(l=e.index,n&&(l+=e[0].length)):l=this.__input_length,u=this.__input.substring(this.__position,l),this.__position=l,u},s.prototype.readUntilAfter=function(r){return this.readUntil(r,!0)},s.prototype.get_regexp=function(r,n){var u=null,l="g";return n&&g&&(l="y"),typeof r=="string"&&r!==""?u=new RegExp(r,l):r&&(u=new RegExp(r.source,l)),u},s.prototype.get_literal_regexp=function(r){return RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},s.prototype.peekUntilAfter=function(r){var n=this.__position,u=this.readUntilAfter(r);return this.__position=n,u},s.prototype.lookBack=function(r){var n=this.__position-1;return n>=r.length&&this.__input.substring(n-r.length,n).toLowerCase()===r},v.exports.InputScanner=s},function(v,g,s){var r=s(8).InputScanner,n=s(3).Token,u=s(10).TokenStream,l=s(11).WhitespacePattern,e={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(i,b){this._input=new r(i),this._options=b||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var i,b=new n(e.START,""),_=null,p=[],y=new u;b.type!==e.EOF;){for(i=this._get_next_token(b,_);this._is_comment(i);)y.add(i),i=this._get_next_token(b,_);y.isEmpty()||(i.comments_before=y,y=new u),i.parent=_,this._is_opening(i)?(p.push(_),_=i):_&&this._is_closing(i,_)&&(i.opened=_,_.closed=i,_=p.pop(),i.parent=_),i.previous=b,b.next=i,this.__tokens.add(i),b=i}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(i,b){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(e.RAW,_):this._create_token(e.EOF,"")},t.prototype._is_comment=function(i){return!1},t.prototype._is_opening=function(i){return!1},t.prototype._is_closing=function(i,b){return!1},t.prototype._create_token=function(i,b){var _=new n(i,b,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=t,v.exports.TOKEN=e},function(v){function g(s){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=s}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__tokens[this.__position],this.__position+=1),s},g.prototype.peek=function(s){var r=null;return s=s||0,s+=this.__position,s>=0&&s<this.__tokens_length&&(r=this.__tokens[s]),r},g.prototype.add=function(s){this.__parent_token&&(s.parent=this.__parent_token),this.__tokens.push(s),this.__tokens_length+=1},v.exports.TokenStream=g},function(v,g,s){var r=s(12).Pattern;function n(u,l){r.call(this,u,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new r,n.prototype.__set_whitespace_patterns=function(u,l){u+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var l=this.__split(this._newline_regexp,u);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return u},n.prototype.matching=function(u,l){var e=this._create();return e.__set_whitespace_patterns(u,l),e._update(),e},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(u,l){u.lastIndex=0;for(var e=0,t=[],i=u.exec(l);i;)t.push(l.substring(e,i.index)),e=i.index+i[0].length,i=u.exec(l);return e<l.length?t.push(l.substring(e,l.length)):t.push(""),t},v.exports.WhitespacePattern=n},function(v){function g(s,r){this._input=s,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,r&&(this._starting_pattern=this._input.get_regexp(r._starting_pattern,!0),this._match_pattern=this._input.get_regexp(r._match_pattern,!0),this._until_pattern=this._input.get_regexp(r._until_pattern),this._until_after=r._until_after)}g.prototype.read=function(){var s=this._input.read(this._starting_pattern);return(!this._starting_pattern||s)&&(s+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),s},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(s){var r=this._create();return r._until_after=!0,r._until_pattern=this._input.get_regexp(s),r._update(),r},g.prototype.until=function(s){var r=this._create();return r._until_after=!1,r._until_pattern=this._input.get_regexp(s),r._update(),r},g.prototype.starting_with=function(s){var r=this._create();return r._starting_pattern=this._input.get_regexp(s,!0),r._update(),r},g.prototype.matching=function(s){var r=this._create();return r._match_pattern=this._input.get_regexp(s,!0),r._update(),r},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},v.exports.Pattern=g},function(v){function g(s,r){s=typeof s=="string"?s:s.source,r=typeof r=="string"?r:r.source,this.__directives_block_pattern=new RegExp(s+/ beautify( \w+[:]\w+)+ /.source+r,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(s+/\sbeautify\signore:end\s/.source+r,"g")}g.prototype.get_directives=function(s){if(!s.match(this.__directives_block_pattern))return null;var r={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(s);n;)r[n[1]]=n[2],n=this.__directive_pattern.exec(s);return r},g.prototype.readIgnored=function(s){return s.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=g},function(v,g,s){var r=s(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(l,e){r.call(this,l,e),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var t=new r(l);this.__patterns={handlebars_comment:t.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:t.starting_with(/{{{/).until_after(/}}}/),handlebars:t.starting_with(/{{/).until_after(/}}/),php:t.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new r,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(l){var e=this._create();return e._disabled[l]=!0,e._update(),e},u.prototype.read_options=function(l){var e=this._create();for(var t in n)e._disabled[t]=l.templating.indexOf(t)===-1;return e._update(),e},u.prototype.exclude=function(l){var e=this._create();return e._excluded[l]=!0,e._update(),e},u.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),l+=e,e=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},u.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},u.prototype._read_template=function(){var l="",e=this._input.peek();if(e==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(l=l||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},v.exports.TemplatablePattern=u},,,,function(v,g,s){var r=s(19).Beautifier,n=s(20).Options;function u(l,e,t,i){var b=new r(l,e,t,i);return b.beautify()}v.exports=u,v.exports.defaultOptions=function(){return new n}},function(v,g,s){var r=s(20).Options,n=s(2).Output,u=s(21).Tokenizer,l=s(21).TOKEN,e=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,i=function(c,h){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=c.max_preserve_newlines,this.preserve_newlines=c.preserve_newlines,this._output=new n(c,h)};i.prototype.current_line_has_match=function(c){return this._output.current_line.has_match(c)},i.prototype.set_space_before_token=function(c,h){this._output.space_before_token=c,this._output.non_breaking_space=h},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(c){this._output.add_raw_token(c)},i.prototype.print_preserved_newlines=function(c){var h=0;c.type!==l.TEXT&&c.previous.type!==l.TEXT&&(h=c.newlines?1:0),this.preserve_newlines&&(h=c.newlines<this.max_preserve_newlines+1?c.newlines:this.max_preserve_newlines+1);for(var E=0;E<h;E++)this.print_newline(E>0);return h!==0},i.prototype.traverse_whitespace=function(c){return c.whitespace_before||c.newlines?(this.print_preserved_newlines(c)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(c){this._output.add_new_line(c)},i.prototype.print_token=function(c){c.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(c.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(c){return c=this.indent_level+(c||0),c<1?"":this._output.get_indent_string(c)};var b=function(c){for(var h=null,E=c.next;E.type!==l.EOF&&c.closed!==E;){if(E.type===l.ATTRIBUTE&&E.text==="type"){E.next&&E.next.type===l.EQUALS&&E.next.next&&E.next.next.type===l.VALUE&&(h=E.next.next.text);break}E=E.next}return h},_=function(c,h){var E=null,R=null;return h.closed?(c==="script"?E="text/javascript":c==="style"&&(E="text/css"),E=b(h)||E,E.search("text/css")>-1?R="css":E.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":E.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":E.search(/test\/null/)>-1&&(R="null"),R):null};function p(c,h){return h.indexOf(c)!==-1}function y(c,h,E){this.parent=c||null,this.tag=h?h.tag_name:"",this.indent_level=E||0,this.parser_token=h||null}function m(c){this._printer=c,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(c){var h=new y(this._current_frame,c,this._printer.indent_level);this._current_frame=h},m.prototype._try_pop_frame=function(c){var h=null;return c&&(h=c.parser_token,this._printer.indent_level=c.indent_level,this._current_frame=c.parent),h},m.prototype._get_frame=function(c,h){for(var E=this._current_frame;E&&!(c.indexOf(E.tag)!==-1);){if(h&&h.indexOf(E.tag)!==-1){E=null;break}E=E.parent}return E},m.prototype.try_pop=function(c,h){var E=this._get_frame([c],h);return this._try_pop_frame(E)},m.prototype.indent_to_tag=function(c){var h=this._get_frame(c);h&&(this._printer.indent_level=h.indent_level)};function f(c,h,E,R){this._source_text=c||"",h=h||{},this._js_beautify=E,this._css_beautify=R,this._tag_stack=null;var w=new r(h,"html");this._options=w,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"}f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var c=this._source_text,h=this._options.eol;this._options.eol==="auto"&&(h=`
`,c&&e.test(c)&&(h=c.match(e)[0])),c=c.replace(t,`
`);var E=c.match(/^[\t ]*/)[0],R={text:"",type:""},w=new d,P=new i(this._options,E),D=new u(c,this._options).tokenize();this._tag_stack=new m(P);for(var U=null,I=D.next();I.type!==l.EOF;)I.type===l.TAG_OPEN||I.type===l.COMMENT?(U=this._handle_tag_open(P,I,w,R),w=U):I.type===l.ATTRIBUTE||I.type===l.EQUALS||I.type===l.VALUE||I.type===l.TEXT&&!w.tag_complete?U=this._handle_inside_tag(P,I,w,D):I.type===l.TAG_CLOSE?U=this._handle_tag_close(P,I,w):I.type===l.TEXT?U=this._handle_text(P,I,w):P.add_raw_token(I),R=U,I=D.next();var k=P._output.get_code(h);return k},f.prototype._handle_tag_close=function(c,h,E){var R={text:h.text,type:h.type};return c.alignment_size=0,E.tag_complete=!0,c.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),E.is_unformatted?c.add_raw_token(h):(E.tag_start_char==="<"&&(c.set_space_before_token(h.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&E.has_wrapped_attrs&&c.print_newline(!1)),c.print_token(h)),E.indent_content&&!(E.is_unformatted||E.is_content_unformatted)&&(c.indent(),E.indent_content=!1),!E.is_inline_element&&!(E.is_unformatted||E.is_content_unformatted)&&c.set_wrap_point(),R},f.prototype._handle_inside_tag=function(c,h,E,R){var w=E.has_wrapped_attrs,P={text:h.text,type:h.type};if(c.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),E.is_unformatted)c.add_raw_token(h);else if(E.tag_start_char==="{"&&h.type===l.TEXT)c.print_preserved_newlines(h)?(h.newlines=0,c.add_raw_token(h)):c.print_token(h);else{if(h.type===l.ATTRIBUTE?(c.set_space_before_token(!0),E.attr_count+=1):(h.type===l.EQUALS||h.type===l.VALUE&&h.previous.type===l.EQUALS)&&c.set_space_before_token(!1),h.type===l.ATTRIBUTE&&E.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(c.traverse_whitespace(h),w=w||h.newlines!==0),this._is_wrap_attributes_force)){var D=E.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&E.attr_count===1){var U=!0,I=0,k;do{if(k=R.peek(I),k.type===l.ATTRIBUTE){U=!1;break}I+=1}while(I<4&&k.type!==l.EOF&&k.type!==l.TAG_CLOSE);D=!U}D&&(c.print_newline(!1),w=!0)}c.print_token(h),w=w||c.previous_token_wrapped(),E.has_wrapped_attrs=w}return P},f.prototype._handle_text=function(c,h,E){var R={text:h.text,type:"TK_CONTENT"};return E.custom_beautifier_name?this._print_custom_beatifier_text(c,h,E):E.is_unformatted||E.is_content_unformatted?c.add_raw_token(h):(c.traverse_whitespace(h),c.print_token(h)),R},f.prototype._print_custom_beatifier_text=function(c,h,E){var R=this;if(h.text!==""){var w=h.text,P,D=1,U="",I="";E.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?P=this._js_beautify:E.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?P=this._css_beautify:E.custom_beautifier_name==="html"&&(P=function(he,ce){var pe=new f(he,ce,R._js_beautify,R._css_beautify);return pe.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-c.indent_level);var k=c.get_full_indent(D);if(w=w.replace(/\n[ \t]*$/,""),E.custom_beautifier_name!=="html"&&w[0]==="<"&&w.match(/^(<!--|<!\[CDATA\[)/)){var H=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(w);if(!H){c.add_raw_token(h);return}U=k+H[1]+`
`,w=H[4],H[5]&&(I=k+H[5]),w=w.replace(/\n[ \t]*$/,""),(H[2]||H[3].indexOf(`
`)!==-1)&&(H=H[3].match(/[ \t]+$/),H&&(h.whitespace_before=H[0]))}if(w)if(P){var J=function(){this.eol=`
`};J.prototype=this._options.raw_options;var $=new J;w=P(k+w,$)}else{var fe=h.whitespace_before;fe&&(w=w.replace(new RegExp(`
(`+fe+")?","g"),`
`)),w=k+w.replace(/\n/g,`
`+k)}U&&(w?w=U+w+`
`+I:w=U+I),c.print_newline(!1),w&&(h.text=w,h.whitespace_before="",h.newlines=0,c.add_raw_token(h),c.print_newline(!0))}},f.prototype._handle_tag_open=function(c,h,E,R){var w=this._get_tag_open_token(h);return(E.is_unformatted||E.is_content_unformatted)&&!E.is_empty_element&&h.type===l.TAG_OPEN&&h.text.indexOf("</")===0?(c.add_raw_token(h),w.start_tag_token=this._tag_stack.try_pop(w.tag_name)):(c.traverse_whitespace(h),this._set_tag_position(c,h,w,E,R),w.is_inline_element||c.set_wrap_point(),c.print_token(h)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(w.alignment_size=h.text.length+1),!w.tag_complete&&!w.is_unformatted&&(c.alignment_size=w.alignment_size),w};var d=function(c,h){if(this.parent=c||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!h)this.tag_complete=!0;else{var E;this.tag_start_char=h.text[0],this.text=h.text,this.tag_start_char==="<"?(E=h.text.match(/^<([^\s>]*)/),this.tag_check=E?E[1]:""):(E=h.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=E?E[1]:"",(h.text.startsWith("{{#>")||h.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&h.next!==null?this.tag_check=h.next.text.split(" ")[0]:this.tag_check=h.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),h.type===l.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||h.closed&&h.closed.text==="/>";var R=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(R=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(R)))}};f.prototype._get_tag_open_token=function(c){var h=new d(this._tag_stack.get_parser_token(),c);return h.alignment_size=this._options.wrap_attributes_indent_size,h.is_end_tag=h.is_end_tag||p(h.tag_check,this._options.void_elements),h.is_empty_element=h.tag_complete||h.is_start_tag&&h.is_end_tag,h.is_unformatted=!h.tag_complete&&p(h.tag_check,this._options.unformatted),h.is_content_unformatted=!h.is_empty_element&&p(h.tag_check,this._options.content_unformatted),h.is_inline_element=p(h.tag_name,this._options.inline)||h.tag_name.includes("-")||h.tag_start_char==="{",h},f.prototype._set_tag_position=function(c,h,E,R,w){if(E.is_empty_element||(E.is_end_tag?E.start_tag_token=this._tag_stack.try_pop(E.tag_name):(this._do_optional_end_element(E)&&(E.is_inline_element||c.print_newline(!1)),this._tag_stack.record_tag(E),(E.tag_name==="script"||E.tag_name==="style")&&!(E.is_unformatted||E.is_content_unformatted)&&(E.custom_beautifier_name=_(E.tag_check,h)))),p(E.tag_check,this._options.extra_liners)&&(c.print_newline(!1),c._output.just_added_blankline()||c.print_newline(!0)),E.is_empty_element){if(E.tag_start_char==="{"&&E.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),E.indent_content=!0;var P=c.current_line_has_match(/{{#if/);P||c.print_newline(!1)}E.tag_name==="!--"&&w.type===l.TAG_CLOSE&&R.is_end_tag&&E.text.indexOf(`
`)===-1||(E.is_inline_element||E.is_unformatted||c.print_newline(!1),this._calcluate_parent_multiline(c,E))}else if(E.is_end_tag){var D=!1;D=E.start_tag_token&&E.start_tag_token.multiline_content,D=D||!E.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(w.type===l.TAG_CLOSE&&E.start_tag_token===R)&&w.type!=="TK_CONTENT",(E.is_content_unformatted||E.is_unformatted)&&(D=!1),D&&c.print_newline(!1)}else E.indent_content=!E.custom_beautifier_name,E.tag_start_char==="<"&&(E.tag_name==="html"?E.indent_content=this._options.indent_inner_html:E.tag_name==="head"?E.indent_content=this._options.indent_head_inner_html:E.tag_name==="body"&&(E.indent_content=this._options.indent_body_inner_html)),!(E.is_inline_element||E.is_unformatted)&&(w.type!=="TK_CONTENT"||E.is_content_unformatted)&&c.print_newline(!1),this._calcluate_parent_multiline(c,E)},f.prototype._calcluate_parent_multiline=function(c,h){h.parent&&c._output.just_added_newline()&&!((h.is_inline_element||h.is_unformatted)&&h.parent.is_inline_element)&&(h.parent.multiline_content=!0)};var a=["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"],o=["a","audio","del","ins","map","noscript","video"];f.prototype._do_optional_end_element=function(c){var h=null;if(c.is_empty_element||!c.is_start_tag||!c.parent)return;if(c.tag_name==="body")h=h||this._tag_stack.try_pop("head");else if(c.tag_name==="li")h=h||this._tag_stack.try_pop("li",["ol","ul"]);else if(c.tag_name==="dd"||c.tag_name==="dt")h=h||this._tag_stack.try_pop("dt",["dl"]),h=h||this._tag_stack.try_pop("dd",["dl"]);else if(c.parent.tag_name==="p"&&a.indexOf(c.tag_name)!==-1){var E=c.parent.parent;(!E||o.indexOf(E.tag_name)===-1)&&(h=h||this._tag_stack.try_pop("p"))}else c.tag_name==="rp"||c.tag_name==="rt"?(h=h||this._tag_stack.try_pop("rt",["ruby","rtc"]),h=h||this._tag_stack.try_pop("rp",["ruby","rtc"])):c.tag_name==="optgroup"?h=h||this._tag_stack.try_pop("optgroup",["select"]):c.tag_name==="option"?h=h||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):c.tag_name==="colgroup"?h=h||this._tag_stack.try_pop("caption",["table"]):c.tag_name==="thead"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"])):c.tag_name==="tbody"||c.tag_name==="tfoot"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("thead",["table"]),h=h||this._tag_stack.try_pop("tbody",["table"])):c.tag_name==="tr"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(c.tag_name==="th"||c.tag_name==="td")&&(h=h||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),h=h||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return c.parent=this._tag_stack.get_parser_token(),h},v.exports.Beautifier=f},function(v,g,s){var r=s(6).Options;function n(u){r.call(this,u,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}n.prototype=new r,v.exports.Options=n},function(v,g,s){var r=s(9).Tokenizer,n=s(9).TOKEN,u=s(13).Directives,l=s(14).TemplatablePattern,e=s(12).Pattern,t={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:n.START,RAW:n.RAW,EOF:n.EOF},i=new u(/<\!--/,/-->/),b=function(_,p){r.call(this,_,p),this._current_tag_name="";var y=new l(this._input).read_options(this._options),m=new e(this._input);if(this.__patterns={word:y.until(/[\n\r\t <]/),single_quote:y.until_after(/'/),double_quote:y.until_after(/"/),attribute:y.until(/[\n\r\t =>]|\/>/),element_name:y.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(/<!--/).until_after(/-->/),cdata:m.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:m.starting_with(/<!\[/).until_after(/]>/),processing:m.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 f=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(f).until_after(f)}};b.prototype=new r,b.prototype._is_comment=function(_){return!1},b.prototype._is_opening=function(_){return _.type===t.TAG_OPEN},b.prototype._is_closing=function(_,p){return _.type===t.TAG_CLOSE&&p&&((_.text===">"||_.text==="/>")&&p.text[0]==="<"||_.text==="}}"&&p.text[0]==="{"&&p.text[1]==="{")},b.prototype._reset=function(){this._current_tag_name=""},b.prototype._get_next_token=function(_,p){var y=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(t.EOF,""):(y=y||this._read_open_handlebars(m,p),y=y||this._read_attribute(m,_,p),y=y||this._read_close(m,p),y=y||this._read_raw_content(m,_,p),y=y||this._read_content_word(m),y=y||this._read_comment_or_cdata(m),y=y||this._read_processing(m),y=y||this._read_open(m,p),y=y||this._create_token(t.UNKNOWN,this._input.next()),y)},b.prototype._read_comment_or_cdata=function(_){var p=null,y=null,m=null;if(_==="<"){var f=this._input.peek(1);f==="!"&&(y=this.__patterns.comment.read(),y?(m=i.get_directives(y),m&&m.ignore==="start"&&(y+=i.readIgnored(this._input))):y=this.__patterns.cdata.read()),y&&(p=this._create_token(t.COMMENT,y),p.directives=m)}return p},b.prototype._read_processing=function(_){var p=null,y=null,m=null;if(_==="<"){var f=this._input.peek(1);(f==="!"||f==="?")&&(y=this.__patterns.conditional_comment.read(),y=y||this.__patterns.processing.read()),y&&(p=this._create_token(t.COMMENT,y),p.directives=m)}return p},b.prototype._read_open=function(_,p){var y=null,m=null;return p||_==="<"&&(y=this._input.next(),this._input.peek()==="/"&&(y+=this._input.next()),y+=this.__patterns.element_name.read(),m=this._create_token(t.TAG_OPEN,y)),m},b.prototype._read_open_handlebars=function(_,p){var y=null,m=null;return p||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(y=this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars.read(),m=this._create_token(t.COMMENT,y)):(y=this.__patterns.handlebars_open.read(),m=this._create_token(t.TAG_OPEN,y))),m},b.prototype._read_close=function(_,p){var y=null,m=null;return p&&(p.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(y=this._input.next(),_==="/"&&(y+=this._input.next()),m=this._create_token(t.TAG_CLOSE,y)):p.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(t.TAG_CLOSE,"}}"))),m},b.prototype._read_attribute=function(_,p,y){var m=null,f="";if(y&&y.text[0]==="<")if(_==="=")m=this._create_token(t.EQUALS,this._input.next());else if(_==='"'||_==="'"){var d=this._input.next();_==='"'?d+=this.__patterns.double_quote.read():d+=this.__patterns.single_quote.read(),m=this._create_token(t.VALUE,d)}else f=this.__patterns.attribute.read(),f&&(p.type===t.EQUALS?m=this._create_token(t.VALUE,f):m=this._create_token(t.ATTRIBUTE,f));return m},b.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},b.prototype._read_raw_content=function(_,p,y){var m="";if(y&&y.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(p.type===t.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var f=p.opened.text.substr(1).toLowerCase();if(f==="script"||f==="style"){var d=this._read_comment_or_cdata(_);if(d)return d.type=t.TEXT,d;m=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(f)&&(m=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig")))}return m?this._create_token(t.TEXT,m):null},b.prototype._read_content_word=function(_){var p="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(p=this.__patterns.unformatted_content_delimiter.read())),p||(p=this.__patterns.word.read()),p)return this._create_token(t.TEXT,p)},v.exports.Tokenizer=b,v.exports.TOKEN=t}],C={};function S(v){var g=C[v];if(g!==void 0)return g.exports;var s=C[v]={exports:{}};return M[v](s,s.exports,S),s.exports}var x=S(18);O=x})();var L=O;if(!0)!(le=[te,te("6UM0"),te("TXwP")],N=function(M){var C=te("6UM0"),S=te("TXwP");return{html_beautify:function(x,v){return L(x,v,C.js_beautify,S.css_beautify)}}}.apply(tt,le),N!==void 0&&(ut.exports=N));else var T,A})()},"rAM+":function(ut,tt,te){"use strict";te.d(tt,"a",function(){return N});var le=te("Qw5x");function N(O,L){var T;if(typeof Symbol=="undefined"||O[Symbol.iterator]==null){if(Array.isArray(O)||(T=Object(le.a)(O))||L&&O&&typeof O.length=="number"){T&&(O=T);var A=0,M=function(){};return{s:M,n:function(){return A>=O.length?{done:!0}:{done:!1,value:O[A++]}},e:function(g){throw g},f:M}}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 C=!0,S=!1,x;return{s:function(){T=O[Symbol.iterator]()},n:function(){var g=T.next();return C=g.done,g},e:function(g){S=!0,x=g},f:function(){try{!C&&T.return!=null&&T.return()}finally{if(S)throw x}}}}},rUJ1:function(ut,tt){const te=/[&<>"']/,le=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},T=m=>L[m];function A(m,f){if(f){if(te.test(m))return m.replace(le,T)}else if(N.test(m))return m.replace(O,T);return m}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(m){return m.replace(M,(f,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const S=/(^|[^\[])\^/g;function x(m,f){m=m.source||m,f=f||"";const d={replace:(a,o)=>(o=o.source||o,o=o.replace(S,"$1"),m=m.replace(a,o),d),getRegex:()=>new RegExp(m,f)};return d}const v=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s(m,f,d){if(m){let a;try{a=decodeURIComponent(C(d)).replace(v,"").toLowerCase()}catch(o){return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}f&&!g.test(d)&&(d=e(f,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(a){return null}return d}const r={},n=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(m,f){r[" "+m]||(n.test(m)?r[" "+m]=m+"/":r[" "+m]=_(m,"/",!0)),m=r[" "+m];const d=m.indexOf(":")===-1;return f.substring(0,2)==="//"?d?f:m.replace(u,"$1")+f:f.charAt(0)==="/"?d?f:m.replace(l,"$1")+f:m+f}const t={exec:function(){}};function i(m){let f=1,d,a;for(;f<arguments.length;f++){d=arguments[f];for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&(m[a]=d[a])}return m}function b(m,f){const d=m.replace(/\|/g,(c,h,E)=>{let R=!1,w=h;for(;--w>=0&&E[w]==="\\";)R=!R;return R?"|":" |"}),a=d.split(/ \|/);let o=0;if(a.length>f)a.splice(f);else for(;a.length<f;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(/\\\|/g,"|");return a}function _(m,f,d){const a=m.length;if(a===0)return"";let o=0;for(;o<a;){const c=m.charAt(a-o-1);if(c===f&&!d)o++;else if(c!==f&&d)o++;else break}return m.substr(0,a-o)}function p(m,f){if(m.indexOf(f[1])===-1)return-1;const d=m.length;let a=0,o=0;for(;o<d;o++)if(m[o]==="\\")o++;else if(m[o]===f[0])a++;else if(m[o]===f[1]&&(a--,a<0))return o;return-1}function y(m){m&&m.sanitize&&!m.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")}ut.exports={escape:A,unescape:C,edit:x,cleanUrl:s,resolveUrl:e,noopTest:t,merge:i,splitCells:b,rtrim:_,findClosingBracket:p,checkSanitizeDeprecation:y}},t23M:function(ut,tt,te){"use strict";var le=te("VTBJ"),N=te("1OyB"),O=te("vuIU"),L=te("Ji7U"),T=te("LK+K"),A=te("cDcd"),M=te.n(A),C=te("m+aA"),S=te("Zm9Q"),x=te("Kwbf"),v=te("c+Xe"),g=te("bdgK"),s="rc-observer-key",r=function(n){Object(L.a)(l,n);var u=Object(T.a)(l);function l(){var e;return Object(N.a)(this,l),e=u.apply(this,arguments),e.resizeObserver=null,e.childNode=null,e.currentElement=null,e.state={width:0,height:0,offsetHeight:0,offsetWidth:0},e.onResize=function(t){var i=e.props.onResize,b=t[0].target,_=b.getBoundingClientRect(),p=_.width,y=_.height,m=b.offsetWidth,f=b.offsetHeight,d=Math.floor(p),a=Math.floor(y);if(e.state.width!==d||e.state.height!==a||e.state.offsetWidth!==m||e.state.offsetHeight!==f){var o={width:d,height:a,offsetWidth:m,offsetHeight:f};e.setState(o),i&&Promise.resolve().then(function(){i(Object(le.a)(Object(le.a)({},o),{},{offsetWidth:m,offsetHeight:f}))})}},e.setChildNode=function(t){e.childNode=t},e}return Object(O.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var t=this.props.disabled;if(t){this.destroyObserver();return}var i=Object(C.a)(this.childNode||this),b=i!==this.currentElement;b&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,i=Object(S.a)(t);if(i.length>1)Object(x.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(x.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var b=i[0];if(A.isValidElement(b)&&Object(v.c)(b)){var _=b.ref;i[0]=A.cloneElement(b,{ref:Object(v.a)(_,this.setChildNode)})}return i.length===1?i[0]:i.map(function(p,y){return!A.isValidElement(p)||"key"in p&&p.key!==null?p:A.cloneElement(p,{key:"".concat(s,"-").concat(y)})})}}]),l}(A.Component);r.displayName="ResizeObserver",tt.a=r},ulZh:function(ut,tt,te){typeof window!="undefined"&&function(N,O){ut.exports=O()}(this,function(){return function(le){var N={};function O(L){if(N[L])return N[L].exports;var T=N[L]={i:L,l:!1,exports:{}};return le[L].call(T.exports,T,T.exports,O),T.l=!0,T.exports}return O.m=le,O.c=N,O.d=function(L,T,A){O.o(L,T)||Object.defineProperty(L,T,{enumerable:!0,get:A})},O.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},O.t=function(L,T){if(T&1&&(L=O(L)),T&8)return L;if(T&4&&typeof L=="object"&&L&&L.__esModule)return L;var A=Object.create(null);if(O.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:L}),T&2&&typeof L!="string")for(var M in L)O.d(A,M,function(C){return L[C]}.bind(null,M));return A},O.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return O.d(T,"a",T),T},O.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)},O.p="/dist/",O(O.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,N,O){"use strict";var L=Object.prototype.hasOwnProperty,T="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(T=!1));function M(v,g,s){this.fn=v,this.context=g,this.once=s||!1}function C(v,g,s,r,n){if(typeof s!="function")throw new TypeError("The listener must be a function");var u=new M(s,r||v,n),l=T?T+g:g;return v._events[l]?v._events[l].fn?v._events[l]=[v._events[l],u]:v._events[l].push(u):(v._events[l]=u,v._eventsCount++),v}function S(v,g){--v._eventsCount===0?v._events=new A:delete v._events[g]}function x(){this._events=new A,this._eventsCount=0}x.prototype.eventNames=function(){var g=[],s,r;if(this._eventsCount===0)return g;for(r in s=this._events)L.call(s,r)&&g.push(T?r.slice(1):r);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(s)):g},x.prototype.listeners=function(g){var s=T?T+g:g,r=this._events[s];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,u=r.length,l=new Array(u);n<u;n++)l[n]=r[n].fn;return l},x.prototype.listenerCount=function(g){var s=T?T+g:g,r=this._events[s];return r?r.fn?1:r.length:0},x.prototype.emit=function(g,s,r,n,u,l){var e=T?T+g:g;if(!this._events[e])return!1;var t=this._events[e],i=arguments.length,b,_;if(t.fn){t.once&&this.removeListener(g,t.fn,void 0,!0);switch(i){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,s),!0;case 3:return t.fn.call(t.context,s,r),!0;case 4:return t.fn.call(t.context,s,r,n),!0;case 5:return t.fn.call(t.context,s,r,n,u),!0;case 6:return t.fn.call(t.context,s,r,n,u,l),!0}for(_=1,b=new Array(i-1);_<i;_++)b[_-1]=arguments[_];t.fn.apply(t.context,b)}else{var p=t.length,y;for(_=0;_<p;_++){t[_].once&&this.removeListener(g,t[_].fn,void 0,!0);switch(i){case 1:t[_].fn.call(t[_].context);break;case 2:t[_].fn.call(t[_].context,s);break;case 3:t[_].fn.call(t[_].context,s,r);break;case 4:t[_].fn.call(t[_].context,s,r,n);break;default:if(!b)for(y=1,b=new Array(i-1);y<i;y++)b[y-1]=arguments[y];t[_].fn.apply(t[_].context,b)}}}return!0},x.prototype.on=function(g,s,r){return C(this,g,s,r,!1)},x.prototype.once=function(g,s,r){return C(this,g,s,r,!0)},x.prototype.removeListener=function(g,s,r,n){var u=T?T+g:g;if(!this._events[u])return this;if(!s)return S(this,u),this;var l=this._events[u];if(l.fn)l.fn===s&&(!n||l.once)&&(!r||l.context===r)&&S(this,u);else{for(var e=0,t=[],i=l.length;e<i;e++)(l[e].fn!==s||n&&!l[e].once||r&&l[e].context!==r)&&t.push(l[e]);t.length?this._events[u]=t.length===1?t[0]:t:S(this,u)}return this},x.prototype.removeAllListeners=function(g){var s;return g?(s=T?T+g:g,this._events[s]&&S(this,s)):(this._events=new A,this._eventsCount=0),this},x.prototype.off=x.prototype.removeListener,x.prototype.addListener=x.prototype.on,x.prefixed=T,x.EventEmitter=x,le.exports=x},"./node_modules/url-toolkit/src/url-toolkit.js":function(le,N,O){(function(L){var T=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,A=/^([^\/?#]*)([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,C=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,S={buildAbsoluteURL:function(x,v,g){if(g=g||{},x=x.trim(),v=v.trim(),!v){if(!g.alwaysNormalize)return x;var s=S.parseURL(x);if(!s)throw new Error("Error trying to parse base URL.");return s.path=S.normalizePath(s.path),S.buildURLFromParts(s)}var r=S.parseURL(v);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return g.alwaysNormalize?(r.path=S.normalizePath(r.path),S.buildURLFromParts(r)):v;var n=S.parseURL(x);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&n.path[0]!=="/"){var u=A.exec(n.path);n.netLoc=u[1],n.path=u[2]}n.netLoc&&!n.path&&(n.path="/");var l={scheme:n.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(l.netLoc=n.netLoc,r.path[0]!=="/"))if(!r.path)l.path=n.path,r.params||(l.params=n.params,r.query||(l.query=n.query));else{var e=n.path,t=e.substring(0,e.lastIndexOf("/")+1)+r.path;l.path=S.normalizePath(t)}return l.path===null&&(l.path=g.alwaysNormalize?S.normalizePath(r.path):r.path),S.buildURLFromParts(l)},parseURL:function(x){var v=T.exec(x);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(x){for(x=x.split("").reverse().join("").replace(M,"");x.length!==(x=x.replace(C,"")).length;);return x.split("").reverse().join("")},buildURLFromParts:function(x){return x.scheme+x.netLoc+x.path+x.params+x.query+x.fragment}};le.exports=S})(this)},"./node_modules/webworkify-webpack/index.js":function(le,N,O){function L(g){var s={};function r(u){if(s[u])return s[u].exports;var l=s[u]={i:u,l:!1,exports:{}};return g[u].call(l.exports,l,l.exports,r),l.l=!0,l.exports}r.m=g,r.c=s,r.i=function(u){return u},r.d=function(u,l,e){r.o(u,l)||Object.defineProperty(u,l,{configurable:!1,enumerable:!0,get:e})},r.r=function(u){Object.defineProperty(u,"__esModule",{value:!0})},r.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return r.d(l,"a",l),l},r.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},r.p="/",r.oe=function(u){throw console.error(u),u};var n=r(r.s=ENTRY_MODULE);return n.default||n}var T="[\\.|\\-|\\+|\\w|/|@]+",A="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+T+").*?\\)";function M(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function C(g){return!isNaN(1*g)}function S(g,s,r){var n={};n[r]=[];var u=s.toString(),l=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return n;for(var e=l[1],t=new RegExp("(\\\\n|\\W)"+M(e)+A,"g"),i;i=t.exec(u);){if(i[3]==="dll-reference")continue;n[r].push(i[3])}for(t=new RegExp("\\("+M(e)+'\\("(dll-reference\\s('+T+'))"\\)\\)'+A,"g");i=t.exec(u);)g[i[2]]||(n[r].push(i[1]),g[i[2]]=O(i[1]).m),n[i[2]]=n[i[2]]||[],n[i[2]].push(i[4]);for(var b=Object.keys(n),_=0;_<b.length;_++)for(var p=0;p<n[b[_]].length;p++)C(n[b[_]][p])&&(n[b[_]][p]=1*n[b[_]][p]);return n}function x(g){var s=Object.keys(g);return s.reduce(function(r,n){return r||g[n].length>0},!1)}function v(g,s){for(var r={main:[s]},n={main:[]},u={main:{}};x(r);)for(var l=Object.keys(r),e=0;e<l.length;e++){var t=l[e],i=r[t],b=i.pop();if(u[t]=u[t]||{},u[t][b]||!g[t][b])continue;u[t][b]=!0,n[t]=n[t]||[],n[t].push(b);for(var _=S(g,g[t][b],t),p=Object.keys(_),y=0;y<p.length;y++)r[p[y]]=r[p[y]]||[],r[p[y]]=r[p[y]].concat(_[p[y]])}return n}le.exports=function(g,s){s=s||{};var r={main:O.m},n=s.all?{main:Object.keys(r.main)}:v(r,g),u="";Object.keys(n).filter(function(b){return b!=="main"}).forEach(function(b){for(var _=0;n[b][_];)_++;n[b].push(_),r[b][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+"var "+b+" = ("+L.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+n[b].map(function(p){return""+JSON.stringify(p)+": "+r[b][p].toString()}).join(",")+`});
`}),u=u+"new (("+L.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+n.main.map(function(b){return""+JSON.stringify(b)+": "+r.main[b].toString()}).join(",")+"}))(self);";var l=new window.Blob([u],{type:"text/javascript"});if(s.bare)return l;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,t=e.createObjectURL(l),i=new window.Worker(t);return i.objectURL=t,i}},"./src/config.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"hlsDefaultConfig",function(){return y}),O.d(N,"mergeConfig",function(){return f}),O.d(N,"enableStreamingMode",function(){return d});var L=O("./src/controller/abr-controller.ts"),T=O("./src/controller/audio-stream-controller.ts"),A=O("./src/controller/audio-track-controller.ts"),M=O("./src/controller/subtitle-stream-controller.ts"),C=O("./src/controller/subtitle-track-controller.ts"),S=O("./src/controller/buffer-controller.ts"),x=O("./src/controller/timeline-controller.ts"),v=O("./src/controller/cap-level-controller.ts"),g=O("./src/controller/fps-controller.ts"),s=O("./src/controller/eme-controller.ts"),r=O("./src/controller/cmcd-controller.ts"),n=O("./src/utils/xhr-loader.ts"),u=O("./src/utils/fetch-loader.ts"),l=O("./src/utils/cues.ts"),e=O("./src/utils/mediakeys-helper.ts"),t=O("./src/utils/logger.ts");function i(){return i=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(a[h]=c[h])}return a},i.apply(this,arguments)}function b(a,o){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);o&&(h=h.filter(function(E){return Object.getOwnPropertyDescriptor(a,E).enumerable})),c.push.apply(c,h)}return c}function _(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?b(Object(c),!0).forEach(function(h){p(a,h,c[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):b(Object(c)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(c,h))})}return a}function p(a,o,c){return o in a?Object.defineProperty(a,o,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[o]=c,a}var y=_(_({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:n.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:L.default,bufferController:S.default,capLevelController:v.default,fpsController:g.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:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},m()),{},{subtitleStreamController:M.SubtitleStreamController,subtitleTrackController:C.default,timelineController:x.TimelineController,audioStreamController:T.default,audioTrackController:A.default,emeController:s.default,cmcdController:r.default});function m(){return{cueHandler:l.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 f(a,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},a,o)}function d(a){var o=a.loader;if(o!==u.default&&o!==n.default)t.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1;else{var c=Object(u.fetchSupported)();c&&(a.loader=u.default,a.progressive=!0,a.enableSoftwareAES=!0,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/polyfills/number.ts"),T=O("./src/utils/ewma-bandwidth-estimator.ts"),A=O("./src/events.ts"),M=O("./src/utils/buffer-helper.ts"),C=O("./src/errors.ts"),S=O("./src/types/loader.ts"),x=O("./src/utils/logger.ts");function v(r,n){for(var u=0;u<n.length;u++){var l=n[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function g(r,n,u){return n&&v(r.prototype,n),u&&v(r,u),r}var s=function(){function r(u){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=u;var l=u.config;this.bwEstimator=new T.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var n=r.prototype;return n.registerListeners=function(){var l=this.hls;l.on(A.Events.FRAG_LOADING,this.onFragLoading,this),l.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(A.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var l=this.hls;l.off(A.Events.FRAG_LOADING,this.onFragLoading,this),l.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(A.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},n.onFragLoading=function(l,e){var t=e.frag;if(t.type===S.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=t,this.partCurrent=(i=e.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},n.onLevelLoaded=function(l,e){var t=this.hls.config;e.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},n._abandonRulesCheck=function(){var l=this.fragCurrent,e=this.partCurrent,t=this.hls,i=t.autoLevelEnabled,b=t.config,_=t.media;if(!l||!_)return;var p=e?e.stats:l.stats,y=e?e.duration:l.duration;if(p.aborted){x.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||_.paused||!_.playbackRate||!_.readyState)return;var m=performance.now()-p.loading.start,f=Math.abs(_.playbackRate);if(m<=500*y/f)return;var d=t.levels,a=t.minAutoLevel,o=d[l.level],c=p.total||Math.max(p.loaded,Math.round(y*o.maxBitrate/8)),h=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/m),E=(c-p.loaded)/h,R=_.currentTime,w=(M.BufferHelper.bufferInfo(_,R,b.maxBufferHole).end-R)/f;if(w>=2*y/f||E<=w)return;var P=Number.POSITIVE_INFINITY,D;for(D=l.level-1;D>a;D--){var U=d[D].maxBitrate;if(P=y*U/(8*.8*h),P<w)break}if(P>=E)return;var I=this.bwEstimator.getEstimate();x.logger.warn("Fragment "+l.sn+(e?" part "+e.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+D+`
Current BW estimate: `+(Object(L.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+E.toFixed(3)+` s
Estimated load time for the next fragment: `+P.toFixed(3)+` s
Time to underbuffer: `+w.toFixed(3)+" s"),t.nextLoadLevel=D,this.bwEstimator.sample(m,p.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),t.trigger(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:e,stats:p})},n.onFragLoaded=function(l,e){var t=e.frag,i=e.part;if(t.type===S.PlaylistLevelType.MAIN&&Object(L.isFiniteNumber)(t.sn)){var b=i?i.stats:t.stats,_=i?i.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[t.level],y=(p.loaded?p.loaded.bytes:0)+b.loaded,m=(p.loaded?p.loaded.duration:0)+_;p.loaded={bytes:y,duration:m},p.realBitrate=Math.round(8*y/m)}if(t.bitrateTest){var f={stats:b,frag:t,part:i,id:t.type};this.onFragBuffered(A.Events.FRAG_BUFFERED,f),t.bitrateTest=!1}}},n.onFragBuffered=function(l,e){var t=e.frag,i=e.part,b=i?i.stats:t.stats;if(b.aborted)return;if(t.type!==S.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var _=b.parsing.end-b.loading.start;this.bwEstimator.sample(_,b.loaded),b.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},n.onError=function(l,e){switch(e.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},n.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},n.getNextABRAutoLevel=function(){var l=this.fragCurrent,e=this.partCurrent,t=this.hls,i=t.maxAutoLevel,b=t.config,_=t.minAutoLevel,p=t.media,y=e?e.duration:l?l.duration:0,m=p?p.currentTime:0,f=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():b.abrEwmaDefaultEstimate,a=(M.BufferHelper.bufferInfo(p,m,b.maxBufferHole).end-m)/f,o=this.findBestLevel(d,_,i,a,b.abrBandWidthFactor,b.abrBandWidthUpFactor);if(o>=0)return o;x.logger.trace((a?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var c=y?Math.min(y,b.maxStarvationDelay):b.maxStarvationDelay,h=b.abrBandWidthFactor,E=b.abrBandWidthUpFactor;if(!a){var R=this.bitrateTestDelay;if(R){var w=y?Math.min(y,b.maxLoadingDelay):b.maxLoadingDelay;c=w-R,x.logger.trace("bitrate test took "+Math.round(1e3*R)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*c)+" ms"),h=E=1}}return o=this.findBestLevel(d,_,i,a+c,h,E),Math.max(o,0)},n.findBestLevel=function(l,e,t,i,b,_){for(var p,y=this.fragCurrent,m=this.partCurrent,f=this.lastLoadedFragLevel,d=this.hls.levels,a=d[f],o=!!(a!=null&&(p=a.details)!==null&&p!==void 0&&p.live),c=a==null?void 0:a.codecSet,h=m?m.duration:y?y.duration:0,E=t;E>=e;E--){var R=d[E];if(!R||c&&R.codecSet!==c)continue;var w=R.details,P=(m?w==null?void 0:w.partTarget:w==null?void 0:w.averagetargetduration)||h,D=void 0;E<=f?D=b*l:D=_*l;var U=d[E].maxBitrate,I=U*P/D;if(x.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(D)+"/"+U+"/"+P+"/"+i+"/"+I),D>U&&(!I||o&&!this.bitrateTestDelay||I<i))return E}return-1},g(r,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,e=this.bwEstimator;if(l!==-1&&(!e||!e.canEstimate()))return l;var t=this.getNextABRAutoLevel();return l!==-1&&(t=Math.min(l,t)),t},set:function(l){this._nextAutoLevel=l}}]),r}();N.default=s},"./src/controller/audio-stream-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/polyfills/number.ts"),T=O("./src/controller/base-stream-controller.ts"),A=O("./src/events.ts"),M=O("./src/utils/buffer-helper.ts"),C=O("./src/controller/fragment-tracker.ts"),S=O("./src/types/level.ts"),x=O("./src/types/loader.ts"),v=O("./src/loader/fragment.ts"),g=O("./src/demux/chunk-cache.ts"),s=O("./src/demux/transmuxer-interface.ts"),r=O("./src/types/transmuxer.ts"),n=O("./src/controller/fragment-finders.ts"),u=O("./src/utils/discontinuities.ts"),l=O("./src/errors.ts"),e=O("./src/utils/logger.ts");function t(){return t=Object.assign||function(y){for(var m=1;m<arguments.length;m++){var f=arguments[m];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(y[d]=f[d])}return y},t.apply(this,arguments)}function i(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,b(y,m)}function b(y,m){return b=Object.setPrototypeOf||function(d,a){return d.__proto__=a,d},b(y,m)}var _=100,p=function(y){i(m,y);function m(d,a){var o;return o=y.call(this,d,a,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var f=m.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var a=this.hls;a.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(A.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.on(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(A.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(A.Events.ERROR,this.onError,this),a.on(A.Events.BUFFER_RESET,this.onBufferReset,this),a.on(A.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var a=this.hls;a.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(A.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.off(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(A.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(A.Events.ERROR,this.onError,this),a.off(A.Events.BUFFER_RESET,this.onBufferReset,this),a.off(A.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(a,o){var c=o.frag,h=o.id,E=o.initPTS;if(h==="main"){var R=c.cc;this.initPTS[c.cc]=E,this.log("InitPTS for cc: "+R+" found from main: "+E),this.videoTrackCC=R,this.state===T.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(a){if(!this.levels){this.startPosition=a,this.state=T.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,o>0&&a===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()},f.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var a,o=this.levels,c=this.trackId,h=o==null||((a=o[c])===null||a===void 0)?void 0:a.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var E,R=performance.now(),w=this.retryDate;(!w||R>=w||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var P=this.waitingData;if(P){var D=P.frag,U=P.part,I=P.cache,k=P.complete;if(this.initPTS[D.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var H=I.flush(),J={frag:D,part:U,payload:H,networkDetails:null};this._handleFragmentLoadProgress(J),k&&y.prototype._handleFragmentLoadComplete.call(this,J)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+D.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var $=this.getLoadPosition(),fe=M.BufferHelper.bufferInfo(this.mediaBuffer,$,this.config.maxBufferHole),he=Object(n.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,D);he<0&&(e.logger.log("Waiting fragment cc ("+D.cc+") @ "+D.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var a=this.waitingData;a&&(this.fragmentTracker.removeFragment(a.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},f.onTickEnd=function(){var a=this.media;if(!a||!a.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:a,c=o.buffered;!this.loadedmetadata&&c.length&&(this.loadedmetadata=!0),this.lastCurrentTime=a.currentTime},f.doTickIdle=function(){var a,o,c=this.hls,h=this.levels,E=this.media,R=this.trackId,w=c.config;if(!h||!h[R])return;if(!E&&(this.startFragRequested||!w.startFragPrefetch))return;var P=h[R],D=P.details;if(!D||D.live&&this.levelLastLoaded!==R||this.waitForCdnTuneIn(D)){this.state=T.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,x.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,x.PlaylistLevelType.AUDIO);if(U===null)return;var I=U.len,k=this.getMaxBufferLength(),H=this.audioSwitch;if(I>=k&&!H)return;if(!H&&this._streamEnded(U,D)){c.trigger(A.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var J=D.fragments,$=J[0].start,fe=U.end;if(H){var he=this.getLoadPosition();fe=he,D.PTSKnown&&he<$&&((U.end>$||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=$+.05))}var ce=this.getNextFragment(fe,D);if(!ce){this.bufferFlushed=!0;return}((a=ce.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((o=ce.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ce,D):this.loadFragment(ce,D,fe)},f.getMaxBufferLength=function(){var a=y.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,x.PlaylistLevelType.MAIN);return o===null?a:Math.max(a,o.len)},f.onMediaDetaching=function(){this.videoBuffer=null,y.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(a,o){var c=o.audioTracks;this.resetTransmuxer(),this.levels=c.map(function(h){return new S.Level(h)})},f.onAudioTrackSwitching=function(a,o){var c=!!o.url;this.trackId=o.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),c?this.setInterval(_):this.resetTransmuxer(),c?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(a,o){this.mainDetails=o.details},f.onAudioTrackLoaded=function(a,o){var c,h=this.levels,E=o.details,R=o.id;if(!h){this.warn("Audio tracks were reset while loading level "+R);return}this.log("Track "+R+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var w=h[R],P=0;if(E.live||(c=w.details)!==null&&c!==void 0&&c.live){var D=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!D)return;!w.details&&E.hasProgramDateTime&&D.hasProgramDateTime?(Object(u.alignMediaPlaylistByPDT)(E,D),P=E.fragments[0].start):P=this.alignPlaylists(E,w.details)}w.details=E,this.levelLastLoaded=R,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(w.details,P),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=T.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(a){var o,c=a.frag,h=a.part,E=a.payload,R=this.config,w=this.trackId,P=this.levels;if(!P){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var D=P[w];console.assert(D,"Audio track is defined on fragment load progress");var U=D.details;console.assert(U,"Audio track details are defined on fragment load progress");var I=R.defaultAudioCodec||D.audioCodec||"mp4a.40.2",k=this.transmuxer;k||(k=this.transmuxer=new s.default(this.hls,x.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var H=this.initPTS[c.cc],J=(o=c.initSegment)===null||o===void 0?void 0:o.data;if(H!==void 0){var $=!1,fe=h?h.index:-1,he=fe!==-1,ce=new r.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,E.byteLength,fe,he);k.push(E,J,I,"",c,h,U.totalduration,$,ce,H)}else{e.logger.log("Unknown video PTS for cc "+c.cc+", waiting for video PTS before demuxing audio frag "+c.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+w);var pe=this.waitingData=this.waitingData||{frag:c,part:h,cache:new g.default,complete:!1},_e=pe.cache;_e.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(a){if(this.waitingData){this.waitingData.complete=!0;return}y.prototype._handleFragmentLoadComplete.call(this,a)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(a,o){var c=o.tracks.audio;c&&(this.mediaBuffer=c.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},f.onFragBuffered=function(a,o){var c=o.frag,h=o.part;if(c.type!==x.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(h?" p: "+h.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}c.sn!=="initSegment"&&(this.fragPrevious=c,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(c,h)},f.onError=function(a,o){switch(o.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(x.PlaylistLevelType.AUDIO,o);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=o.fatal?T.State.ERROR:T.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var c=!0,h=this.getFwdBufferInfo(this.mediaBuffer,x.PlaylistLevelType.AUDIO);h&&h.len>.5&&(c=!this.reduceMaxBufferLength(h.len)),c&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(a,o){var c=o.type;c===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(a){var o,c="audio",h=this.hls,E=a.remuxResult,R=a.chunkMeta,w=this.getCurrentContext(R);if(!w){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var P=w.frag,D=w.part,U=E.audio,I=E.text,k=E.id3,H=E.initSegment;if(this.fragContextChanged(P))return;if(this.state=T.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),H!=null&&H.tracks&&(this._bufferInitSegment(H.tracks,P,R),h.trigger(A.Events.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:c,tracks:H.tracks})),U){var J=U.startPTS,$=U.endPTS,fe=U.startDTS,he=U.endDTS;D&&(D.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:J,endPTS:$,startDTS:fe,endDTS:he}),P.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,J,$,fe,he),this.bufferFragmentData(U,P,D,R)}if(k!=null&&(o=k.samples)!==null&&o!==void 0&&o.length){var ce=t({frag:P,id:c},k);h.trigger(A.Events.FRAG_PARSING_METADATA,ce)}if(I){var pe=t({frag:P,id:c},I);h.trigger(A.Events.FRAG_PARSING_USERDATA,pe)}},f._bufferInitSegment=function(a,o,c){if(this.state!==T.State.PARSING)return;a.video&&delete a.video;var h=a.audio;if(!h)return;h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(A.Events.BUFFER_CODECS,a);var E=h.initSegment;if(E!=null&&E.byteLength){var R={type:"audio",frag:o,part:null,chunkMeta:c,parent:o.type,data:E};this.hls.trigger(A.Events.BUFFER_APPENDING,R)}this.tick()},f.loadFragment=function(a,o,c){var h=this.fragmentTracker.getState(a);this.fragCurrent=a,(this.audioSwitch||h===C.FragmentState.NOT_LOADED||h===C.FragmentState.PARTIAL)&&(a.sn==="initSegment"?this._loadInitSegment(a):o.live&&!Object(L.isFiniteNumber)(this.initPTS[a.cc])?(this.log("Waiting for video PTS in continuity counter "+a.cc+" of live stream before loading audio fragment "+a.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,a,o,c)))},f.completeAudioSwitch=function(){var a=this.hls,o=this.media,c=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,a.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:c})},m}(T.default);N.default=p},"./src/controller/audio-track-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts"),T=O("./src/errors.ts"),A=O("./src/controller/base-playlist-controller.ts"),M=O("./src/types/loader.ts");function C(s,r){for(var n=0;n<r.length;n++){var u=r[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,u.key,u)}}function S(s,r,n){return r&&C(s.prototype,r),n&&C(s,n),s}function x(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,v(s,r)}function v(s,r){return v=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},v(s,r)}var g=function(s){x(r,s);function r(u){var l;return l=s.call(this,u,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var n=r.prototype;return n.registerListeners=function(){var l=this.hls;l.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(L.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var l=this.hls;l.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(L.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,s.prototype.destroy.call(this)},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},n.onManifestParsed=function(l,e){this.tracks=e.audioTracks||[]},n.onAudioTrackLoaded=function(l,e){var t=e.id,i=e.details,b=this.tracksInGroup[t];if(!b){this.warn("Invalid audio track id "+t);return}var _=b.details;b.details=e.details,this.log("audioTrack "+t+" loaded ["+i.startSN+"-"+i.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,e,_))},n.onLevelLoading=function(l,e){this.switchLevel(e.level)},n.onLevelSwitching=function(l,e){this.switchLevel(e.level)},n.switchLevel=function(l){var e=this.hls.levels[l];if(!(e!=null&&e.audioGroupIds))return;var t=e.audioGroupIds[e.urlId];if(this.groupId!==t){this.groupId=t;var i=this.tracks.filter(function(_){return!t||_.groupId===t});this.selectDefaultTrack&&!i.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var b={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(L.Events.AUDIO_TRACKS_UPDATED,b),this.selectInitialTrack()}},n.onError=function(l,e){if(s.prototype.onError.call(this,l,e),e.fatal||!e.context)return;e.context.type===M.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},n.setAudioTrack=function(l){var e=this.tracksInGroup;if(l<0||l>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=e[this.trackId];this.log("Now switching to audio-track index "+l);var i=e[l],b=i.id,_=i.groupId,p=_===void 0?"":_,y=i.name,m=i.type,f=i.url;if(this.trackId=l,this.trackName=y,this.selectDefaultTrack=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHING,{id:b,groupId:p,name:y,type:m,url:f}),i.details&&!i.details.live)return;var d=this.switchParams(i.url,t==null?void 0:t.details);this.loadPlaylist(d)},n.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,t=this.findTrackId(e)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},n.findTrackId=function(l){for(var e=this.tracksInGroup,t=0;t<e.length;t++){var i=e[t];if((!this.selectDefaultTrack||i.default)&&(!l||l===i.name))return i.id}return-1},n.loadPlaylist=function(l){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var t=e.id,i=e.groupId,b=e.url;if(l)try{b=l.addDirectives(b)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+t),this.clearTimer(),this.hls.trigger(L.Events.AUDIO_TRACK_LOADING,{url:b,id:t,groupId:i,deliveryDirectives:l||null})}},S(r,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),r}(A.default);N.default=g},"./src/controller/base-playlist-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return S});var L=O("./src/polyfills/number.ts"),T=O("./src/types/level.ts"),A=O("./src/controller/level-helper.ts"),M=O("./src/utils/logger.ts"),C=O("./src/errors.ts"),S=function(){function x(g,s){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=M.logger.log.bind(M.logger,s+":"),this.warn=M.logger.warn.bind(M.logger,s+":"),this.hls=g}var v=x.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(s,r){r.fatal&&r.type===C.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(s,r){var n=r==null?void 0:r.renditionReports;if(n)for(var u=0;u<n.length;u++){var l=n[u],e=""+l.URI;if(e===s.substr(-e.length)){var t=parseInt(l["LAST-MSN"]),i=parseInt(l["LAST-PART"]);if(r&&this.hls.config.lowLatencyMode){var b=Math.min(r.age-r.partTarget,r.targetduration);i!==void 0&&b>r.partTarget&&(i+=1)}if(Object(L.isFiniteNumber)(t))return new T.HlsUrlParameters(t,Object(L.isFiniteNumber)(i)?i:void 0,T.HlsSkip.No)}}},v.loadPlaylist=function(s){},v.shouldLoadTrack=function(s){return this.canLoad&&s&&!!s.url&&(!s.details||s.details.live)},v.playlistLoaded=function(s,r,n){var u=this,l=r.details,e=r.stats,t=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(l.advancedDateTime=Date.now()-t,l.live||n!=null&&n.live){if(l.reloaded(n),n&&this.log("live playlist "+s+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),n&&l.fragments.length>0&&Object(A.mergeDetails)(n,l),!this.canLoad||!l.live)return;var i,b=void 0,_=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var p=this.hls.config.lowLatencyMode,y=l.lastPartSn,m=l.endSN,f=l.lastPartIndex,d=f!==-1,a=y===m,o=p?0:f;d?(b=a?m+1:y,_=a?o:f+1):b=m+1;var c=l.age,h=c+l.ageHeader,E=Math.min(h-l.partTarget,l.targetduration*1.5);if(E>0){if(n&&E>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+E+" with playlist age: "+l.age),E=0;else{var R=Math.floor(E/l.targetduration);if(b+=R,_!==void 0){var w=Math.round(E%l.targetduration/l.partTarget);_+=w}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+c.toFixed(2)+"s goal: "+E+" skip sn "+R+" to part "+_)}l.tuneInGoal=E}if(i=this.getDeliveryDirectives(l,r.deliveryDirectives,b,_),p||!a){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(l,r.deliveryDirectives,b,_);var P=Object(A.computeReloadInterval)(l,e);b!==void 0&&l.canBlockReload&&(P-=l.partTarget||1),this.log("reload live playlist "+s+" in "+Math.round(P)+" ms"),this.timer=self.setTimeout(function(){return u.loadPlaylist(i)},P)}else this.clearTimer()},v.getDeliveryDirectives=function(s,r,n,u){var l=Object(T.getSkipValue)(s,n);return r!=null&&r.skip&&s.deltaUpdateFailed&&(n=r.msn,u=r.part,l=T.HlsSkip.No),new T.HlsUrlParameters(n,u,l)},v.retryLoadingOrFail=function(s){var r=this,n=this.hls.config,u=this.retryCount<n.levelLoadingMaxRetry;if(u){var l;if(this.retryCount++,s.details.indexOf("LoadTimeOut")>-1&&(l=s.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+s.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return r.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+s.details+'"')}}else this.warn('cannot recover from error "'+s.details+'"'),this.clearTimer(),s.fatal=!0;return u},x}()},"./src/controller/base-stream-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"State",function(){return m}),O.d(N,"default",function(){return f});var L=O("./src/polyfills/number.ts"),T=O("./src/task-loop.ts"),A=O("./src/controller/fragment-tracker.ts"),M=O("./src/utils/buffer-helper.ts"),C=O("./src/utils/logger.ts"),S=O("./src/events.ts"),x=O("./src/errors.ts"),v=O("./src/types/transmuxer.ts"),g=O("./src/utils/mp4-tools.ts"),s=O("./src/utils/discontinuities.ts"),r=O("./src/controller/fragment-finders.ts"),n=O("./src/controller/level-helper.ts"),u=O("./src/loader/fragment-loader.ts"),l=O("./src/crypt/decrypter.ts"),e=O("./src/utils/time-ranges.ts"),t=O("./src/types/loader.ts");function i(d,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(d,c.key,c)}}function b(d,a,o){return a&&i(d.prototype,a),o&&i(d,o),d}function _(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function p(d,a){d.prototype=Object.create(a.prototype),d.prototype.constructor=d,y(d,a)}function y(d,a){return y=Object.setPrototypeOf||function(c,h){return c.__proto__=h,c},y(d,a)}var m={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"},f=function(d){p(a,d);function a(c,h,E){var R;return R=d.call(this)||this,R.hls=void 0,R.fragPrevious=null,R.fragCurrent=null,R.fragmentTracker=void 0,R.transmuxer=null,R._state=m.STOPPED,R.media=void 0,R.mediaBuffer=void 0,R.config=void 0,R.bitrateTest=!1,R.lastCurrentTime=0,R.nextLoadPosition=0,R.startPosition=0,R.loadedmetadata=!1,R.fragLoadError=0,R.retryDate=0,R.levels=null,R.fragmentLoader=void 0,R.levelLastLoaded=null,R.startFragRequested=!1,R.decrypter=void 0,R.initPTS=[],R.onvseeking=null,R.onvended=null,R.logPrefix="",R.log=void 0,R.warn=void 0,R.logPrefix=E,R.log=C.logger.log.bind(C.logger,E+":"),R.warn=C.logger.warn.bind(C.logger,E+":"),R.hls=c,R.fragmentLoader=new u.default(c.config),R.fragmentTracker=h,R.config=c.config,R.decrypter=new l.default(c,c.config),c.on(S.Events.KEY_LOADED,R.onKeyLoaded,_(R)),R}var o=a.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(h){},o.stopLoad=function(){this.fragmentLoader.abort();var h=this.fragCurrent;h&&this.fragmentTracker.removeFragment(h),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=m.STOPPED},o._streamEnded=function(h,E){var R=this.fragCurrent,w=this.fragmentTracker;if(!E.live&&R&&R.sn===E.endSN&&!h.nextStart){var P=w.getState(R);return P===A.FragmentState.PARTIAL||P===A.FragmentState.OK}return!1},o.onMediaAttached=function(h,E){var R=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),R.addEventListener("seeking",this.onvseeking),R.addEventListener("ended",this.onvended);var w=this.config;this.levels&&w.autoStartLoad&&this.state===m.STOPPED&&this.startLoad(w.startPosition)},o.onMediaDetaching=function(){var h=this.media;h!=null&&h.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),h&&(h.removeEventListener("seeking",this.onvseeking),h.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var h=this.config,E=this.fragCurrent,R=this.media,w=this.mediaBuffer,P=this.state,D=R?R.currentTime:0,U=M.BufferHelper.bufferInfo(w||R,D,h.maxBufferHole);if(this.log("media seeking to "+(Object(L.isFiniteNumber)(D)?D.toFixed(3):D)+", state: "+P),P===m.ENDED)this.resetLoadingState();else if(E&&!U.len){var I=h.maxFragLookUpTolerance,k=E.start-I,H=E.start+E.duration+I,J=D>H;(D<k||J)&&(J&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}R&&(this.lastCurrentTime=D),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=D),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(h,E){if(this.state!==m.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=m.IDLE;var R=this.levels[E.frag.level].details;R&&this.loadFragment(E.frag,R,E.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),d.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=m.STOPPED,this.hls.off(S.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,d.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(h,E){this.log("Loading key for "+h.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=m.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(S.Events.KEY_LOADING,{frag:h})},o.loadFragment=function(h,E,R){this._loadFragForPlayback(h,E,R)},o._loadFragForPlayback=function(h,E,R){var w=this,P=function(U){if(w.fragContextChanged(h)){w.warn("Fragment "+h.sn+(U.part?" p: "+U.part.index:"")+" of level "+h.level+" was dropped during download."),w.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,w._handleFragmentLoadProgress(U)};this._doFragLoad(h,E,R,P).then(function(D){if(!D)return;w.fragLoadError=0;var U=w.state;if(w.fragContextChanged(h)){(U===m.FRAG_LOADING||U===m.BACKTRACKING||!w.fragCurrent&&U===m.PARSING)&&(w.fragmentTracker.removeFragment(h),w.state=m.IDLE);return}if("payload"in D&&(w.log("Loaded fragment "+h.sn+" of level "+h.level),w.hls.trigger(S.Events.FRAG_LOADED,D),w.state===m.BACKTRACKING)){w.fragmentTracker.backtrack(h,D),w.resetFragmentLoading(h);return}w._handleFragmentLoadComplete(D)}).catch(function(D){w.warn(D),w.resetFragmentLoading(h)})},o.flushMainBuffer=function(h,E,R){if(R===void 0&&(R=null),!(h-E))return;var w={startOffset:h,endOffset:E,type:R};this.fragLoadError=0,this.hls.trigger(S.Events.BUFFER_FLUSHING,w)},o._loadInitSegment=function(h){var E=this;this._doFragLoad(h).then(function(R){if(!R||E.fragContextChanged(h)||!E.levels)throw new Error("init load aborted");return R}).then(function(R){var w=E.hls,P=R.payload,D=h.decryptdata;if(P&&P.byteLength>0&&D&&D.key&&D.iv&&D.method==="AES-128"){var U=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(P),D.key.buffer,D.iv.buffer).then(function(I){var k=self.performance.now();return w.trigger(S.Events.FRAG_DECRYPTED,{frag:h,payload:I,stats:{tstart:U,tdecrypt:k}}),R.payload=I,R})}return R}).then(function(R){var w=E.fragCurrent,P=E.hls,D=E.levels;if(!D)throw new Error("init load aborted, missing levels");var U=D[h.level].details;console.assert(U,"Level details are defined when init segment is loaded");var I=h.stats;E.state=m.IDLE,E.fragLoadError=0,h.data=new Uint8Array(R.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),R.frag===w&&P.trigger(S.Events.FRAG_BUFFERED,{stats:I,frag:w,part:null,id:h.type}),E.tick()}).catch(function(R){E.warn(R),E.resetFragmentLoading(h)})},o.fragContextChanged=function(h){var E=this.fragCurrent;return!h||!E||h.level!==E.level||h.sn!==E.sn||h.urlId!==E.urlId},o.fragBufferedComplete=function(h,E){var R=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+e.default.toString(M.BufferHelper.getBuffered(R))),this.state=m.IDLE,this.tick()},o._handleFragmentLoadComplete=function(h){var E=this.transmuxer;if(!E)return;var R=h.frag,w=h.part,P=h.partsLoaded,D=!P||P.length===0||P.some(function(I){return!I}),U=new v.ChunkMetadata(R.level,R.sn,R.stats.chunkCount+1,0,w?w.index:-1,!D);E.flush(U)},o._handleFragmentLoadProgress=function(h){},o._doFragLoad=function(h,E,R,w){var P=this;if(R===void 0&&(R=null),!this.levels)throw new Error("frag load aborted, missing levels");if(R=Math.max(h.start,R||0),this.config.lowLatencyMode&&E){var D=E.partList;if(D&&w){R>h.end&&E.fragmentHint&&(h=E.fragmentHint);var U=this.getNextPart(D,h,R);if(U>-1){var I=D[U];return this.log("Loading part sn: "+h.sn+" p: "+I.index+" cc: "+h.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+U+"-"+(D.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(R.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=m.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:h,part:D[U],targetBufferTime:R}),this.doFragPartsLoad(h,D,U,w).catch(function(k){return P.handleFragLoadError(k)})}else if(!h.url||this.loadedEndOfParts(D,R))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(R.toFixed(3))),Object(L.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=m.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:h,targetBufferTime:R}),this.fragmentLoader.load(h,w).catch(function(k){return P.handleFragLoadError(k)})},o.doFragPartsLoad=function(h,E,R,w){var P=this;return new Promise(function(D,U){var I=[],k=function H(J){var $=E[J];P.fragmentLoader.loadPart(h,$,w).then(function(fe){I[$.index]=fe;var he=fe.part;P.hls.trigger(S.Events.FRAG_LOADED,fe);var ce=E[J+1];if(ce&&ce.fragment===h)H(J+1);else return D({frag:h,part:he,partsLoaded:I})}).catch(U)};k(R)})},o.handleFragLoadError=function(h){var E=h.data;return E&&E.details===x.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(S.Events.ERROR,E),null},o._handleTransmuxerFlush=function(h){var E=this.getCurrentContext(h);if(!E||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var R=E.frag,w=E.part,P=E.level,D=self.performance.now();R.stats.parsing.end=D,w&&(w.stats.parsing.end=D),this.updateLevelTiming(R,w,P,h.partial)},o.getCurrentContext=function(h){var E=this.levels,R=h.level,w=h.sn,P=h.part;if(!E||!E[R])return this.warn("Levels object was unset while buffering fragment "+w+" of level "+R+". The current chunk will not be buffered."),null;var D=E[R],U=P>-1?Object(n.getPartWith)(D,w,P):null,I=U?U.fragment:Object(n.getFragmentWithSN)(D,w,this.fragCurrent);return I?{frag:I,part:U,level:D}:null},o.bufferFragmentData=function(h,E,R,w){if(!h||this.state!==m.PARSING)return;var P=h.data1,D=h.data2,U=P;if(P&&D&&(U=Object(g.appendUint8Array)(P,D)),!U||!U.length)return;var I={type:h.type,frag:E,part:R,chunkMeta:w,parent:E.type,data:U};this.hls.trigger(S.Events.BUFFER_APPENDING,I),h.dropped&&h.independent&&!R&&this.flushBufferGap(E)},o.flushBufferGap=function(h){var E=this.media;if(!E)return;if(!M.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,h.start);return}var R=E.currentTime,w=M.BufferHelper.bufferInfo(E,R,0),P=h.duration,D=Math.min(this.config.maxFragLookUpTolerance*2,P*.25),U=Math.max(Math.min(h.start-D,w.end-D),R+D);h.start-U>D&&this.flushMainBuffer(U,h.start)},o.getFwdBufferInfo=function(h,E){var R=this.config,w=this.getLoadPosition();if(!Object(L.isFiniteNumber)(w))return null;var P=M.BufferHelper.bufferInfo(h,w,R.maxBufferHole);if(P.len===0&&P.nextStart!==void 0){var D=this.fragmentTracker.getBufferedFrag(w,E);if(D&&P.nextStart<D.end)return M.BufferHelper.bufferInfo(h,w,Math.max(P.nextStart,R.maxBufferHole))}return P},o.getMaxBufferLength=function(h){var E=this.config,R;return h?R=Math.max(8*E.maxBufferSize/h,E.maxBufferLength):R=E.maxBufferLength,Math.min(R,E.maxMaxBufferLength)},o.reduceMaxBufferLength=function(h){var E=this.config,R=h||E.maxBufferLength;return E.maxMaxBufferLength>=R?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(h,E){var R,w,P=E.fragments,D=P.length;if(!D)return null;var U=this.config,I=P[0].start,k;if(E.live){var H=U.initialLiveManifestSize;if(D<H)return this.warn("Not enough fragments to start playback (have: "+D+", need: "+H+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(k=this.getInitialLiveFragment(E,P),this.startPosition=k?this.hls.liveSyncPosition||k.start:h)}else h<=I&&(k=P[0]);if(!k){var J=U.lowLatencyMode?E.partEnd:E.fragmentEnd;k=this.getFragmentAtPosition(h,J,E)}return(R=k)!==null&&R!==void 0&&R.initSegment&&!((w=k)!==null&&w!==void 0&&w.initSegment.data)&&!this.bitrateTest&&(k=k.initSegment),k},o.getNextPart=function(h,E,R){for(var w=-1,P=!1,D=!0,U=0,I=h.length;U<I;U++){var k=h[U];if(D=D&&!k.independent,w>-1&&R<k.start)break;var H=k.loaded;!H&&(P||k.independent||D)&&k.fragment===E&&(w=U),P=H}return w},o.loadedEndOfParts=function(h,E){var R=h[h.length-1];return R&&E>R.start&&R.loaded},o.getInitialLiveFragment=function(h,E){var R=this.fragPrevious,w=null;if(R){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),w=Object(r.findFragmentByPDT)(E,R.endProgramDateTime,this.config.maxFragLookUpTolerance)),!w){var P=R.sn+1;if(P>=h.startSN&&P<=h.endSN){var D=E[P-h.startSN];R.cc===D.cc&&(w=D,this.log("Live playlist, switching playlist, load frag with next SN: "+w.sn))}w||(w=Object(r.findFragWithCC)(E,R.cc),w&&this.log("Live playlist, switching playlist, load frag with same CC: "+w.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(w=this.getFragmentAtPosition(U,this.bitrateTest?h.fragmentEnd:h.edge,h))}return w},o.getFragmentAtPosition=function(h,E,R){var w=this.config,P=this.fragPrevious,D=R.fragments,U=R.endSN,I=R.fragmentHint,k=w.maxFragLookUpTolerance,H=!!(w.lowLatencyMode&&R.partList&&I);H&&I&&!this.bitrateTest&&(D=D.concat(I),U=I.sn);var J;if(h<E){var $=h>E-k?0:k;J=Object(r.findFragmentByPTS)(P,D,h,$)}else J=D[D.length-1];if(J){var fe=J.sn-R.startSN,he=P&&J.level===P.level,ce=D[fe+1],pe=this.fragmentTracker.getState(J);if(pe===A.FragmentState.BACKTRACKED){J=null;for(var _e=fe;D[_e]&&this.fragmentTracker.getState(D[_e])===A.FragmentState.BACKTRACKED;)P?J=D[_e--]:J=D[--_e];J||(J=ce)}else P&&J.sn===P.sn&&!H&&(he&&(J.sn<U&&this.fragmentTracker.getState(ce)!==A.FragmentState.OK?(this.log("SN "+J.sn+" just loaded, load next one: "+ce.sn),J=ce):J=null))}return J},o.synchronizeToLiveEdge=function(h){var E=this.config,R=this.media;if(!R)return;var w=this.hls.liveSyncPosition,P=R.currentTime,D=h.fragments[0].start,U=h.edge,I=P>=D-E.maxFragLookUpTolerance&&P<=U;if(w!==null&&R.duration>w&&(P<w||!I)){var k=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*h.targetduration;(!I&&R.readyState<4||P<U-k)&&(this.loadedmetadata||(this.nextLoadPosition=w),R.readyState&&(this.warn("Playback: "+P.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+w.toFixed(3)),R.currentTime=w))}},o.alignPlaylists=function(h,E){var R=this.levels,w=this.levelLastLoaded,P=this.fragPrevious,D=w!==null?R[w]:null,U=h.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var I=h.fragments[0].start,k=!E,H=h.alignedSliding&&Object(L.isFiniteNumber)(I);if(k||!H&&!I){Object(s.alignStream)(P,D,h);var J=h.fragments[0].start;return this.log("Live playlist sliding: "+J.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+h.startSN+" prev-sn: "+(P?P.sn:"na")+" fragments: "+U),J}return I},o.waitForCdnTuneIn=function(h){var E=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*E)},o.setStartPosition=function(h,E){var R=this.startPosition;if(R<E&&(R=-1),R===-1||this.lastCurrentTime===-1){var w=h.startTimeOffset;Object(L.isFiniteNumber)(w)?(R=E+w,w<0&&(R+=h.totalduration),R=Math.min(Math.max(E,R),E+h.totalduration),this.log("Start time offset "+w+" found in playlist, adjust startPosition to "+R),this.startPosition=R):h.live?R=this.hls.liveSyncPosition||E:this.startPosition=R=0,this.lastCurrentTime=R}this.nextLoadPosition=R},o.getLoadPosition=function(){var h=this.media,E=0;return this.loadedmetadata&&h?E=h.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},o.handleFragLoadAborted=function(h,E){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(E?" part"+E.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},o.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=m.IDLE)},o.onFragmentOrKeyLoadError=function(h,E){if(E.fatal)return;var R=E.frag;if(!R||R.type!==h)return;var w=this.fragCurrent;console.assert(w&&R.sn===w.sn&&R.level===w.level&&R.urlId===w.urlId,"Frag load error must match current frag to retry");var P=this.config;if(this.fragLoadError+1<=P.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(R.level))return;var D=Math.min(Math.pow(2,this.fragLoadError)*P.fragLoadingRetryDelay,P.fragLoadingMaxRetryTimeout);this.warn("Fragment "+R.sn+" of "+h+" "+R.level+" failed to load, retrying in "+D+"ms"),this.retryDate=self.performance.now()+D,this.fragLoadError++,this.state=m.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(h===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=m.IDLE):(C.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=m.ERROR)},o.afterBufferFlushed=function(h,E,R){if(!h)return;var w=M.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(E,w,R),this.state===m.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=m.IDLE},o.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[h].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(h,E,R,w){var P=this,D=R.details;console.assert(!!D,"level.details must be defined");var U=Object.keys(h.elementaryStreams).reduce(function(I,k){var H=h.elementaryStreams[k];if(H){var J=H.endPTS-H.startPTS;if(J<=0)return P.warn("Could not parse fragment "+h.sn+" "+k+" duration reliably ("+J+") resetting transmuxer to fallback to playlist timing"),P.resetTransmuxer(),I||!1;var $=w?0:Object(n.updateFragPTSDTS)(D,h,H.startPTS,H.endPTS,H.startDTS,H.endDTS);return P.hls.trigger(S.Events.LEVEL_PTS_UPDATED,{details:D,level:R,drift:$,type:k,frag:h,start:H.startPTS,end:H.endPTS}),!0}return I},!1);U?(this.state=m.PARSED,this.hls.trigger(S.Events.FRAG_PARSED,{frag:h,part:E})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},b(a,[{key:"state",get:function(){return this._state},set:function(h){var E=this._state;E!==h&&(this._state=h,this.log(E+"->"+h))}}]),a}(T.default)},"./src/controller/buffer-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return r});var L=O("./src/polyfills/number.ts"),T=O("./src/events.ts"),A=O("./src/utils/logger.ts"),M=O("./src/errors.ts"),C=O("./src/utils/buffer-helper.ts"),S=O("./src/utils/mediasource-helper.ts"),x=O("./src/loader/fragment.ts"),v=O("./src/controller/buffer-operation-queue.ts"),g=Object(S.getMediaSource)(),s=/([ha]vc.)(?:\.[^.,]+)+/,r=function(){function n(l){var e=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 t=e.hls,i=e.media,b=e.mediaSource;A.logger.log("[buffer-controller]: Media source opened"),i&&(e.updateMediaElementDuration(),t.trigger(T.Events.MEDIA_ATTACHED,{media:i})),b&&b.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){A.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){A.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var u=n.prototype;return u.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},u.destroy=function(){this.unregisterListeners(),this.details=null},u.registerListeners=function(){var e=this.hls;e.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(T.Events.BUFFER_RESET,this.onBufferReset,this),e.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(T.Events.BUFFER_EOS,this.onBufferEos,this),e.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(T.Events.FRAG_PARSED,this.onFragParsed,this),e.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},u.unregisterListeners=function(){var e=this.hls;e.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(T.Events.BUFFER_RESET,this.onBufferReset,this),e.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(T.Events.BUFFER_EOS,this.onBufferEos,this),e.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(T.Events.FRAG_PARSED,this.onFragParsed,this),e.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},u._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},u.onManifestParsed=function(e,t){var i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,A.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(e,t){var i=this.media=t.media;if(i&&g){var b=this.mediaSource=new g;b.addEventListener("sourceopen",this._onMediaSourceOpen),b.addEventListener("sourceended",this._onMediaSourceEnded),b.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(b),this._objectUrl=i.src}},u.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,i=this._objectUrl;if(t){if(A.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(b){A.logger.warn("[buffer-controller]: onMediaDetaching: "+b.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):A.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(T.Events.MEDIA_DETACHED,void 0)},u.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(t){var i=e.sourceBuffer[t];try{i&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(i),e.sourceBuffer[t]=void 0)}catch(b){A.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",b)}}),this._initSourceBuffer()},u.onBufferCodecs=function(e,t){var i=this,b=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(_){if(b){var p=i.tracks[_];if(p&&typeof p.buffer.changeType=="function"){var y=t[_],m=y.codec,f=y.levelCodec,d=y.container,a=(p.levelCodec||p.codec).replace(s,"$1"),o=(f||m).replace(s,"$1");if(a!==o){var c=d+";codecs="+(f||m);i.appendChangeType(_,c)}}}else i.pendingTracks[_]=t[_]}),b)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},u.appendChangeType=function(e,t){var i=this,b=this.operationQueue,_={execute:function(){var y=i.sourceBuffer[e];y&&(A.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),y.changeType(t)),b.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(y){A.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",y)}};b.append(_,e)},u.onBufferAppending=function(e,t){var i=this,b=this.hls,_=this.operationQueue,p=this.tracks,y=t.data,m=t.type,f=t.frag,d=t.part,a=t.chunkMeta,o=a.buffering[m],c=self.performance.now();o.start=c;var h=f.stats.buffering,E=d?d.stats.buffering:null;h.start===0&&(h.start=c),E&&E.start===0&&(E.start=c);var R=p.audio,w=m==="audio"&&a.id===1&&(R==null?void 0:R.container)==="audio/mpeg",P={execute:function(){if(o.executeStart=self.performance.now(),w){var U=i.sourceBuffer[m];if(U){var I=f.start-U.timestampOffset;Math.abs(I)>=.1&&(A.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+I+") sn: "+f.sn+")"),U.timestampOffset=f.start)}}i.appendExecutor(y,m)},onStart:function(){},onComplete:function(){var U=self.performance.now();o.executeEnd=o.end=U,h.first===0&&(h.first=U),E&&E.first===0&&(E.first=U);var I=i.sourceBuffer,k={};for(var H in I)k[H]=C.BufferHelper.getBuffered(I[H]);i.appendError=0,i.hls.trigger(T.Events.BUFFER_APPENDED,{type:m,frag:f,part:d,chunkMeta:a,parent:f.type,timeRanges:k})},onError:function(U){A.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",U);var I={type:M.ErrorTypes.MEDIA_ERROR,parent:f.type,details:M.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=M.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,I.details=M.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>b.config.appendErrorMaxRetry&&(A.logger.error("[buffer-controller]: Failed "+b.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),b.trigger(T.Events.ERROR,I)}};_.append(P,m)},u.onBufferFlushing=function(e,t){var i=this,b=this.operationQueue,_=function(y){return{execute:i.removeExecutor.bind(i,y,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(T.Events.BUFFER_FLUSHED,{type:y})},onError:function(f){A.logger.warn("[buffer-controller]: Failed to remove from "+y+" SourceBuffer",f)}}};t.type?b.append(_(t.type),t.type):this.getSourceBufferTypes().forEach(function(p){b.append(_(p),p)})},u.onFragParsed=function(e,t){var i=this,b=t.frag,_=t.part,p=[],y=_?_.elementaryStreams:b.elementaryStreams;y[x.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(y[x.ElementaryStreamTypes.AUDIO]&&p.push("audio"),y[x.ElementaryStreamTypes.VIDEO]&&p.push("video"));var m=function(){var d=self.performance.now();b.stats.buffering.end=d,_&&(_.stats.buffering.end=d);var a=_?_.stats:b.stats;i.hls.trigger(T.Events.FRAG_BUFFERED,{frag:b,part:_,stats:a,id:b.type})};p.length===0&&A.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+b.type+" level: "+b.level+" sn: "+b.sn),this.blockBuffers(m,p)},u.onFragChanged=function(e,t){this.flushBackBuffer()},u.onBufferEos=function(e,t){var i=this,b=this.getSourceBufferTypes().reduce(function(_,p){var y=i.sourceBuffer[p];return(!t.type||t.type===p)&&(y&&!y.ended&&(y.ended=!0,A.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),_&&!!(!y||y.ended)},!0);b&&this.blockBuffers(function(){var _=i.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},u.onLevelUpdated=function(e,t){var i=t.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},u.flushBackBuffer=function(){var e=this.hls,t=this.details,i=this.media,b=this.sourceBuffer;if(!i||t===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var p=t.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(L.isFiniteNumber)(p)||p<0)return;var y=i.currentTime,m=t.levelTargetDuration,f=Math.max(p,m),d=Math.floor(y/m)*m-f;_.forEach(function(a){var o=b[a];if(o){var c=C.BufferHelper.getBuffered(o);c.length>0&&d>c.start(0)&&(e.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live&&e.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),e.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:a}))}})},u.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,t=this.hls,i=this.media,b=this.mediaSource,_=e.fragments[0].start+e.totalduration,p=i.duration,y=Object(L.isFiniteNumber)(b.duration)?b.duration:0;e.live&&t.config.liveDurationInfinity?(A.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),b.duration=Infinity,this.updateSeekableRange(e)):(_>y&&_>p||!Object(L.isFiniteNumber)(p))&&(A.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),b.duration=_)},u.updateSeekableRange=function(e){var t=this.mediaSource,i=e.fragments,b=i.length;if(b&&e.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var _=Math.max(0,i[0].start),p=Math.max(_,_+e.totalduration);t.setLiveSeekableRange(_,p)}},u.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,i=this.pendingTracks,b=Object.keys(i).length;if(b&&!e||b===2){this.createSourceBuffers(i),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(T.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(p){t.executeNext(p)})}},u.createSourceBuffers=function(e){var t=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var b=0;for(var _ in e)if(!t[_]){var p=e[_];if(!p)throw Error("source buffer exists for track "+_+", however track does not");var y=p.levelCodec||p.codec,m=p.container+";codecs="+y;A.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var f=t[_]=i.addSourceBuffer(m),d=_;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[_]={buffer:f,codec:y,container:p.container,levelCodec:p.levelCodec,id:p.id},b++}catch(a){A.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+a.message),this.hls.trigger(T.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,mimeType:m})}}b&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},u._onSBUpdateStart=function(e){var t=this.operationQueue,i=t.current(e);i.onStart()},u._onSBUpdateEnd=function(e){var t=this.operationQueue,i=t.current(e);i.onComplete(),t.shiftAndExecuteNext(e)},u._onSBUpdateError=function(e,t){A.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(T.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(e);i&&i.onError(t)},u.removeExecutor=function(e,t,i){var b=this.media,_=this.mediaSource,p=this.operationQueue,y=this.sourceBuffer,m=y[e];if(!b||!_||!m){A.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(e);return}var f=Object(L.isFiniteNumber)(b.duration)?b.duration:Infinity,d=Object(L.isFiniteNumber)(_.duration)?_.duration:Infinity,a=Math.max(0,t),o=Math.min(i,f,d);o>a?(A.logger.log("[buffer-controller]: Removing ["+a+","+o+"] from the "+e+" SourceBuffer"),console.assert(!m.updating,e+" sourceBuffer must not be updating"),m.remove(a,o)):p.shiftAndExecuteNext(e)},u.appendExecutor=function(e,t){var i=this.operationQueue,b=this.sourceBuffer,_=b[t];if(!_){A.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(t);return}_.ended=!1,console.assert(!_.updating,t+" sourceBuffer must not be updating"),_.appendBuffer(e)},u.blockBuffers=function(e,t){var i=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){A.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var b=this.operationQueue,_=t.map(function(p){return b.appendBlocker(p)});Promise.all(_).then(function(){e(),t.forEach(function(p){var y=i.sourceBuffer[p];(!y||!y.updating)&&b.shiftAndExecuteNext(p)})})},u.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},u.addBufferListener=function(e,t,i){var b=this.sourceBuffer[e];if(!b)return;var _=i.bind(this,e);this.listeners[e].push({event:t,listener:_}),b.addEventListener(t,_)},u.removeBufferListeners=function(e){var t=this.sourceBuffer[e];if(!t)return;this.listeners[e].forEach(function(i){t.removeEventListener(i.event,i.listener)})},n}()},"./src/controller/buffer-operation-queue.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return T});var L=O("./src/utils/logger.ts"),T=function(){function A(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var M=A.prototype;return M.append=function(S,x){var v=this.queues[x];v.push(S),v.length===1&&this.buffers[x]&&this.executeNext(x)},M.insertAbort=function(S,x){var v=this.queues[x];v.unshift(S),this.executeNext(x)},M.appendBlocker=function(S){var x,v=new Promise(function(s){x=s}),g={execute:x,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,S),v},M.executeNext=function(S){var x=this.buffers,v=this.queues,g=x[S],s=v[S];if(s.length){var r=s[0];try{r.execute()}catch(n){L.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),r.onError(n),(!g||!g.updating)&&(s.shift(),this.executeNext(S))}}},M.shiftAndExecuteNext=function(S){this.queues[S].shift(),this.executeNext(S)},M.current=function(S){return this.queues[S][0]},A}()},"./src/controller/cap-level-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts");function T(C,S){for(var x=0;x<S.length;x++){var v=S[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function A(C,S,x){return S&&T(C.prototype,S),x&&T(C,x),C}var M=function(){function C(x){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=x,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var S=C.prototype;return S.setStreamController=function(v){this.streamController=v},S.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},S.registerListeners=function(){var v=this.hls;v.on(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.unregisterListener=function(){var v=this.hls;v.off(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.onFpsDropLevelCapping=function(v,g){C.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},S.onMediaAttaching=function(v,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},S.onManifestParsed=function(v,g){var s=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,s.config.capLevelToPlayerSize&&g.video&&this.startCapping()},S.onBufferCodecs=function(v,g){var s=this.hls;s.config.capLevelToPlayerSize&&g.video&&this.startCapping()},S.onMediaDetaching=function(){this.stopCapping()},S.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(v.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},S.getMaxLevel=function(v){var g=this,s=this.hls.levels;if(!s.length)return-1;var r=s.filter(function(n,u){return C.isLevelAllowed(u,g.restrictedLevels)&&u<=v});return this.clientRect=null,C.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},S.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()},S.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},S.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,g={width:0,height:0};if(v){var s=v.getBoundingClientRect();g.width=s.width,g.height=s.height,!g.width&&!g.height&&(g.width=s.right-s.left||v.width||0,g.height=s.bottom-s.top||v.height||0)}return this.clientRect=g,g},C.isLevelAllowed=function(v,g){return g===void 0&&(g=[]),g.indexOf(v)===-1},C.getMaxLevelByMediaSize=function(v,g,s){if(!v||!v.length)return-1;for(var r=function(t,i){return i?t.width!==i.width||t.height!==i.height:!0},n=v.length-1,u=0;u<v.length;u+=1){var l=v[u];if((l.width>=g||l.height>=s)&&r(l,v[u+1])){n=u;break}}return n},A(C,[{key:"mediaWidth",get:function(){return this.getDimensions().width*C.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*C.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(g){}return v}}]),C}();N.default=M},"./src/controller/cmcd-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return r});var L=O("./src/events.ts"),T=O("./src/types/cmcd.ts"),A=O("./src/utils/buffer-helper.ts"),M=O("./src/utils/logger.ts");function C(n,u){for(var l=0;l<u.length;l++){var e=u[l];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function S(n,u,l){return u&&C(n.prototype,u),l&&C(n,l),n}function x(n,u){var l=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(l)return(l=l.call(n)).next.bind(l);if(Array.isArray(n)||(l=v(n))||u&&n&&typeof n.length=="number"){l&&(n=l);var e=0;return function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(n,u){if(!n)return;if(typeof n=="string")return g(n,u);var l=Object.prototype.toString.call(n).slice(8,-1);if(l==="Object"&&n.constructor&&(l=n.constructor.name),l==="Map"||l==="Set")return Array.from(n);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return g(n,u)}function g(n,u){(u==null||u>n.length)&&(u=n.length);for(var l=0,e=new Array(u);l<u;l++)e[l]=n[l];return e}function s(){return s=Object.assign||function(n){for(var u=1;u<arguments.length;u++){var l=arguments[u];for(var e in l)Object.prototype.hasOwnProperty.call(l,e)&&(n[e]=l[e])}return n},s.apply(this,arguments)}var r=function(){function n(l){var e=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(){e.initialized&&(e.starved=!0),e.buffering=!0},this.onPlaying=function(){e.initialized||(e.initialized=!0),e.buffering=!1},this.applyPlaylistData=function(b){try{e.apply(b,{ot:T.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(_){M.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(b){try{var _=b.frag,p=e.hls.levels[_.level],y=e.getObjectType(_),m={d:_.duration*1e3,ot:y};(y===T.CMCDObjectType.VIDEO||y===T.CMCDObjectType.AUDIO||y==T.CMCDObjectType.MUXED)&&(m.br=p.bitrate/1e3,m.tb=e.getTopBandwidth(y),m.bl=e.getBufferLength(y)),e.apply(b,m)}catch(f){M.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=l;var t=this.config=l.config,i=t.cmcd;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||n.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var u=n.prototype;return u.registerListeners=function(){var e=this.hls;e.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this)},u.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},u.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},u.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},u.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},u.onBufferCreated=function(e,t){var i,b;this.audioBuffer=(i=t.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(b=t.tracks.video)===null||b===void 0?void 0:b.buffer},u.createData=function(){var e;return{v:T.CMCDVersion,sf:T.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)===null||e===void 0?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},u.apply=function(e,t){t===void 0&&(t={}),s(t,this.createData());var i=t.ot===T.CMCDObjectType.INIT||t.ot===T.CMCDObjectType.VIDEO||t.ot===T.CMCDObjectType.MUXED;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var b=n.toHeaders(t);if(!Object.keys(b).length)return;e.headers||(e.headers={}),s(e.headers,b)}else{var _=n.toQuery(t);if(!_)return;e.url=n.appendQueryToUri(e.url,_)}},u.getObjectType=function(e){var t=e.type;return t==="subtitle"?T.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?T.CMCDObjectType.INIT:t==="audio"?T.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?T.CMCDObjectType.VIDEO:T.CMCDObjectType.MUXED:void 0},u.getTopBandwidth=function(e){for(var t=0,i=e===T.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,b=x(i),_;!(_=b()).done;){var p=_.value;p.bitrate>t&&(t=p.bitrate)}return t>0?t:NaN},u.getBufferLength=function(e){var t=this.hls.media,i=e===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!t)return NaN;var b=A.BufferHelper.bufferInfo(i,t.currentTime,this.config.maxBufferHole);return b.len*1e3},u.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,i=e||this.config.loader;return function(){function b(p){this.loader=void 0,this.loader=new i(p)}var _=b.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(y,m,f){t(y),this.loader.load(y,m,f)},S(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},u.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,i=e||this.config.loader;return function(){function b(p){this.loader=void 0,this.loader=new i(p)}var _=b.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(y,m,f){t(y),this.loader.load(y,m,f)},S(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},n.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)},n.serialize=function(e){for(var t=[],i=function(w){return!Number.isNaN(w)&&w!=null&&w!==""&&w!==!1},b=function(w){return Math.round(w)},_=function(w){return b(w/100)*100},p=function(w){return encodeURIComponent(w)},y={br:b,d:b,bl:_,dl:_,mtp:_,nor:p,rtp:_,tb:b},m=Object.keys(e||{}).sort(),f=x(m),d;!(d=f()).done;){var a=d.value,o=e[a];if(!i(o))continue;if(a==="v"&&o===1)continue;if(a=="pr"&&o===1)continue;var c=y[a];c&&(o=c(o));var h=typeof o,E=void 0;a==="ot"||a==="sf"||a==="st"?E=a+"="+o:h==="boolean"?E=a:h==="number"?E=a+"="+o:E=a+"="+JSON.stringify(o),t.push(E)}return t.join(",")},n.toHeaders=function(e){for(var t=Object.keys(e),i={},b=["Object","Request","Session","Status"],_=[{},{},{},{}],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},y=0,m=t;y<m.length;y++){var f=m[y],d=p[f]!=null?p[f]:1;_[d][f]=e[f]}for(var a=0;a<_.length;a++){var o=n.serialize(_[a]);o&&(i["CMCD-"+b[a]]=o)}return i},n.toQuery=function(e){return"CMCD="+encodeURIComponent(n.serialize(e))},n.appendQueryToUri=function(e,t){if(!t)return e;var i=e.includes("?")?"&":"?";return""+e+i+t},n}()},"./src/controller/eme-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts"),T=O("./src/errors.ts"),A=O("./src/utils/logger.ts"),M=O("./src/utils/mediakeys-helper.ts");function C(r,n){for(var u=0;u<n.length;u++){var l=n[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function S(r,n,u){return n&&C(r.prototype,n),u&&C(r,u),r}var x=3,v=function(n,u,l){var e={audioCapabilities:[],videoCapabilities:[]};return n.forEach(function(t){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:l.audioRobustness||""})}),u.forEach(function(t){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:l.videoRobustness||""})}),[e]},g=function(n,u,l,e){switch(n){case M.KeySystems.WIDEVINE:return v(u,l,e);default:throw new Error("Unknown key-system: "+n)}},s=function(){function r(u){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=u,this._config=u.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var n=r.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n._unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n.getLicenseServerUrl=function(l){switch(l){case M.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},n._attemptKeySystemAccess=function(l,e,t){var i=this,b=g(l,e,t,this._drmSystemOptions);A.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(l,b);this.mediaKeysPromise=_.then(function(p){return i._onMediaKeySystemAccessObtained(l,p)}),_.catch(function(p){A.logger.error('Failed to obtain key-system "'+l+'" access:',p)})},n._onMediaKeySystemAccessObtained=function(l,e){var t=this;A.logger.log('Access for key-system "'+l+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:l};this._mediaKeysList.push(i);var b=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(_){return i.mediaKeys=_,A.logger.log('Media-keys created for key-system "'+l+'"'),t._onMediaKeysCreated(),_});return b.catch(function(_){A.logger.error("Failed to create media-keys:",_)}),b},n._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),l._onNewMediaKeySession(e.mediaKeysSession))})},n._onNewMediaKeySession=function(l){var e=this;A.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(t){e._onKeySessionMessage(l,t.message)},!1)},n._onKeySessionMessage=function(l,e){A.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(t){A.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),l.update(t)})},n.onMediaEncrypted=function(l){var e=this;if(A.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){A.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(b){if(!e._media)return;e._attemptSetMediaKeys(b),e._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(t).catch(t)},n._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){A.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}A.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(l,e){var t=this,i=this._mediaKeysList[0];if(!i){A.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){A.logger.warn("Key-Session already initialized but requested again");return}var b=i.mediaKeysSession;if(!b){A.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){A.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}A.logger.log('Generating key-session request for "'+l+'" init data type'),i.mediaKeysSessionInitialized=!0,b.generateRequest(l,e).then(function(){A.logger.debug("Key-session generation succeeded")}).catch(function(_){A.logger.error("Error generating key-session request:",_),t.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},n._createLicenseXhr=function(l,e,t){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,l,e,t);var b=this._licenseXhrSetup;if(b)try{b.call(this.hls,i,l),b=void 0}catch(_){A.logger.error(_)}try{i.readyState||i.open("POST",l,!0),b&&b.call(this.hls,i,l)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return i},n._onLicenseRequestReadyStageChange=function(l,e,t,i){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,A.logger.log("License request succeeded");var b=l.response,_=this._licenseResponseCallback;if(_)try{b=_.call(this.hls,l,e)}catch(y){A.logger.error(y)}i(b)}else{if(A.logger.error("License Request XHR failed ("+e+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>x){this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=x-this._requestLicenseFailureCount+1;A.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(t,i)}break}},n._generateLicenseRequestChallenge=function(l,e){switch(l.mediaKeySystemDomain){case M.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},n._requestLicense=function(l,e){A.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){A.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(t.mediaKeySystemDomain),b=this._createLicenseXhr(i,l,e);A.logger.log("Sending license request to URL: "+i);var _=this._generateLicenseRequestChallenge(t,l);b.send(_)}catch(p){A.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(l,e){if(!this._emeEnabled)return;var t=e.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},n.onMediaDetached=function(){var l=this._media,e=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},n.onManifestParsed=function(l,e){if(!this._emeEnabled)return;var t=e.levels.map(function(b){return b.audioCodec}).filter(function(b){return!!b}),i=e.levels.map(function(b){return b.videoCodec}).filter(function(b){return!!b});this._attemptKeySystemAccess(M.KeySystems.WIDEVINE,t,i)},S(r,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),r}();N.default=s},"./src/controller/fps-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts"),T=O("./src/utils/logger.ts"),A=function(){function M(S){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=S,this.registerListeners()}var C=M.prototype;return C.setStreamController=function(x){this.streamController=x},C.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},C.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching)},C.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},C.onMediaAttaching=function(x,v){var g=this.hls.config;if(g.capLevelOnFPSDrop){var s=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},C.checkFPS=function(x,v,g){var s=performance.now();if(v){if(this.lastTime){var r=s-this.lastTime,n=g-this.lastDroppedFrames,u=v-this.lastDecodedFrames,l=1e3*n/r,e=this.hls;if(e.trigger(L.Events.FPS_DROP,{currentDropped:n,currentDecoded:u,totalDroppedFrames:g}),l>0&&n>e.config.fpsDroppedMonitoringThreshold*u){var t=e.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=t)&&(t=t-1,e.trigger(L.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:e.currentLevel}),e.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=g,this.lastDecodedFrames=v}},C.checkFPSInterval=function(){var x=this.media;if(x)if(this.isVideoPlaybackQualityAvailable){var v=x.getVideoPlaybackQuality();this.checkFPS(x,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(x,x.webkitDecodedFrameCount,x.webkitDroppedFrameCount)},M}();N.default=A},"./src/controller/fragment-finders.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"findFragmentByPDT",function(){return A}),O.d(N,"findFragmentByPTS",function(){return M}),O.d(N,"fragmentWithinToleranceTest",function(){return C}),O.d(N,"pdtWithinToleranceTest",function(){return S}),O.d(N,"findFragWithCC",function(){return x});var L=O("./src/polyfills/number.ts"),T=O("./src/utils/binary-search.ts");function A(v,g,s){if(g===null||!Array.isArray(v)||!v.length||!Object(L.isFiniteNumber)(g))return null;var r=v[0].programDateTime;if(g<(r||0))return null;var n=v[v.length-1].endProgramDateTime;if(g>=(n||0))return null;s=s||0;for(var u=0;u<v.length;++u){var l=v[u];if(S(g,s,l))return l}return null}function M(v,g,s,r){s===void 0&&(s=0),r===void 0&&(r=0);var n=null;if(v?n=g[v.sn-g[0].sn+1]||null:s===0&&g[0].start===0&&(n=g[0]),n&&C(s,r,n)===0)return n;var u=T.default.search(g,C.bind(null,s,r));return u||n}function C(v,g,s){v===void 0&&(v=0),g===void 0&&(g=0);var r=Math.min(g,s.duration+(s.deltaPTS?s.deltaPTS:0));return s.start+s.duration-r<=v?1:s.start-r>v&&s.start?-1:0}function S(v,g,s){var r=Math.min(g,s.duration+(s.deltaPTS?s.deltaPTS:0))*1e3,n=s.endProgramDateTime||0;return n-r>v}function x(v,g){return T.default.search(v,function(s){return s.cc<g?1:s.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"FragmentState",function(){return A}),O.d(N,"FragmentTracker",function(){return M});var L=O("./src/events.ts"),T=O("./src/types/loader.ts"),A;(function(x){x.NOT_LOADED="NOT_LOADED",x.BACKTRACKED="BACKTRACKED",x.APPENDING="APPENDING",x.PARTIAL="PARTIAL",x.OK="OK"})(A||(A={}));var M=function(){function x(g){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=g,this._registerListeners()}var v=x.prototype;return v._registerListeners=function(){var s=this.hls;s.on(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(L.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var s=this.hls;s.off(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(L.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(s,r){if(r===T.PlaylistLevelType.MAIN){var n=this.activeFragment,u=this.activeParts;if(!n)return null;if(u)for(var l=u.length;l--;){var e=u[l],t=e?e.end:n.appendedPTS;if(e.start<=s&&t!==void 0&&s<=t)return l>9&&(this.activeParts=u.slice(l-9)),e}else if(n.start<=s&&n.appendedPTS!==void 0&&s<=n.appendedPTS)return n}return this.getBufferedFrag(s,r)},v.getBufferedFrag=function(s,r){for(var n=this.fragments,u=Object.keys(n),l=u.length;l--;){var e=n[u[l]];if((e==null?void 0:e.body.type)===r&&e.buffered){var t=e.body;if(t.start<=s&&s<=t.end)return t}}return null},v.detectEvictedFragments=function(s,r,n){var u=this;Object.keys(this.fragments).forEach(function(l){var e=u.fragments[l];if(!e)return;if(!e.buffered){e.body.type===n&&u.removeFragment(e.body);return}var t=e.range[s];if(!t)return;t.time.some(function(i){var b=!u.isTimeBuffered(i.startPTS,i.endPTS,r);return b&&u.removeFragment(e.body),b})})},v.detectPartialFragments=function(s){var r=this,n=this.timeRanges,u=s.frag,l=s.part;if(!n||u.sn==="initSegment")return;var e=S(u),t=this.fragments[e];if(!t)return;Object.keys(n).forEach(function(i){var b=u.elementaryStreams[i];if(!b)return;var _=n[i],p=l!==null||b.partial===!0;t.range[i]=r.getBufferedTimes(u,l,p,_)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},v.fragBuffered=function(s){var r=S(s),n=this.fragments[r];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},v.getBufferedTimes=function(s,r,n,u){for(var l={time:[],partial:n},e=r?r.start:s.start,t=r?r.end:s.end,i=s.minEndPTS||t,b=s.maxStartPTS||e,_=0;_<u.length;_++){var p=u.start(_)-this.bufferPadding,y=u.end(_)+this.bufferPadding;if(b>=p&&i<=y){l.time.push({startPTS:Math.max(e,u.start(_)),endPTS:Math.min(t,u.end(_))});break}else if(e<y&&t>p)l.partial=!0,l.time.push({startPTS:Math.max(e,u.start(_)),endPTS:Math.min(t,u.end(_))});else if(t<=p)break}return l},v.getPartialFragment=function(s){var r=null,n,u,l,e=0,t=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(b){var _=i[b];if(!_)return;C(_)&&(u=_.body.start-t,l=_.body.end+t,s>=u&&s<=l&&(n=Math.min(s-u,l-s),e<=n&&(r=_.body,e=n)))}),r},v.getState=function(s){var r=S(s),n=this.fragments[r];return n?n.buffered?C(n)?A.PARTIAL:A.OK:n.backtrack?A.BACKTRACKED:A.APPENDING:A.NOT_LOADED},v.backtrack=function(s,r){var n=S(s),u=this.fragments[n];if(!u||u.backtrack)return null;var l=u.backtrack=r||u.loaded;return u.loaded=null,l},v.getBacktrackData=function(s){var r=S(s),n=this.fragments[r];if(n){var u,l=n.backtrack;if(l!=null&&(u=l.payload)!==null&&u!==void 0&&u.byteLength)return l;this.removeFragment(s)}return null},v.isTimeBuffered=function(s,r,n){for(var u,l,e=0;e<n.length;e++){if(u=n.start(e)-this.bufferPadding,l=n.end(e)+this.bufferPadding,s>=u&&r<=l)return!0;if(r<=u)return!1}return!1},v.onFragLoaded=function(s,r){var n=r.frag,u=r.part;if(n.sn==="initSegment"||n.bitrateTest||u)return;var l=S(n);this.fragments[l]={body:n,loaded:r,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(s,r){var n=this,u=r.frag,l=r.part,e=r.timeRanges;if(u.type===T.PlaylistLevelType.MAIN)if(this.activeFragment=u,l){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(l)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(i){var b=e[i];if(n.detectEvictedFragments(i,b),!l)for(var _=0;_<b.length;_++)u.appendedPTS=Math.max(b.end(_),u.appendedPTS||0)})},v.onFragBuffered=function(s,r){this.detectPartialFragments(r)},v.hasFragment=function(s){var r=S(s);return!!this.fragments[r]},v.removeFragmentsInRange=function(s,r,n){var u=this;Object.keys(this.fragments).forEach(function(l){var e=u.fragments[l];if(!e)return;if(e.buffered){var t=e.body;t.type===n&&t.start<r&&t.end>s&&u.removeFragment(t)}})},v.removeFragment=function(s){var r=S(s);s.stats.loaded=0,s.clearElementaryStreamInfo(),delete this.fragments[r]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},x}();function C(x){var v,g;return x.buffered&&(((v=x.range.video)===null||v===void 0?void 0:v.partial)||((g=x.range.audio)===null||g===void 0?void 0:g.partial))}function S(x){return x.type+"_"+x.level+"_"+x.urlId+"_"+x.sn}},"./src/controller/gap-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"STALL_MINIMUM_DURATION_MS",function(){return C}),O.d(N,"MAX_START_GAP_JUMP",function(){return S}),O.d(N,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return x}),O.d(N,"SKIP_BUFFER_RANGE_START",function(){return v}),O.d(N,"default",function(){return g});var L=O("./src/utils/buffer-helper.ts"),T=O("./src/errors.ts"),A=O("./src/events.ts"),M=O("./src/utils/logger.ts"),C=250,S=2,x=.1,v=.05,g=function(){function s(n,u,l,e){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=n,this.media=u,this.fragmentTracker=l,this.hls=e}var r=s.prototype;return r.destroy=function(){this.hls=this.fragmentTracker=this.media=null},r.poll=function(u){var l=this.config,e=this.media,t=this.stalled,i=e.currentTime,b=e.seeking,_=this.seeking&&!b,p=!this.seeking&&b;if(this.seeking=b,i!==u){if(this.moved=!0,t!==null){if(this.stallReported){var y=self.performance.now()-t;M.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(y)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||_)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!L.BufferHelper.getBuffered(e).length)return;var m=L.BufferHelper.bufferInfo(e,i,0),f=m.len>0,d=m.nextStart||0;if(!f&&!d)return;if(b){var a=m.len>S,o=!d||d-i>S&&!this.fragmentTracker.getPartialFragment(i);if(a||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var c,h=Math.max(d,m.start||0)-i,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,R=E==null||((c=E.details)===null||c===void 0)?void 0:c.live,w=R?E.details.targetduration*2:S;if(h>0&&h<=w){this._trySkipBufferHole(null);return}}var P=self.performance.now();if(t===null){this.stalled=P;return}var D=P-t;!b&&D>=C&&this._reportStall(m.len);var U=L.BufferHelper.bufferInfo(e,i,l.maxBufferHole);this._tryFixBufferStall(U,D)},r._tryFixBufferStall=function(u,l){var e=this.config,t=this.fragmentTracker,i=this.media,b=i.currentTime,_=t.getPartialFragment(b);if(_){var p=this._trySkipBufferHole(_);if(p)return}u.len>e.maxBufferHole&&l>e.highBufferWatchdogPeriod*1e3&&(M.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},r._reportStall=function(u){var l=this.hls,e=this.media,t=this.stallReported;t||(this.stallReported=!0,M.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+u+")"),l.trigger(A.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:u}))},r._trySkipBufferHole=function(u){for(var l=this.config,e=this.hls,t=this.media,i=t.currentTime,b=0,_=L.BufferHelper.getBuffered(t),p=0;p<_.length;p++){var y=_.start(p);if(i+l.maxBufferHole>=b&&i<y){var m=Math.max(y+v,t.currentTime+x);return M.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+m),this.moved=!0,this.stalled=null,t.currentTime=m,u&&e.trigger(A.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+m,frag:u}),m}b=_.end(p)}return 0},r._tryNudgeBuffer=function(){var u=this.config,l=this.hls,e=this.media,t=e.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<u.nudgeMaxRetry){var b=t+i*u.nudgeOffset;M.logger.warn("Nudging 'currentTime' from "+t+" to "+b),e.currentTime=b,l.trigger(A.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else M.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+u.nudgeMaxRetry+" nudges"),l.trigger(A.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},s}()},"./src/controller/id3-track-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts"),T=O("./src/utils/texttrack-utils.ts"),A=O("./src/demux/id3.ts"),M=.25,C=function(){function S(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var x=S.prototype;return x.destroy=function(){this._unregisterListeners()},x._registerListeners=function(){var g=this.hls;g.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var g=this.hls;g.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.onMediaAttached=function(g,s){this.media=s.media},x.onMediaDetaching=function(){if(!this.id3Track)return;Object(T.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},x.getID3Track=function(g){if(!this.media)return;for(var s=0;s<g.length;s++){var r=g[s];if(r.kind==="metadata"&&r.label==="id3")return Object(T.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")},x.onFragParsingMetadata=function(g,s){if(!this.media)return;var r=s.frag,n=s.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var u=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<n.length;l++){var e=A.getID3Frames(n[l].data);if(e){var t=n[l].pts,i=l<n.length-1?n[l+1].pts:r.end,b=i-t;b<=0&&(i=t+M);for(var _=0;_<e.length;_++){var p=e[_];if(!A.isTimeStampFrame(p)){var y=new u(t,i,"");y.value=p,this.id3Track.addCue(y)}}}}},x.onBufferFlushing=function(g,s){var r=s.startOffset,n=s.endOffset,u=s.type;if(!u||u==="audio"){var l=this.id3Track;l&&Object(T.removeCuesInRange)(l,r,n)}},S}();N.default=C},"./src/controller/latency-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return S});var L=O("./src/errors.ts"),T=O("./src/events.ts"),A=O("./src/utils/logger.ts");function M(x,v){for(var g=0;g<v.length;g++){var s=v[g];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(x,s.key,s)}}function C(x,v,g){return v&&M(x.prototype,v),g&&M(x,g),x}var S=function(){function x(g){var s=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 s.timeupdate()},this.hls=g,this.config=g.config,this.registerListeners()}var v=x.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(T.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(T.Events.ERROR,this.onError)},v.onMediaAttached=function(s,r){this.media=r.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(s,r){var n=r.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(s,r){if(r.details!==L.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,A.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var s=this.media,r=this.levelDetails;if(!s||!r)return;this.currentTime=s.currentTime;var n=this.computeLatency();if(n===null)return;this._latency=n;var u=this.config,l=u.lowLatencyMode,e=u.maxLiveSyncPlaybackRate;if(!l||e===1)return;var t=this.targetLatency;if(t===null)return;var i=n-t,b=Math.min(this.maxLatency,t+r.targetduration),_=i<b;if(r.live&&_&&i>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,e)),y=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;s.playbackRate=Math.min(p,Math.max(1,y))}else s.playbackRate!==1&&s.playbackRate!==0&&(s.playbackRate=1)},v.estimateLiveEdge=function(){var s=this.levelDetails;return s===null?null:s.edge+s.age},v.computeLatency=function(){var s=this.estimateLiveEdge();return s===null?null:s-this.currentTime},C(x,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var s=this.config,r=this.levelDetails;return s.liveMaxLatencyDuration!==void 0?s.liveMaxLatencyDuration:r?s.liveMaxLatencyDurationCount*r.targetduration:0}},{key:"targetLatency",get:function(){var s=this.levelDetails;if(s===null)return null;var r=s.holdBack,n=s.partHoldBack,u=s.targetduration,l=this.config,e=l.liveSyncDuration,t=l.liveSyncDurationCount,i=l.lowLatencyMode,b=this.hls.userConfig,_=i&&n||r;(b.liveSyncDuration||b.liveSyncDurationCount||_===0)&&(_=e!==void 0?e:t*u);var p=u,y=1;return _+Math.min(this.stallCount*y,p)}},{key:"liveSyncPosition",get:function(){var s=this.estimateLiveEdge(),r=this.targetLatency,n=this.levelDetails;if(s===null||r===null||n===null)return null;var u=n.edge,l=s-r-this.edgeStalled,e=u-n.totalduration,t=u-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(e,l),t)}},{key:"drift",get:function(){var s=this.levelDetails;return s===null?1:s.drift}},{key:"edgeStalled",get:function(){var s=this.levelDetails;if(s===null)return 0;var r=(this.config.lowLatencyMode&&s.partTarget||s.targetduration)*3;return Math.max(s.age-r,0)}},{key:"forwardBufferLength",get:function(){var s=this.media,r=this.levelDetails;if(!s||!r)return 0;var n=s.buffered.length;return n?s.buffered.end(n-1):r.edge-this.currentTime}}]),x}()},"./src/controller/level-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return l});var L=O("./src/types/level.ts"),T=O("./src/events.ts"),A=O("./src/errors.ts"),M=O("./src/utils/codecs.ts"),C=O("./src/controller/level-helper.ts"),S=O("./src/controller/base-playlist-controller.ts"),x=O("./src/types/loader.ts");function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var b in i)Object.prototype.hasOwnProperty.call(i,b)&&(e[b]=i[b])}return e},v.apply(this,arguments)}function g(e,t){for(var i=0;i<t.length;i++){var b=t[i];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(e,b.key,b)}}function s(e,t,i){return t&&g(e.prototype,t),i&&g(e,i),e}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}function n(e,t){return n=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},n(e,t)}var u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(e){r(t,e);function t(b){var _;return _=e.call(this,b,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var i=t.prototype;return i._registerListeners=function(){var _=this.hls;_.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(T.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var _=this.hls;_.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(T.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},i.startLoad=function(){var _=this._levels;_.forEach(function(p){p.loadError=0}),e.prototype.startLoad.call(this)},i.onManifestLoaded=function(_,p){var y=[],m=[],f=[],d,a={},o,c=!1,h=!1,E=!1;if(p.levels.forEach(function(D){var U=D.attrs;c=c||!!(D.width&&D.height),h=h||!!D.videoCodec,E=E||!!D.audioCodec,u&&D.audioCodec&&D.audioCodec.indexOf("mp4a.40.34")!==-1&&(D.audioCodec=void 0);var I=D.bitrate+"-"+D.attrs.RESOLUTION+"-"+D.attrs.CODECS;o=a[I],o?o.url.push(D.url):(o=new L.Level(D),a[I]=o,y.push(o)),U&&(U.AUDIO&&Object(C.addGroupId)(o,"audio",U.AUDIO),U.SUBTITLES&&Object(C.addGroupId)(o,"text",U.SUBTITLES))}),(c||h)&&E&&(y=y.filter(function(D){var U=D.videoCodec,I=D.width,k=D.height;return!!U||!!(I&&k)})),y=y.filter(function(D){var U=D.audioCodec,I=D.videoCodec;return(!U||Object(M.isCodecSupportedInMp4)(U,"audio"))&&(!I||Object(M.isCodecSupportedInMp4)(I,"video"))}),p.audioTracks&&(m=p.audioTracks.filter(function(D){return!D.audioCodec||Object(M.isCodecSupportedInMp4)(D.audioCodec,"audio")}),Object(C.assignTrackIdsByGroup)(m)),p.subtitles&&(f=p.subtitles,Object(C.assignTrackIdsByGroup)(f)),y.length>0){d=y[0].bitrate,y.sort(function(D,U){return D.bitrate-U.bitrate}),this._levels=y;for(var R=0;R<y.length;R++)if(y[R].bitrate===d){this._firstLevel=R,this.log("manifest loaded, "+y.length+" level(s) found, first bitrate: "+d);break}var w=E&&!h,P={levels:y,audioTracks:m,subtitleTracks:f,firstLevel:this._firstLevel,stats:p.stats,audio:E,video:h,altAudio:!w&&m.some(function(D){return!!D.url})};this.hls.trigger(T.Events.MANIFEST_PARSED,P),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(T.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(_,p){if(e.prototype.onError.call(this,_,p),p.fatal)return;var y=p.context,m=this._levels[this.currentLevelIndex];if(y&&(y.type===x.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&y.groupId===m.audioGroupIds[m.urlId]||y.type===x.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&y.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,d=!0,a;switch(p.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:if(p.frag){var o=this._levels[p.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=p.frag.level)):a=p.frag.level}break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:y&&(y.deliveryDirectives&&(d=!1),a=y.level),f=!0;break;case A.ErrorDetails.REMUX_ALLOC_ERROR:a=p.level,f=!0;break}a!==void 0&&this.recoverLevel(p,a,f,d)},i.recoverLevel=function(_,p,y,m){var f=_.details,d=this._levels[p];if(d.loadError++,y){var a=this.retryLoadingOrFail(_);if(a)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var o=d.url.length;if(o>1&&d.loadError<o)_.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var c=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==c&&this._levels[c].loadError===0&&(this.warn(f+": switch to "+c),_.levelRetry=!0,this.hls.nextAutoLevel=c)}}},i.redundantFailover=function(_){var p=this._levels[_],y=p.url.length;if(y>1){var m=(p.urlId+1)%y;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(f){f.urlId=m}),this.level=_}},i.onFragLoaded=function(_,p){var y=p.frag;if(y!==void 0&&y.type===x.PlaylistLevelType.MAIN){var m=this._levels[y.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},i.onLevelLoaded=function(_,p){var y,m=p.level,f=p.details,d=this._levels[m];if(!d){var a;this.warn("Invalid level index "+m),(a=p.deliveryDirectives)!==null&&a!==void 0&&a.skip&&(f.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(m,p,d.details)):(y=p.deliveryDirectives)!==null&&y!==void 0&&y.skip&&(f.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(_,p){var y=this.hls.levels[this.currentLevelIndex];if(!y)return;if(y.audioGroupIds){for(var m=-1,f=this.hls.audioTracks[p.id].groupId,d=0;d<y.audioGroupIds.length;d++)if(y.audioGroupIds[d]===f){m=d;break}m!==y.urlId&&(y.urlId=m,this.startLoad())}},i.loadPlaylist=function(_){var p=this.currentLevelIndex,y=this._levels[p];if(this.canLoad&&y&&y.url.length>0){var m=y.urlId,f=y.url[m];if(_)try{f=_.addDirectives(f)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+p+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+m+" "+f),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:f,level:p,id:m,deliveryDirectives:_||null})}},i.removeLevel=function(_,p){var y=function(d,a){return a!==p},m=this._levels.filter(function(f,d){return d!==_?!0:f.url.length>1&&p!==void 0?(f.url=f.url.filter(y),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(y)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(y)),f.urlId=0,!0):!1}).map(function(f,d){var a=f.details;return a!=null&&a.fragments&&a.fragments.forEach(function(o){o.level=d}),f});this._levels=m,this.hls.trigger(T.Events.LEVELS_UPDATED,{levels:m})},s(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var p,y=this._levels;if(y.length===0)return;if(this.currentLevelIndex===_&&(p=y[_])!==null&&p!==void 0&&p.details)return;if(_<0||_>=y.length){var m=_<0;if(this.hls.trigger(T.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:m,reason:"invalid level idx"}),m)return;_=Math.min(_,y.length-1)}this.clearTimer();var f=this.currentLevelIndex,d=y[f],a=y[_];this.log("switching to level "+_+" from "+f),this.currentLevelIndex=_;var o=v({},a,{level:_,maxBitrate:a.maxBitrate,uri:a.uri,urlId:a.urlId});delete o._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,o);var c=a.details;if(!c||c.live){var h=this.switchParams(a.uri,d==null?void 0:d.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),t}(S.default)},"./src/controller/level-helper.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"addGroupId",function(){return A}),O.d(N,"assignTrackIdsByGroup",function(){return M}),O.d(N,"updatePTS",function(){return C}),O.d(N,"updateFragPTSDTS",function(){return x}),O.d(N,"mergeDetails",function(){return v}),O.d(N,"mapPartIntersection",function(){return g}),O.d(N,"mapFragmentIntersection",function(){return s}),O.d(N,"adjustSliding",function(){return r}),O.d(N,"addSliding",function(){return n}),O.d(N,"computeReloadInterval",function(){return u}),O.d(N,"getFragmentWithSN",function(){return l}),O.d(N,"getPartWith",function(){return e});var L=O("./src/polyfills/number.ts"),T=O("./src/utils/logger.ts");function A(t,i,b){switch(i){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(b);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(b);break}}function M(t){var i={};t.forEach(function(b){var _=b.groupId||"";b.id=i[_]=i[_]||0,i[_]++})}function C(t,i,b){var _=t[i],p=t[b];S(_,p)}function S(t,i){var b=i.startPTS;if(Object(L.isFiniteNumber)(b)){var _=0,p;i.sn>t.sn?(_=b-t.start,p=t):(_=t.start-b,p=i),p.duration!==_&&(p.duration=_)}else if(i.sn>t.sn){var y=t.cc===i.cc;y&&t.minEndPTS?i.start=t.start+(t.minEndPTS-t.start):i.start=t.start+t.duration}else i.start=Math.max(t.start-i.duration,0)}function x(t,i,b,_,p,y){var m=_-b;m<=0&&(T.logger.warn("Fragment should have a positive duration",i),_=b+i.duration,y=p+i.duration);var f=b,d=_,a=i.startPTS,o=i.endPTS;if(Object(L.isFiniteNumber)(a)){var c=Math.abs(a-b);Object(L.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(c,i.deltaPTS):i.deltaPTS=c,f=Math.max(b,a),b=Math.min(b,a),p=Math.min(p,i.startDTS),d=Math.min(_,o),_=Math.max(_,o),y=Math.max(y,i.endDTS)}i.duration=_-b;var h=b-i.start;i.appendedPTS=_,i.start=i.startPTS=b,i.maxStartPTS=f,i.startDTS=p,i.endPTS=_,i.minEndPTS=d,i.endDTS=y;var E=i.sn;if(!t||E<t.startSN||E>t.endSN)return 0;var R,w=E-t.startSN,P=t.fragments;for(P[w]=i,R=w;R>0;R--)S(P[R],P[R-1]);for(R=w;R<P.length-1;R++)S(P[R],P[R+1]);return t.fragmentHint&&S(P[P.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,h}function v(t,i){for(var b=null,_=t.fragments,p=_.length-1;p>=0;p--){var y=_[p].initSegment;if(y){b=y;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,f;if(s(t,i,function(R,w){R.relurl&&(m=R.cc-w.cc),Object(L.isFiniteNumber)(R.startPTS)&&Object(L.isFiniteNumber)(R.endPTS)&&(w.start=w.startPTS=R.startPTS,w.startDTS=R.startDTS,w.appendedPTS=R.appendedPTS,w.maxStartPTS=R.maxStartPTS,w.endPTS=R.endPTS,w.endDTS=R.endDTS,w.minEndPTS=R.minEndPTS,w.duration=R.endPTS-R.startPTS,w.duration&&(f=w),i.PTSKnown=i.alignedSliding=!0),w.elementaryStreams=R.elementaryStreams,w.loader=R.loader,w.stats=R.stats,w.urlId=R.urlId,R.initSegment&&(w.initSegment=R.initSegment,b=R.initSegment)}),b){var d=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;d.forEach(function(R){var w;(!R.initSegment||R.initSegment.relurl===((w=b)===null||w===void 0?void 0:w.relurl))&&(R.initSegment=b)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(R){return!R}),i.deltaUpdateFailed)){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var a=i.skippedSegments;a--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var o=i.fragments;if(m){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var c=0;c<o.length;c++)o[c].cc+=m}i.skippedSegments&&(i.startCC=i.fragments[0].cc),g(t.partList,i.partList,function(R,w){w.elementaryStreams=R.elementaryStreams,w.stats=R.stats}),f?x(i,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):r(t,i),o.length&&(i.totalduration=i.edge-o[0].start),i.driftStartTime=t.driftStartTime,i.driftStart=t.driftStart;var h=i.advancedDateTime;if(i.advanced&&h){var E=i.edge;i.driftStart||(i.driftStartTime=h,i.driftStart=E),i.driftEndTime=h,i.driftEnd=E}else i.driftEndTime=t.driftEndTime,i.driftEnd=t.driftEnd,i.advancedDateTime=t.advancedDateTime}function g(t,i,b){if(t&&i)for(var _=0,p=0,y=t.length;p<=y;p++){var m=t[p],f=i[p+_];m&&f&&m.index===f.index&&m.fragment.sn===f.fragment.sn?b(m,f):_--}}function s(t,i,b){for(var _=i.skippedSegments,p=Math.max(t.startSN,i.startSN)-i.startSN,y=(t.fragmentHint?1:0)+(_?i.endSN:Math.min(t.endSN,i.endSN))-i.startSN,m=i.startSN-t.startSN,f=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,d=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,a=p;a<=y;a++){var o=d[m+a],c=f[a];_&&!c&&a<_&&(c=i.fragments[a]=o),o&&c&&b(o,c)}}function r(t,i){var b=i.startSN+i.skippedSegments-t.startSN,_=t.fragments;if(b<0||b>=_.length)return;n(i,_[b].start)}function n(t,i){if(i){for(var b=t.fragments,_=t.skippedSegments;_<b.length;_++)b[_].start+=i;t.fragmentHint&&(t.fragmentHint.start+=i)}}function u(t,i){var b=1e3*t.levelTargetDuration,_=b/2,p=t.age,y=p>0&&p<b*3,m=i.loading.end-i.loading.start,f,d=t.availabilityDelay;if(t.updated===!1)if(y){var a=333*t.misses;f=Math.max(Math.min(_,m*2),a),t.availabilityDelay=(t.availabilityDelay||0)+f}else f=_;else y?(d=Math.min(d||b/2,p),t.availabilityDelay=d,f=d+b-p):f=b-m;return Math.round(f)}function l(t,i,b){if(!t||!t.details)return null;var _=t.details,p=_.fragments[i-_.startSN];return p||(p=_.fragmentHint,p&&p.sn===i?p:i<_.startSN&&b&&b.sn===i?b:null)}function e(t,i,b){if(!t||!t.details)return null;var _=t.details.partList;if(_)for(var p=_.length;p--;){var y=_[p];if(y.index===b&&y.fragment.sn===i)return y}return null}},"./src/controller/stream-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return _});var L=O("./src/polyfills/number.ts"),T=O("./src/controller/base-stream-controller.ts"),A=O("./src/is-supported.ts"),M=O("./src/events.ts"),C=O("./src/utils/buffer-helper.ts"),S=O("./src/controller/fragment-tracker.ts"),x=O("./src/types/loader.ts"),v=O("./src/loader/fragment.ts"),g=O("./src/demux/transmuxer-interface.ts"),s=O("./src/types/transmuxer.ts"),r=O("./src/controller/gap-controller.ts"),n=O("./src/errors.ts"),u=O("./src/utils/logger.ts");function l(p,y){for(var m=0;m<y.length;m++){var f=y[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function e(p,y,m){return y&&l(p.prototype,y),m&&l(p,m),p}function t(p,y){p.prototype=Object.create(y.prototype),p.prototype.constructor=p,i(p,y)}function i(p,y){return i=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},i(p,y)}var b=100,_=function(p){t(y,p);function y(f,d){var a;return a=p.call(this,f,d,"[stream-controller]")||this,a.audioCodecSwap=!1,a.gapController=null,a.level=-1,a._forceStartLoad=!1,a.altAudio=!1,a.audioOnly=!1,a.fragPlaying=null,a.onvplaying=null,a.onvseeked=null,a.fragLastKbps=0,a.stalled=!1,a.couldBacktrack=!1,a.audioCodecSwitch=!1,a.videoBuffer=null,a._registerListeners(),a}var m=y.prototype;return m._registerListeners=function(){var d=this.hls;d.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.on(M.Events.ERROR,this.onError,this),d.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(M.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var d=this.hls;d.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.off(M.Events.ERROR,this.onError,this),d.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(M.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},m.startLoad=function(d){if(this.levels){var a=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(b),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var c=o.startLevel;c===-1&&(o.config.testBandwidth?(c=0,this.bitrateTest=!0):c=o.nextAutoLevel),this.level=o.nextLoadLevel=c,this.loadedmetadata=!1}a>0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),d=a),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var d,a=this.levels,o=this.level,c=a==null||((d=a[o])===null||d===void 0)?void 0:d.details;if(c&&(!c.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(c))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var h,E=self.performance.now(),R=this.retryDate;(!R||E>=R||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var d,a,o=this.hls,c=this.levelLastLoaded,h=this.levels,E=this.media,R=o.config,w=o.nextLoadLevel;if(c===null||!E&&(this.startFragRequested||!R.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[w])return;var P=h[w];this.level=o.nextLoadLevel=w;var D=P.details;if(!D||this.state===T.State.WAITING_LEVEL||D.live&&this.levelLastLoaded!==w){this.state=T.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,x.PlaylistLevelType.MAIN);if(U===null)return;var I=U.len,k=this.getMaxBufferLength(P.maxBitrate);if(I>=k)return;if(this._streamEnded(U,D)){var H={};this.altAudio&&(H.type="video"),this.hls.trigger(M.Events.BUFFER_EOS,H),this.state=T.State.ENDED;return}var J=U.end,$=this.getNextFragment(J,D);if(this.couldBacktrack&&!this.fragPrevious&&$&&$.sn!=="initSegment"){var fe=$.sn-D.startSN;fe>1&&($=D.fragments[fe-1],this.fragmentTracker.removeFragment($))}if($&&this.fragmentTracker.getState($)===S.FragmentState.OK&&this.nextLoadPosition>J){var he=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,he,x.PlaylistLevelType.MAIN),$=this.getNextFragment(this.nextLoadPosition,D)}if(!$)return;$.initSegment&&!$.initSegment.data&&!this.bitrateTest&&($=$.initSegment),((d=$.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((a=$.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey($,D):this.loadFragment($,D,J)},m.loadFragment=function(d,a,o){var c,h=this.fragmentTracker.getState(d);if(this.fragCurrent=d,h===S.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(d);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else h=S.FragmentState.NOT_LOADED}h===S.FragmentState.NOT_LOADED||h===S.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,d,a,o)):h===S.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((c=this.media)===null||c===void 0?void 0:c.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(d){var a=this.fragmentTracker.getAppendedFrag(d,x.PlaylistLevelType.MAIN);return a&&"fragment"in a?a.fragment:a},m.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,x.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var d=this.levels,a=this.media;if(a!=null&&a.readyState){var o,c=this.getAppendedFrag(a.currentTime);if(c&&c.start>1&&this.flushMainBuffer(0,c.start-1),!a.paused&&d){var h=this.hls.nextLoadLevel,E=d[h],R=this.fragLastKbps;R&&this.fragCurrent?o=this.fragCurrent.duration*E.maxBitrate/(1e3*R)+1:o=0}else o=0;var w=this.getBufferedFrag(a.currentTime+o);if(w){var P=this.followingBufferedFrag(w);if(P){this.abortCurrentFrag();var D=P.maxStartPTS?P.maxStartPTS:P.start,U=P.duration,I=Math.max(w.end,D+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(d,a){p.prototype.flushMainBuffer.call(this,d,a,this.altAudio?"video":null)},m.onMediaAttached=function(d,a){p.prototype.onMediaAttached.call(this,d,a);var o=a.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new r.default(this.config,o,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.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)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var d=this.media,a=d?d.currentTime:null;Object(L.isFiniteNumber)(a)&&this.log("Media seeked to "+a.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(M.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(d,a){var o=!1,c=!1,h;a.levels.forEach(function(E){h=E.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(o=!0),h.indexOf("mp4a.40.5")!==-1&&(c=!0))}),this.audioCodecSwitch=o&&c&&!Object(A.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=a.levels,this.startFragRequested=!1},m.onLevelLoading=function(d,a){var o=this.levels;if(!o||this.state!==T.State.IDLE)return;var c=o[a.level];(!c.details||c.details.live&&this.levelLastLoaded!==a.level||this.waitForCdnTuneIn(c.details))&&(this.state=T.State.WAITING_LEVEL)},m.onLevelLoaded=function(d,a){var o,c=this.levels,h=a.level,E=a.details,R=E.totalduration;if(!c){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+R);var w=this.fragCurrent;w&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&(w.level!==a.level&&w.loader&&(this.state=T.State.IDLE,w.loader.abort()));var P=c[h],D=0;if(E.live||(o=P.details)!==null&&o!==void 0&&o.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;D=this.alignPlaylists(E,P.details)}if(P.details=E,this.levelLastLoaded=h,this.hls.trigger(M.Events.LEVEL_UPDATED,{details:E,level:h}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=T.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,D),this.tick()},m._handleFragmentLoadProgress=function(d){var a,o=d.frag,c=d.part,h=d.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var R=E[o.level],w=R.details;if(!w){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var P=R.videoCodec,D=w.PTSKnown||!w.live,U=(a=o.initSegment)===null||a===void 0?void 0:a.data,I=this._getAudioCodec(R),k=this.transmuxer=this.transmuxer||new g.default(this.hls,x.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),H=c?c.index:-1,J=H!==-1,$=new s.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,h.byteLength,H,J),fe=this.initPTS[o.cc];k.push(h,U,I,P,o,c,w.totalduration,D,$,fe)},m.onAudioTrackSwitching=function(d,a){var o=this.altAudio,c=!!a.url,h=a.id;if(!c){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var R=this.hls;o&&R.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:h})}},m.onAudioTrackSwitched=function(d,a){var o=a.id,c=!!this.hls.audioTracks[o].url;if(c){var h=this.videoBuffer;h&&this.mediaBuffer!==h&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=h)}this.altAudio=c,this.tick()},m.onBufferCreated=function(d,a){var o=a.tracks,c,h,E=!1;for(var R in o){var w=o[R];if(w.id==="main"){if(h=R,c=w,R==="video"){var P=o[R];P&&(this.videoBuffer=P.buffer)}}else E=!0}E&&c?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(d,a){var o=a.frag,c=a.part;if(o&&o.type!==x.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(c?" p: "+c.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var h=c?c.stats:o.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,c)},m.onError=function(d,a){switch(a.details){case n.ErrorDetails.FRAG_LOAD_ERROR:case n.ErrorDetails.FRAG_LOAD_TIMEOUT:case n.ErrorDetails.KEY_LOAD_ERROR:case n.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(x.PlaylistLevelType.MAIN,a);break;case n.ErrorDetails.LEVEL_LOAD_ERROR:case n.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(a.fatal?(this.warn(""+a.details),this.state=T.State.ERROR):!a.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case n.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var o=!0,c=this.getFwdBufferInfo(this.media,x.PlaylistLevelType.MAIN);c&&c.len>.5&&(o=!this.reduceMaxBufferLength(c.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var d=this.media,a=this.gapController;if(!d||!a||!d.readyState)return;var o=C.BufferHelper.getBuffered(d);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):a.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(d,a){var o=a.type;if(o!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var c=(o===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(c,o,x.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(d,a){this.levels=a.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var d=this.media,a=d.currentTime,o=this.startPosition;if(o>=0&&a<o){if(d.seeking){u.logger.log("could not seek to "+o+", already seeking at "+a);return}var c=C.BufferHelper.getBuffered(d),h=c.length?c.start(0):0,E=h-o;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(u.logger.log("adjusting start position by "+E+" to match buffer start"),o+=E,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+a),d.currentTime=o}},m._getAudioCodec=function(d){var a=this.config.defaultAudioCodec||d.audioCodec;return this.audioCodecSwap&&a&&(this.log("Swapping audio codec"),a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5"),a},m._loadBitrateTestFrag=function(d){var a=this;this._doFragLoad(d).then(function(o){var c=a.hls;if(!o||c.nextLoadLevel||a.fragContextChanged(d))return;a.fragLoadError=0,a.state=T.State.IDLE,a.startFragRequested=!1,a.bitrateTest=!1;var h=d.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),c.trigger(M.Events.FRAG_LOADED,o)})},m._handleTransmuxComplete=function(d){var a,o="main",c=this.hls,h=d.remuxResult,E=d.chunkMeta,R=this.getCurrentContext(E);if(!R){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var w=R.frag,P=R.part,D=R.level,U=h.video,I=h.text,k=h.id3,H=h.initSegment,J=this.altAudio?void 0:h.audio;if(this.fragContextChanged(w))return;if(this.state=T.State.PARSING,H){H.tracks&&(this._bufferInitSegment(D,H.tracks,w,E),c.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:o,tracks:H.tracks}));var $=H.initPTS,fe=H.timescale;Object(L.isFiniteNumber)($)&&(this.initPTS[w.cc]=$,c.trigger(M.Events.INIT_PTS_FOUND,{frag:w,id:o,initPTS:$,timescale:fe}))}if(U&&h.independent!==!1){if(D.details){var he=U.startPTS,ce=U.endPTS,pe=U.startDTS,_e=U.endDTS;if(P)P.elementaryStreams[U.type]={startPTS:he,endPTS:ce,startDTS:pe,endDTS:_e};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var oe=this.getLoadPosition()+this.config.maxBufferHole;if(oe<he){this.backtrack(w);return}w.setElementaryStreamInfo(U.type,w.start,ce,w.start,_e,!0)}w.setElementaryStreamInfo(U.type,he,ce,pe,_e),this.bufferFragmentData(U,w,P,E)}}else if(h.independent===!1){this.backtrack(w);return}if(J){var ne=J.startPTS,Ee=J.endPTS,ke=J.startDTS,we=J.endDTS;P&&(P.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:Ee,startDTS:ke,endDTS:we}),w.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ne,Ee,ke,we),this.bufferFragmentData(J,w,P,E)}if(k!=null&&(a=k.samples)!==null&&a!==void 0&&a.length){var Re={frag:w,id:o,samples:k.samples};c.trigger(M.Events.FRAG_PARSING_METADATA,Re)}if(I){var Ue={frag:w,id:o,samples:I.samples};c.trigger(M.Events.FRAG_PARSING_USERDATA,Ue)}},m._bufferInitSegment=function(d,a,o,c){var h=this;if(this.state!==T.State.PARSING)return;this.audioOnly=!!a.audio&&!a.video,this.altAudio&&!this.audioOnly&&delete a.audio;var E=a.audio,R=a.video,w=a.audiovideo;if(E){var P=d.audioCodec,D=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(P&&(P.indexOf("mp4a.40.5")!==-1?P="mp4a.40.2":P="mp4a.40.5"),E.metadata.channelCount!==1&&D.indexOf("firefox")===-1&&(P="mp4a.40.5")),D.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(P="mp4a.40.2",this.log("Android: force audio codec to "+P)),d.audioCodec&&d.audioCodec!==P&&this.log('Swapping manifest audio codec "'+d.audioCodec+'" for "'+P+'"'),E.levelCodec=P,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(P||"")+"/"+(d.audioCodec||"")+"/"+E.codec+"]")}R&&(R.levelCodec=d.videoCodec,R.id="main",this.log("Init video buffer, container:"+R.container+", codecs[level/parsed]=["+(d.videoCodec||"")+"/"+R.codec+"]")),w&&this.log("Init audiovideo buffer, container:"+w.container+", codecs[level/parsed]=["+(d.attrs.CODECS||"")+"/"+w.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,a),Object.keys(a).forEach(function(U){var I=a[U],k=I.initSegment;k!=null&&k.byteLength&&h.hls.trigger(M.Events.BUFFER_APPENDING,{type:U,data:k,frag:o,part:null,chunkMeta:c,parent:o.type})}),this.tick()},m.backtrack=function(d){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(d);var a=this.fragmentTracker.backtrack(d);this.fragPrevious=null,this.nextLoadPosition=d.start,a?this.resetFragmentLoading(d):this.state=T.State.BACKTRACKING},m.checkFragmentChanged=function(){var d=this.media,a=null;if(d&&d.readyState>1&&d.seeking===!1){var o=d.currentTime;if(C.BufferHelper.isBuffered(d,o)?a=this.getAppendedFrag(o):C.BufferHelper.isBuffered(d,o+.1)&&(a=this.getAppendedFrag(o+.1)),a){var c=this.fragPlaying,h=a.level;(!c||a.sn!==c.sn||c.level!==h||a.urlId!==c.urlId)&&(this.hls.trigger(M.Events.FRAG_CHANGED,{frag:a}),(!c||c.level!==h)&&this.hls.trigger(M.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=a)}}},e(y,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var a=this.getAppendedFrag(d.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var a=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(a)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),y}(T.default)},"./src/controller/subtitle-stream-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"SubtitleStreamController",function(){return t});var L=O("./src/events.ts"),T=O("./src/utils/logger.ts"),A=O("./src/utils/buffer-helper.ts"),M=O("./src/controller/fragment-finders.ts"),C=O("./src/utils/discontinuities.ts"),S=O("./src/controller/level-helper.ts"),x=O("./src/controller/fragment-tracker.ts"),v=O("./src/controller/base-stream-controller.ts"),g=O("./src/types/loader.ts"),s=O("./src/types/level.ts");function r(i,b){for(var _=0;_<b.length;_++){var p=b[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(i,p.key,p)}}function n(i,b,_){return b&&r(i.prototype,b),_&&r(i,_),i}function u(i,b){i.prototype=Object.create(b.prototype),i.prototype.constructor=i,l(i,b)}function l(i,b){return l=Object.setPrototypeOf||function(p,y){return p.__proto__=y,p},l(i,b)}var e=500,t=function(i){u(b,i);function b(p,y){var m;return m=i.call(this,p,y,"[subtitle-stream-controller]")||this,m.levels=[],m.currentTrackId=-1,m.tracksBuffered=[],m.mainDetails=null,m._registerListeners(),m}var _=b.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var y=this.hls;y.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(L.Events.ERROR,this.onError,this),y.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.on(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.on(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var y=this.hls;y.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(L.Events.ERROR,this.onError,this),y.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.off(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.off(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(e),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(y,m){this.mainDetails=m.details},_.onSubtitleFragProcessed=function(y,m){var f=m.frag,d=m.success;if(this.fragPrevious=f,this.state=v.State.IDLE,!d)return;var a=this.tracksBuffered[this.currentTrackId];if(!a)return;for(var o,c=f.start,h=0;h<a.length;h++)if(c>=a[h].start&&c<=a[h].end){o=a[h];break}var E=f.start+f.duration;o?o.end=E:(o={start:c,end:E},a.push(o)),this.fragmentTracker.fragBuffered(f)},_.onBufferFlushing=function(y,m){var f=m.startOffset,d=m.endOffset;if(f===0&&d!==Number.POSITIVE_INFINITY){var a=this.currentTrackId,o=this.levels;if(!o.length||!o[a]||!o[a].details)return;var c=o[a].details,h=c.targetduration,E=d-h;if(E<=0)return;m.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(R){for(var w=0;w<R.length;){if(R[w].end<=E){R.shift();continue}else if(R[w].start<E)R[w].start=E;else break;w++}}),this.fragmentTracker.removeFragmentsInRange(f,E,g.PlaylistLevelType.SUBTITLE)}},_.onError=function(y,m){var f,d=m.frag;if(!d||d.type!==g.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},_.onSubtitleTracksUpdated=function(y,m){var f=this,d=m.subtitleTracks;this.tracksBuffered=[],this.levels=d.map(function(a){return new s.Level(a)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(a){f.tracksBuffered[a.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(y,m){if(this.currentTrackId=m.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(e)},_.onSubtitleTrackLoaded=function(y,m){var f,d=m.details,a=m.id,o=this.currentTrackId,c=this.levels;if(!c.length)return;var h=c[o];if(a>=c.length||a!==o||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(f=h.details)!==null&&f!==void 0&&f.live){var E=this.mainDetails;if(d.deltaUpdateFailed||!E)return;var R=E.fragments[0];if(!h.details)d.hasProgramDateTime&&E.hasProgramDateTime?Object(C.alignMediaPlaylistByPDT)(d,E):R&&Object(S.addSliding)(d,R.start);else{var w=this.alignPlaylists(d,h.details);w===0&&R&&Object(S.addSliding)(d,R.start)}}if(h.details=d,this.levelLastLoaded=a,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var P=Object(M.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);P||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},_._handleFragmentLoadComplete=function(y){var m=y.frag,f=y.payload,d=m.decryptdata,a=this.hls;if(this.fragContextChanged(m))return;if(f&&f.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),d.key.buffer,d.iv.buffer).then(function(c){var h=performance.now();a.trigger(L.Events.FRAG_DECRYPTED,{frag:m,payload:c,stats:{tstart:o,tdecrypt:h}})})}},_.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var y,m=this.currentTrackId,f=this.levels;if(!f.length||!f[m]||!f[m].details)return;var d=f[m].details,a=d.targetduration,o=this.config,c=this.media,h=A.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,c.currentTime-a,o.maxBufferHole),E=h.end,R=h.len,w=this.getMaxBufferLength()+a;if(R>w)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var P=d.fragments,D=P.length,U=d.edge,I,k=this.fragPrevious;if(E<U){var H=o.maxFragLookUpTolerance;k&&d.hasProgramDateTime&&(I=Object(M.findFragmentByPDT)(P,k.endProgramDateTime,H)),I||(I=Object(M.findFragmentByPTS)(k,P,E,H),!I&&k&&k.start<P[0].start&&(I=P[0]))}else I=P[D-1];(y=I)!==null&&y!==void 0&&y.encrypted?(T.logger.log("Loading key for "+I.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(L.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===x.FragmentState.NOT_LOADED&&this.loadFragment(I,d,E)}},_.loadFragment=function(y,m,f){this.fragCurrent=y,i.prototype.loadFragment.call(this,y,m,f)},n(b,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),b}(v.default)},"./src/controller/subtitle-track-controller.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/events.ts"),T=O("./src/utils/texttrack-utils.ts"),A=O("./src/controller/base-playlist-controller.ts"),M=O("./src/types/loader.ts");function C(r,n){for(var u=0;u<n.length;u++){var l=n[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function S(r,n,u){return n&&C(r.prototype,n),u&&C(r,u),r}function x(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,v(r,n)}function v(r,n){return v=Object.setPrototypeOf||function(l,e){return l.__proto__=e,l},v(r,n)}var g=function(r){x(n,r);function n(l){var e;return e=r.call(this,l,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var u=n.prototype;return u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,r.prototype.destroy.call(this)},u.registerListeners=function(){var e=this.hls;e.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(L.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(L.Events.ERROR,this.onError,this)},u.onMediaAttached=function(e,t){if(this.media=t.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},u.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},u.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var e=s(this.media.textTracks);e.forEach(function(t){Object(T.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},u.onSubtitleTrackLoaded=function(e,t){var i=t.id,b=t.details,_=this.trackId,p=this.tracksInGroup[_];if(!p){this.warn("Invalid subtitle track id "+i);return}var y=p.details;p.details=t.details,this.log("subtitle track "+i+" loaded ["+b.startSN+"-"+b.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,t,y))},u.onLevelLoading=function(e,t){this.switchLevel(t.level)},u.onLevelSwitching=function(e,t){this.switchLevel(t.level)},u.switchLevel=function(e){var t=this.hls.levels[e];if(!(t!=null&&t.textGroupIds))return;var i=t.textGroupIds[t.urlId];if(this.groupId!==i){var b=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(m){return!i||m.groupId===i});this.tracksInGroup=_;var p=this.findTrackId(b==null?void 0:b.name)||this.findTrackId();this.groupId=i;var y={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(L.Events.SUBTITLE_TRACKS_UPDATED,y),p!==-1&&this.setSubtitleTrack(p,b)}},u.findTrackId=function(e){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var b=t[i];if((!this.selectDefaultTrack||b.default)&&(!e||e===b.name))return b.id}return-1},u.onError=function(e,t){if(r.prototype.onError.call(this,e,t),t.fatal||!t.context)return;t.context.type===M.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},u.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var i=t.id,b=t.groupId,_=t.url;if(e)try{_=e.addDirectives(_)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADING,{url:_,id:i,groupId:b,deliveryDirectives:e||null})}},u.toggleTrackModes=function(e){var t=this,i=this.media,b=this.subtitleDisplay,_=this.trackId;if(!i)return;var p=s(i.textTracks),y=p.filter(function(d){return d.groupId===t.groupId});if(e===-1)[].slice.call(p).forEach(function(d){d.mode="disabled"});else{var m=y[_];m&&(m.mode="disabled")}var f=y[e];f&&(f.mode=b?"showing":"hidden")},u.setSubtitleTrack=function(e,t){var i,b=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(i=b[e])!==null&&i!==void 0&&i.details)||e<-1||e>=b.length)return;this.clearTimer();var _=b[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,_){var p=_.id,y=_.groupId,m=y===void 0?"":y,f=_.name,d=_.type,a=_.url;this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:m,name:f,type:d,url:a});var o=this.switchParams(_.url,t==null?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:e})},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,t=s(this.media.textTracks),i=0;i<t.length;i++)if(t[i].mode==="hidden")e=i;else if(t[i].mode==="showing"){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},S(n,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}]),n}(A.default);function s(r){for(var n=[],u=0;u<r.length;u++){var l=r[u];l.kind==="subtitles"&&l.label&&n.push(r[u])}return n}N.default=g},"./src/controller/timeline-controller.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"TimelineController",function(){return s});var L=O("./src/polyfills/number.ts"),T=O("./src/events.ts"),A=O("./src/utils/cea-608-parser.ts"),M=O("./src/utils/output-filter.ts"),C=O("./src/utils/webvtt-parser.ts"),S=O("./src/utils/texttrack-utils.ts"),x=O("./src/utils/imsc1-ttml-parser.ts"),v=O("./src/types/loader.ts"),g=O("./src/utils/logger.ts"),s=function(){function l(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=u(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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 i=new M.default(this,"textTrack1"),b=new M.default(this,"textTrack2"),_=new M.default(this,"textTrack3"),p=new M.default(this,"textTrack4");this.cea608Parser1=new A.default(1,i,b),this.cea608Parser2=new A.default(3,_,p)}t.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(T.Events.FRAG_LOADING,this.onFragLoading,this),t.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=l.prototype;return e.destroy=function(){var i=this.hls;i.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(T.Events.FRAG_LOADING,this.onFragLoading,this),i.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(i,b,_,p,y){for(var m=!1,f=y.length;f--;){var d=y[f],a=n(d[0],d[1],b,_);if(a>=0&&(d[0]=Math.min(d[0],b),d[1]=Math.max(d[1],_),m=!0,a/(_-b)>.5))return}if(m||y.push([b,_]),this.config.renderTextTracksNatively){var o=this.captionsTracks[i];this.Cues.newCue(o,b,_,p)}else{var c=this.Cues.newCue(null,b,_,p);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:c,track:i})}},e.onInitPtsFound=function(i,b){var _=this,p=b.frag,y=b.id,m=b.initPTS,f=b.timescale,d=this.unparsedVttFrags;y==="main"&&(this.initPTS[p.cc]=m,this.timescale[p.cc]=f),d.length&&(this.unparsedVttFrags=[],d.forEach(function(a){_.onFragLoaded(T.Events.FRAG_LOADED,a)}))},e.getExistingTrack=function(i){var b=this.media;if(b)for(var _=0;_<b.textTracks.length;_++){var p=b.textTracks[_];if(p[i])return p}return null},e.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},e.createNativeTrack=function(i){if(this.captionsTracks[i])return;var b=this.captionsProperties,_=this.captionsTracks,p=this.media,y=b[i],m=y.label,f=y.languageCode,d=this.getExistingTrack(i);if(d)_[i]=d,Object(S.clearCurrentCues)(_[i]),Object(S.sendAddTrackEvent)(_[i],p);else{var a=this.createTextTrack("captions",m,f);a&&(a[i]=!0,_[i]=a)}},e.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var b=this.captionsProperties[i];if(!b)return;var _=b.label,p={_id:i,label:_,kind:"captions",default:b.media?!!b.media.default:!1,closedCaptions:b.media};this.nonNativeCaptionsTracks[i]=p,this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},e.createTextTrack=function(i,b,_){var p=this.media;return p?p.addTextTrack(i,b,_):void 0},e.onMediaAttaching=function(i,b){this.media=b.media,this._cleanTracks()},e.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(b){Object(S.clearCurrentCues)(i[b]),delete i[b]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=u(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var i=this.media;if(!i)return;var b=i.textTracks;if(b)for(var _=0;_<b.length;_++)Object(S.clearCurrentCues)(b[_])},e.onSubtitleTracksUpdated=function(i,b){var _=this;this.textTracks=[];var p=b.subtitleTracks||[],y=p.some(function(a){return a.textCodec===x.IMSC1_CODEC});if(this.config.enableWebVTT||y&&this.config.enableIMSC1){var m=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,o){var c;if(o<f.length){for(var h=null,E=0;E<f.length;E++)if(r(f[E],a)){h=f[E];break}h&&(c=h)}c?Object(S.clearCurrentCues)(c):(c=_.createTextTrack("subtitles",a.name,a.lang),c&&(c.mode="disabled")),c&&(c.groupId=a.groupId,_.textTracks.push(c))})}else if(!m&&this.tracks&&this.tracks.length){var d=this.tracks.map(function(a){return{label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}});this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}},e.onManifestLoaded=function(i,b){var _=this;this.config.enableCEA708Captions&&b.captions&&b.captions.forEach(function(p){var y=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!y)return;var m="textTrack"+y[1],f=_.captionsProperties[m];if(!f)return;f.label=p.name,p.lang&&(f.languageCode=p.lang),f.media=p})},e.onFragLoading=function(i,b){var _=this.cea608Parser1,p=this.cea608Parser2,y=this.lastSn,m=this.lastPartIndex;if(!this.enabled||!(_&&p))return;if(b.frag.type===v.PlaylistLevelType.MAIN){var f,d,a=b.frag.sn,o=(f=b==null||((d=b.part)===null||d===void 0)?void 0:d.index)!=null?f:-1;a===y+1||a===y&&o===m+1||(_.reset(),p.reset()),this.lastSn=a,this.lastPartIndex=o}},e.onFragLoaded=function(i,b){var _=b.frag,p=b.payload,y=this.initPTS,m=this.unparsedVttFrags;if(_.type===v.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(L.isFiniteNumber)(y[_.cc])){m.push(b),y.length&&this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var f=_.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var d=this.tracks[_.level],a=this.vttCCs;a[_.cc]||(a[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),d&&d.textCodec===x.IMSC1_CODEC?this._parseIMSC1(_,p):this._parseVTTs(_,p,a)}}else this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(i,b){var _=this,p=this.hls;Object(x.parseIMSC1)(b,this.initPTS[i.cc],this.timescale[i.cc],function(y){_._appendCues(y,i.level),p.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(y){g.logger.log("Failed to parse IMSC1: "+y),p.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:y})})},e._parseVTTs=function(i,b,_){var p=this,y=this.hls;Object(C.parseWebVTT)(b,this.initPTS[i.cc],this.timescale[i.cc],_,i.cc,i.start,function(m){p._appendCues(m,i.level),y.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(m){p._fallbackToIMSC1(i,b),g.logger.log("Failed to parse VTT cue: "+m),y.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:m})})},e._fallbackToIMSC1=function(i,b){var _=this,p=this.tracks[i.level];p.textCodec||Object(x.parseIMSC1)(b,this.initPTS[i.cc],this.timescale[i.cc],function(){p.textCodec=x.IMSC1_CODEC,_._parseIMSC1(i,b)},function(){p.textCodec="wvtt"})},e._appendCues=function(i,b){var _=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[b];if(p.mode==="disabled")return;i.forEach(function(f){return Object(S.addCueToTrack)(p,f)})}else{var y=this.tracks[b],m=y.default?"default":"subtitles"+b;_.trigger(T.Events.CUES_PARSED,{type:"subtitles",cues:i,track:m})}},e.onFragDecrypted=function(i,b){var _=b.frag;if(_.type===v.PlaylistLevelType.SUBTITLE){if(!Object(L.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(b);return}this.onFragLoaded(T.Events.FRAG_LOADED,b)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(i,b){var _=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(_&&p))return;for(var y=0;y<b.samples.length;y++){var m=b.samples[y].bytes;if(m){var f=this.extractCea608Data(m);_.addData(b.samples[y].pts,f[0]),p.addData(b.samples[y].pts,f[1])}}},e.onBufferFlushing=function(i,b){var _=b.startOffset,p=b.endOffset,y=b.endOffsetSubtitles,m=b.type,f=this.media;if(!f||f.currentTime<p)return;if(!m||m==="video"){var d=this.captionsTracks;Object.keys(d).forEach(function(o){return Object(S.removeCuesInRange)(d[o],_,p)})}if(this.config.renderTextTracksNatively&&(_===0&&y!==void 0)){var a=this.textTracks;Object.keys(a).forEach(function(o){return Object(S.removeCuesInRange)(a[o],_,y)})}},e.extractCea608Data=function(i){for(var b=i[0]&31,_=2,p=[[],[]],y=0;y<b;y++){var m=i[_++],f=127&i[_++],d=127&i[_++],a=(4&m)!==0,o=3&m;if(f===0&&d===0)continue;a&&((o===0||o===1)&&(p[o].push(f),p[o].push(d)))}return p},l}();function r(l,e){return l&&l.label===e.name&&!(l.textTrack1||l.textTrack2)}function n(l,e,t,i){return Math.min(e,i)-Math.max(l,t)}function u(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return L});var L=function(){function T(M,C){this.subtle=void 0,this.aesIV=void 0,this.subtle=M,this.aesIV=C}var A=T.prototype;return A.decrypt=function(C,S){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},S,C)},T}()},"./src/crypt/aes-decryptor.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"removePadding",function(){return T}),O.d(N,"default",function(){return A});var L=O("./src/utils/typed-array.ts");function T(M){var C=M.byteLength,S=C&&new DataView(M.buffer).getUint8(C-1);return S?Object(L.sliceUint8)(M,0,C-S):M}var A=function(){function M(){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 C=M.prototype;return C.uint8ArrayToUint32Array_=function(x){for(var v=new DataView(x),g=new Uint32Array(4),s=0;s<4;s++)g[s]=v.getUint32(s*4);return g},C.initTable=function(){var x=this.sBox,v=this.invSBox,g=this.subMix,s=g[0],r=g[1],n=g[2],u=g[3],l=this.invSubMix,e=l[0],t=l[1],i=l[2],b=l[3],_=new Uint32Array(256),p=0,y=0,m=0;for(m=0;m<256;m++)m<128?_[m]=m<<1:_[m]=m<<1^283;for(m=0;m<256;m++){var f=y^y<<1^y<<2^y<<3^y<<4;f=f>>>8^f&255^99,x[p]=f,v[f]=p;var d=_[p],a=_[d],o=_[a],c=_[f]*257^f*16843008;s[p]=c<<24|c>>>8,r[p]=c<<16|c>>>16,n[p]=c<<8|c>>>24,u[p]=c,c=o*16843009^a*65537^d*257^p*16843008,e[f]=c<<24|c>>>8,t[f]=c<<16|c>>>16,i[f]=c<<8|c>>>24,b[f]=c,p?(p=d^_[_[_[o^d]]],y^=_[_[y]]):p=y=1}},C.expandKey=function(x){for(var v=this.uint8ArrayToUint32Array_(x),g=!0,s=0;s<v.length&&g;)g=v[s]===this.key[s],s++;if(g)return;this.key=v;var r=this.keySize=v.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);var n=this.ksRows=(r+6+1)*4,u,l,e=this.keySchedule=new Uint32Array(n),t=this.invKeySchedule=new Uint32Array(n),i=this.sBox,b=this.rcon,_=this.invSubMix,p=_[0],y=_[1],m=_[2],f=_[3],d,a;for(u=0;u<n;u++){if(u<r){d=e[u]=v[u];continue}a=d,u%r===0?(a=a<<8|a>>>24,a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[a&255],a^=b[u/r|0]<<24):r>6&&u%r===4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[a&255]),e[u]=d=(e[u-r]^a)>>>0}for(l=0;l<n;l++)u=n-l,l&3?a=e[u]:a=e[u-4],l<4||u<=4?t[l]=a:t[l]=p[i[a>>>24]]^y[i[a>>>16&255]]^m[i[a>>>8&255]]^f[i[a&255]],t[l]=t[l]>>>0},C.networkToHostOrderSwap=function(x){return x<<24|(x&65280)<<8|(x&16711680)>>8|x>>>24},C.decrypt=function(x,v,g){for(var s=this.keySize+6,r=this.invKeySchedule,n=this.invSBox,u=this.invSubMix,l=u[0],e=u[1],t=u[2],i=u[3],b=this.uint8ArrayToUint32Array_(g),_=b[0],p=b[1],y=b[2],m=b[3],f=new Int32Array(x),d=new Int32Array(f.length),a,o,c,h,E,R,w,P,D,U,I,k,H,J,$=this.networkToHostOrderSwap;v<f.length;){for(D=$(f[v]),U=$(f[v+1]),I=$(f[v+2]),k=$(f[v+3]),E=D^r[0],R=k^r[1],w=I^r[2],P=U^r[3],H=4,J=1;J<s;J++)a=l[E>>>24]^e[R>>16&255]^t[w>>8&255]^i[P&255]^r[H],o=l[R>>>24]^e[w>>16&255]^t[P>>8&255]^i[E&255]^r[H+1],c=l[w>>>24]^e[P>>16&255]^t[E>>8&255]^i[R&255]^r[H+2],h=l[P>>>24]^e[E>>16&255]^t[R>>8&255]^i[w&255]^r[H+3],E=a,R=o,w=c,P=h,H=H+4;a=n[E>>>24]<<24^n[R>>16&255]<<16^n[w>>8&255]<<8^n[P&255]^r[H],o=n[R>>>24]<<24^n[w>>16&255]<<16^n[P>>8&255]<<8^n[E&255]^r[H+1],c=n[w>>>24]<<24^n[P>>16&255]<<16^n[E>>8&255]<<8^n[R&255]^r[H+2],h=n[P>>>24]<<24^n[E>>16&255]<<16^n[R>>8&255]<<8^n[w&255]^r[H+3],d[v]=$(a^_),d[v+1]=$(h^p),d[v+2]=$(c^y),d[v+3]=$(o^m),_=D,p=U,y=I,m=k,v=v+4}return d.buffer},M}()},"./src/crypt/decrypter.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return v});var L=O("./src/crypt/aes-crypto.ts"),T=O("./src/crypt/fast-aes-key.ts"),A=O("./src/crypt/aes-decryptor.ts"),M=O("./src/utils/logger.ts"),C=O("./src/utils/mp4-tools.ts"),S=O("./src/utils/typed-array.ts"),x=16,v=function(){function g(r,n,u){var l=u===void 0?{}:u,e=l.removePKCS7Padding,t=e===void 0?!0:e;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=r,this.config=n,this.removePKCS7Padding=t,t)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(b){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var s=g.prototype;return s.destroy=function(){this.observer=null},s.isSync=function(){return this.config.enableSoftwareAES},s.flush=function(){var n=this.currentResult;if(!n){this.reset();return}var u=new Uint8Array(n);return this.reset(),this.removePKCS7Padding?Object(A.removePadding)(u):u},s.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},s.decrypt=function(n,u,l,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(n),u,l);var t=this.flush();t&&e(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(n),u,l).then(e)},s.softwareDecrypt=function(n,u,l){var e=this.currentIV,t=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(n=Object(C.appendUint8Array)(i,n),this.remainderData=null);var b=this.getValidChunk(n);if(!b.length)return null;e&&(l=e);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new A.default),_.expandKey(u);var p=t;return this.currentResult=_.decrypt(b.buffer,0,l),this.currentIV=Object(S.sliceUint8)(b,-16).buffer,p||null},s.webCryptoDecrypt=function(n,u,l){var e=this,t=this.subtle;return(this.key!==u||!this.fastAesKey)&&(this.key=u,this.fastAesKey=new T.default(t,u)),this.fastAesKey.expandKey().then(function(i){if(!t)return Promise.reject(new Error("web crypto not initialized"));var b=new L.default(t,l);return b.decrypt(n.buffer,i)}).catch(function(i){return e.onWebCryptoError(i,n,u,l)})},s.onWebCryptoError=function(n,u,l,e){return M.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",n),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(u,l,e)},s.getValidChunk=function(n){var u=n,l=n.length-n.length%x;return l!==n.length&&(u=Object(S.sliceUint8)(n,0,l),this.remainderData=Object(S.sliceUint8)(n,l)),u},s.logOnce=function(n){if(!this.logEnabled)return;M.logger.log("[decrypter.ts]: "+n),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return L});var L=function(){function T(M,C){this.subtle=void 0,this.key=void 0,this.subtle=M,this.key=C}var A=T.prototype;return A.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},T}()},"./src/demux/aacdemuxer.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/demux/base-audio-demuxer.ts"),T=O("./src/demux/adts.ts"),A=O("./src/utils/logger.ts"),M=O("./src/demux/id3.ts");function C(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,S(v,g)}function S(v,g){return S=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},S(v,g)}var x=function(v){C(g,v);function g(r,n){var u;return u=v.call(this)||this,u.observer=void 0,u.config=void 0,u.observer=r,u.config=n,u}var s=g.prototype;return s.resetInitSegment=function(n,u,l){v.prototype.resetInitSegment.call(this,n,u,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:n,duration:l,inputTimeScale:9e4,dropped:0}},g.probe=function(n){if(!n)return!1;for(var u=M.getID3Data(n,0)||[],l=u.length,e=n.length;l<e;l++)if(T.probe(n,l))return A.logger.log("ADTS sync word found !"),!0;return!1},s.canParse=function(n,u){return T.canParse(n,u)},s.appendFrame=function(n,u,l){T.initTrackConfig(n,this.observer,u,l,n.manifestCodec);var e=T.appendFrame(n,u,l,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},g}(L.default);x.minProbeByteLength=9,N.default=x},"./src/demux/adts.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"getAudioConfig",function(){return M}),O.d(N,"isHeaderPattern",function(){return C}),O.d(N,"getHeaderLength",function(){return S}),O.d(N,"getFullFrameLength",function(){return x}),O.d(N,"canGetFrameLength",function(){return v}),O.d(N,"isHeader",function(){return g}),O.d(N,"canParse",function(){return s}),O.d(N,"probe",function(){return r}),O.d(N,"initTrackConfig",function(){return n}),O.d(N,"getFrameDuration",function(){return u}),O.d(N,"parseFrameHeader",function(){return l}),O.d(N,"appendFrame",function(){return e});var L=O("./src/utils/logger.ts"),T=O("./src/errors.ts"),A=O("./src/events.ts");function M(t,i,b,_){var p,y,m,f,d=navigator.userAgent.toLowerCase(),a=_,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((i[b+2]&192)>>>6)+1;var c=(i[b+2]&60)>>>2;if(c>o.length-1){t.trigger(A.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+c});return}return m=(i[b+2]&1)<<2,m|=(i[b+3]&192)>>>6,L.logger.log("manifest codec:"+_+", ADTS type:"+p+", samplingIndex:"+c),/firefox/i.test(d)?c>=6?(p=5,f=new Array(4),y=c-3):(p=2,f=new Array(2),y=c):d.indexOf("android")!==-1?(p=2,f=new Array(2),y=c):(p=5,f=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&c>=6?y=c-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(c>=6&&m===1||/vivaldi/i.test(d))||!_&&m===1)&&(p=2,f=new Array(2)),y=c)),f[0]=p<<3,f[0]|=(c&14)>>1,f[1]|=(c&1)<<7,f[1]|=m<<3,p===5&&(f[1]|=(y&14)>>1,f[2]=(y&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:o[c],channelCount:m,codec:"mp4a.40."+p,manifestCodec:a}}function C(t,i){return t[i]===255&&(t[i+1]&246)===240}function S(t,i){return t[i+1]&1?7:9}function x(t,i){return(t[i+3]&3)<<11|t[i+4]<<3|(t[i+5]&224)>>>5}function v(t,i){return i+5<t.length}function g(t,i){return i+1<t.length&&C(t,i)}function s(t,i){return v(t,i)&&C(t,i)&&x(t,i)<=t.length-i}function r(t,i){if(g(t,i)){var b=S(t,i);if(i+b>=t.length)return!1;var _=x(t,i);if(_<=b)return!1;var p=i+_;return p===t.length||g(t,p)}return!1}function n(t,i,b,_,p){if(!t.samplerate){var y=M(i,b,_,p);if(!y)return;t.config=y.config,t.samplerate=y.samplerate,t.channelCount=y.channelCount,t.codec=y.codec,t.manifestCodec=y.manifestCodec,L.logger.log("parsed codec:"+t.codec+", rate:"+y.samplerate+", channels:"+y.channelCount)}}function u(t){return 1024*9e4/t}function l(t,i,b,_,p){var y=S(t,i),m=x(t,i);if(m-=y,m>0){var f=b+_*p;return{headerLength:y,frameLength:m,stamp:f}}}function e(t,i,b,_,p){var y=u(t.samplerate),m=l(i,b,_,p,y);if(m){var f=m.frameLength,d=m.headerLength,a=m.stamp,o=d+f,c=Math.max(0,b+o-i.length),h;c?(h=new Uint8Array(o-d),h.set(i.subarray(b+d,i.length),0)):h=i.subarray(b+d,b+o);var E={unit:h,pts:a};return c||t.samples.push(E),{sample:E,length:o,missing:c}}}},"./src/demux/base-audio-demuxer.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"initPTSFn",function(){return x});var L=O("./src/polyfills/number.ts"),T=O("./src/demux/id3.ts"),A=O("./src/demux/dummy-demuxed-track.ts"),M=O("./src/utils/mp4-tools.ts"),C=O("./src/utils/typed-array.ts"),S=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=v.prototype;return g.resetInitSegment=function(r,n,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(r,n){return!1},g.appendFrame=function(r,n,u){},g.demux=function(r,n){this.cachedData&&(r=Object(M.appendUint8Array)(this.cachedData,r),this.cachedData=null);var u=T.getID3Data(r,0),l=u?u.length:0,e,t,i=this._audioTrack,b=this._id3Track,_=u?T.getTimeStamp(u):void 0,p=r.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=x(_,n)),u&&u.length>0&&b.samples.push({pts:this.initPTS,dts:this.initPTS,data:u}),t=this.initPTS;l<p;){if(this.canParse(r,l)){var y=this.appendFrame(i,r,l);y?(this.frameIndex++,t=y.sample.pts,l+=y.length,e=l):l=p}else T.canParse(r,l)?(u=T.getID3Data(r,l),b.samples.push({pts:t,dts:t,data:u}),l+=u.length,e=l):l++;if(l===p&&e!==p){var m=Object(C.sliceUint8)(r,e);this.cachedData?this.cachedData=Object(M.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:i,avcTrack:Object(A.dummyTrack)(),id3Track:b,textTrack:Object(A.dummyTrack)()}},g.demuxSampleAes=function(r,n,u){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(r){var n=this.cachedData;return n&&(this.cachedData=null,this.demux(n,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(A.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(A.dummyTrack)()}},g.destroy=function(){},v}(),x=function(g,s){return Object(L.isFiniteNumber)(g)?g*90:s*9e4};N.default=S},"./src/demux/chunk-cache.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return L});var L=function(){function A(){this.chunks=[],this.dataLength=0}var M=A.prototype;return M.push=function(S){this.chunks.push(S),this.dataLength+=S.length},M.flush=function(){var S=this.chunks,x=this.dataLength,v;if(S.length)S.length===1?v=S[0]:v=T(S,x);else return new Uint8Array(0);return this.reset(),v},M.reset=function(){this.chunks.length=0,this.dataLength=0},A}();function T(A,M){for(var C=new Uint8Array(M),S=0,x=0;x<A.length;x++){var v=A[x];C.set(v,S),S+=v.length}return C}},"./src/demux/dummy-demuxed-track.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"dummyTrack",function(){return L});function L(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/utils/logger.ts"),T=function(){function A(C){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=C,this.bytesAvailable=C.byteLength,this.word=0,this.bitsAvailable=0}var M=A.prototype;return M.loadWord=function(){var S=this.data,x=this.bytesAvailable,v=S.byteLength-x,g=new Uint8Array(4),s=Math.min(4,x);if(s===0)throw new Error("no bytes available");g.set(S.subarray(v,v+s)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s},M.skipBits=function(S){var x;this.bitsAvailable>S?(this.word<<=S,this.bitsAvailable-=S):(S-=this.bitsAvailable,x=S>>3,S-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=S,this.bitsAvailable-=S)},M.readBits=function(S){var x=Math.min(this.bitsAvailable,S),v=this.word>>>32-x;return S>32&&L.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=S-x,x>0&&this.bitsAvailable?v<<x|this.readBits(x):v},M.skipLZ=function(){var S;for(S=0;S<this.bitsAvailable;++S)if((this.word&2147483648>>>S)!==0)return this.word<<=S,this.bitsAvailable-=S,S;return this.loadWord(),S+this.skipLZ()},M.skipUEG=function(){this.skipBits(1+this.skipLZ())},M.skipEG=function(){this.skipBits(1+this.skipLZ())},M.readUEG=function(){var S=this.skipLZ();return this.readBits(S+1)-1},M.readEG=function(){var S=this.readUEG();return 1&S?1+S>>>1:-1*(S>>>1)},M.readBoolean=function(){return this.readBits(1)===1},M.readUByte=function(){return this.readBits(8)},M.readUShort=function(){return this.readBits(16)},M.readUInt=function(){return this.readBits(32)},M.skipScalingList=function(S){for(var x=8,v=8,g,s=0;s<S;s++)v!==0&&(g=this.readEG(),v=(x+g+256)%256),x=v===0?x:v},M.readSPS=function(){var S=0,x=0,v=0,g=0,s,r,n,u=this.readUByte.bind(this),l=this.readBits.bind(this),e=this.readUEG.bind(this),t=this.readBoolean.bind(this),i=this.skipBits.bind(this),b=this.skipEG.bind(this),_=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);u();var y=u();if(l(5),i(3),u(),_(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){var m=e();if(m===3&&i(1),_(),_(),i(1),t())for(r=m!==3?8:12,n=0;n<r;n++)t()&&(n<6?p(16):p(64))}_();var f=e();if(f===0)e();else if(f===1)for(i(1),b(),b(),s=e(),n=0;n<s;n++)b();_(),i(1);var d=e(),a=e(),o=l(1);o===0&&i(1),i(1),t()&&(S=e(),x=e(),v=e(),g=e());var c=[1,1];if(t()&&t()){var h=u();switch(h){case 1:c=[1,1];break;case 2:c=[12,11];break;case 3:c=[10,11];break;case 4:c=[16,11];break;case 5:c=[40,33];break;case 6:c=[24,11];break;case 7:c=[20,11];break;case 8:c=[32,11];break;case 9:c=[80,33];break;case 10:c=[18,11];break;case 11:c=[15,11];break;case 12:c=[64,33];break;case 13:c=[160,99];break;case 14:c=[4,3];break;case 15:c=[3,2];break;case 16:c=[2,1];break;case 255:{c=[u()<<8|u(),u()<<8|u()];break}}}return{width:Math.ceil((d+1)*16-S*2-x*2),height:(2-o)*(a+1)*16-(o?2:4)*(v+g),pixelRatio:c}},M.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},A}();N.default=T},"./src/demux/id3.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"isHeader",function(){return L}),O.d(N,"isFooter",function(){return T}),O.d(N,"getID3Data",function(){return A}),O.d(N,"canParse",function(){return C}),O.d(N,"getTimeStamp",function(){return S}),O.d(N,"isTimeStampFrame",function(){return x}),O.d(N,"getID3Frames",function(){return g}),O.d(N,"decodeFrame",function(){return s}),O.d(N,"utf8ArrayToStr",function(){return e}),O.d(N,"testables",function(){return t});var L=function(p,y){return y+10<=p.length&&(p[y]===73&&p[y+1]===68&&p[y+2]===51&&(p[y+3]<255&&p[y+4]<255&&(p[y+6]<128&&p[y+7]<128&&p[y+8]<128&&p[y+9]<128)))},T=function(p,y){return y+10<=p.length&&(p[y]===51&&p[y+1]===68&&p[y+2]===73&&(p[y+3]<255&&p[y+4]<255&&(p[y+6]<128&&p[y+7]<128&&p[y+8]<128&&p[y+9]<128)))},A=function(p,y){for(var m=y,f=0;L(p,y);){f+=10;var d=M(p,y+6);f+=d,T(p,y+10)&&(f+=10),y+=f}return f>0?p.subarray(m,m+f):void 0},M=function(p,y){var m=0;return m=(p[y]&127)<<21,m|=(p[y+1]&127)<<14,m|=(p[y+2]&127)<<7,m|=p[y+3]&127,m},C=function(p,y){return L(p,y)&&M(p,y+6)+10<=p.length-y},S=function(p){for(var y=g(p),m=0;m<y.length;m++){var f=y[m];if(x(f))return l(f)}return},x=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},v=function(p){var y=String.fromCharCode(p[0],p[1],p[2],p[3]),m=M(p,4),f=10;return{type:y,size:m,data:p.subarray(f,f+m)}},g=function(p){for(var y=0,m=[];L(p,y);){var f=M(p,y+6);y+=10;for(var d=y+f;y+8<d;){var a=v(p.subarray(y)),o=s(a);o&&m.push(o),y+=a.size+10}T(p,y)&&(y+=10)}return m},s=function(p){return p.type==="PRIV"?r(p):p.type[0]==="W"?u(p):n(p)},r=function(p){if(p.size<2)return;var y=e(p.data,!0),m=new Uint8Array(p.data.subarray(y.length+1));return{key:p.type,info:y,data:m.buffer}},n=function(p){if(p.size<2)return;if(p.type==="TXXX"){var y=1,m=e(p.data.subarray(y),!0);y+=m.length+1;var f=e(p.data.subarray(y));return{key:p.type,info:m,data:f}}var d=e(p.data.subarray(1));return{key:p.type,data:d}},u=function(p){if(p.type==="WXXX"){if(p.size<2)return;var y=1,m=e(p.data.subarray(y),!0);y+=m.length+1;var f=e(p.data.subarray(y));return{key:p.type,info:m,data:f}}var d=e(p.data);return{key:p.type,data:d}},l=function(p){if(p.data.byteLength===8){var y=new Uint8Array(p.data),m=y[3]&1,f=(y[4]<<23)+(y[5]<<15)+(y[6]<<7)+y[7];return f/=45,m&&(f+=4772185884e-2),Math.round(f)}return},e=function(p,y){y===void 0&&(y=!1);var m=b();if(m){var f=m.decode(p);if(y){var d=f.indexOf("\0");return d!==-1?f.substring(0,d):f}return f.replace(/\0/g,"")}for(var a=p.length,o,c,h,E="",R=0;R<a;){if(o=p[R++],o===0&&y)return E;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:E+=String.fromCharCode(o);break;case 12:case 13:c=p[R++],E+=String.fromCharCode((o&31)<<6|c&63);break;case 14:c=p[R++],h=p[R++],E+=String.fromCharCode((o&15)<<12|(c&63)<<6|(h&63)<<0);break;default:}}return E},t={decodeTextFrame:n},i;function b(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/demux/base-audio-demuxer.ts"),T=O("./src/demux/id3.ts"),A=O("./src/utils/logger.ts"),M=O("./src/demux/mpegaudio.ts");function C(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,S(v,g)}function S(v,g){return S=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},S(v,g)}var x=function(v){C(g,v);function g(){return v.apply(this,arguments)||this}var s=g.prototype;return s.resetInitSegment=function(n,u,l){v.prototype.resetInitSegment.call(this,n,u,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:n,duration:l,inputTimeScale:9e4,dropped:0}},g.probe=function(n){if(!n)return!1;for(var u=T.getID3Data(n,0)||[],l=u.length,e=n.length;l<e;l++)if(M.probe(n,l))return A.logger.log("MPEG Audio sync word found !"),!0;return!1},s.canParse=function(n,u){return M.canParse(n,u)},s.appendFrame=function(n,u,l){return this.initPTS===null?void 0:M.appendFrame(n,u,l,this.initPTS,this.frameIndex)},g}(L.default);x.minProbeByteLength=4,N.default=x},"./src/demux/mp4demuxer.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/utils/mp4-tools.ts"),T=O("./src/demux/dummy-demuxed-track.ts"),A=function(){function M(S,x){this.remainderData=null,this.config=void 0,this.config=x}var C=M.prototype;return C.resetTimeStamp=function(){},C.resetInitSegment=function(){},C.resetContiguity=function(){},M.probe=function(x){return Object(L.findBox)({data:x,start:0,end:Math.min(x.length,16384)},["moof"]).length>0},C.demux=function(x){var v=x,g=Object(T.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(L.appendUint8Array)(this.remainderData,x));var s=Object(L.segmentValidRange)(v);this.remainderData=s.remainder,g.samples=s.valid||new Uint8Array}else g.samples=v;return{audioTrack:Object(T.dummyTrack)(),avcTrack:g,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},C.flush=function(){var x=Object(T.dummyTrack)();return x.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(T.dummyTrack)(),avcTrack:x,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},C.demuxSampleAes=function(x,v,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},C.destroy=function(){},M}();A.minProbeByteLength=1024,N.default=A},"./src/demux/mpegaudio.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"appendFrame",function(){return S}),O.d(N,"parseHeader",function(){return x}),O.d(N,"isHeaderPattern",function(){return v}),O.d(N,"isHeader",function(){return g}),O.d(N,"canParse",function(){return s}),O.d(N,"probe",function(){return r});var L=null,T=[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],A=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],M=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],C=[0,1,1,4];function S(n,u,l,e,t){if(l+24>u.length)return;var i=x(u,l);if(i&&l+i.frameLength<=u.length){var b=i.samplesPerFrame*9e4/i.sampleRate,_=e+t*b,p={unit:u.subarray(l,l+i.frameLength),pts:_,dts:_};return n.config=[],n.channelCount=i.channelCount,n.samplerate=i.sampleRate,n.samples.push(p),{sample:p,length:i.frameLength,missing:0}}}function x(n,u){var l=n[u+1]>>3&3,e=n[u+1]>>1&3,t=n[u+2]>>4&15,i=n[u+2]>>2&3;if(l!==1&&t!==0&&t!==15&&i!==3){var b=n[u+2]>>1&1,_=n[u+3]>>6,p=l===3?3-e:e===3?3:4,y=T[p*14+t-1]*1e3,m=l===3?0:l===2?1:2,f=A[m*3+i],d=_===3?1:2,a=M[l][e],o=C[e],c=a*8*o,h=Math.floor(a*y/f+b)*o;if(L===null){var E=navigator.userAgent||"",R=E.match(/Chrome\/(\d+)/i);L=R?parseInt(R[1]):0}var w=!!L&&L<=87;return w&&e===2&&y>=224e3&&_===0&&(n[u+3]=n[u+3]|128),{sampleRate:f,channelCount:d,frameLength:h,samplesPerFrame:c}}}function v(n,u){return n[u]===255&&(n[u+1]&224)===224&&(n[u+1]&6)!==0}function g(n,u){return u+1<n.length&&v(n,u)}function s(n,u){var l=4;return v(n,u)&&l<=n.length-u}function r(n,u){if(u+1<n.length&&v(n,u)){var l=4,e=x(n,u),t=l;e!=null&&e.frameLength&&(t=e.frameLength);var i=u+t;return i===n.length||g(n,i)}return!1}},"./src/demux/sample-aes.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/crypt/decrypter.ts"),T=O("./src/demux/tsdemuxer.ts"),A=function(){function M(S,x,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new L.default(S,x,{removePKCS7Padding:!1})}var C=M.prototype;return C.decryptBuffer=function(x,v){this.decrypter.decrypt(x,this.keyData.key.buffer,this.keyData.iv.buffer,v)},C.decryptAacSample=function(x,v,g,s){var r=x[v].unit,n=r.subarray(16,r.length-r.length%16),u=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),l=this;this.decryptBuffer(u,function(e){var t=new Uint8Array(e);r.set(t,16),s||l.decryptAacSamples(x,v+1,g)})},C.decryptAacSamples=function(x,v,g){for(;;v++){if(v>=x.length){g();return}if(x[v].unit.length<32)continue;var s=this.decrypter.isSync();if(this.decryptAacSample(x,v,g,s),!s)return}},C.getAvcEncryptedData=function(x){for(var v=Math.floor((x.length-48)/160)*16+16,g=new Int8Array(v),s=0,r=32;r<=x.length-16;r+=160,s+=16)g.set(x.subarray(r,r+16),s);return g},C.getAvcDecryptedUnit=function(x,v){for(var g=new Uint8Array(v),s=0,r=32;r<=x.length-16;r+=160,s+=16)x.set(g.subarray(s,s+16),r);return x},C.decryptAvcSample=function(x,v,g,s,r,n){var u=Object(T.discardEPB)(r.data),l=this.getAvcEncryptedData(u),e=this;this.decryptBuffer(l.buffer,function(t){r.data=e.getAvcDecryptedUnit(u,t),n||e.decryptAvcSamples(x,v,g+1,s)})},C.decryptAvcSamples=function(x,v,g,s){if(x instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,g=0){if(v>=x.length){s();return}for(var r=x[v].units;!(g>=r.length);g++){var n=r[g];if(n.data.length<=48||n.type!==1&&n.type!==5)continue;var u=this.decrypter.isSync();if(this.decryptAvcSample(x,v,g,s,n,u),!u)return}}},M}();N.default=A},"./src/demux/transmuxer-interface.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return r});var L=O("./node_modules/webworkify-webpack/index.js"),T=O.n(L),A=O("./src/events.ts"),M=O("./src/demux/transmuxer.ts"),C=O("./src/utils/logger.ts"),S=O("./src/errors.ts"),x=O("./src/utils/mediasource-helper.ts"),v=O("./node_modules/eventemitter3/index.js"),g=O.n(v),s=Object(x.getMediaSource)()||{isTypeSupported:function(){return!1}},r=function(){function n(l,e,t,i){var b=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=l,this.id=e,this.onTransmuxComplete=t,this.onFlush=i;var _=l.config,p=function(a,o){o=o||{},o.frag=b.frag,o.id=b.id,l.trigger(a,o)};this.observer=new v.EventEmitter,this.observer.on(A.Events.FRAG_DECRYPTED,p),this.observer.on(A.Events.ERROR,p);var y={mp4:s.isTypeSupported("video/mp4"),mpeg:s.isTypeSupported("audio/mpeg"),mp3:s.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){C.logger.log("demuxing in webworker");var f;try{f=this.worker=L("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(d){l.trigger(A.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},f.postMessage({cmd:"init",typeSupported:y,vendor:m,id:e,config:JSON.stringify(_)})}catch(d){C.logger.warn("Error in worker:",d),C.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new M.default(this.observer,y,_,m,e),this.worker=null}}else this.transmuxer=new M.default(this.observer,y,_,m,e)}var u=n.prototype;return u.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},u.push=function(e,t,i,b,_,p,y,m,f,d){var a=this;f.transmuxing.start=self.performance.now();var o=this.transmuxer,c=this.worker,h=p?p.start:_.start,E=_.decryptdata,R=this.frag,w=!(R&&_.cc===R.cc),P=!(R&&f.level===R.level),D=R?f.sn-R.sn:-1,U=this.part?f.part-this.part.index:1,I=!P&&(D===1||D===0&&U===1),k=self.performance.now();(P||D||_.stats.parsing.start===0)&&(_.stats.parsing.start=k),p&&(U||!I)&&(p.stats.parsing.start=k);var H=new M.TransmuxState(w,I,m,P,h);if(!I||w){C.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
discontinuity: `+w+`
trackSwitch: `+P+`
contiguous: `+I+`
accurateTimeOffset: `+m+`
timeOffset: `+h);var J=new M.TransmuxConfig(i,b,t,y,d);this.configureTransmuxer(J)}if(this.frag=_,this.part=p,c)c.postMessage({cmd:"demux",data:e,decryptdata:E,chunkMeta:f,state:H},e instanceof ArrayBuffer?[e]:[]);else if(o){var $=o.push(e,E,f,H);Object(M.isPromise)($)?$.then(function(fe){a.handleTransmuxComplete(fe)}):this.handleTransmuxComplete($)}},u.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var i=this.transmuxer,b=this.worker;if(b)b.postMessage({cmd:"flush",chunkMeta:e});else if(i){var _=i.flush(e);Object(M.isPromise)(_)?_.then(function(p){t.handleFlushResult(p,e)}):this.handleFlushResult(_,e)}},u.handleFlushResult=function(e,t){var i=this;e.forEach(function(b){i.handleTransmuxComplete(b)}),this.onFlush(t)},u.onWorkerMessage=function(e){var t=e.data,i=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data);break}}},u.configureTransmuxer=function(e){var t=this.worker,i=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):i&&i.configure(e)},u.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},n}()},"./src/demux/transmuxer-worker.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return S});var L=O("./src/demux/transmuxer.ts"),T=O("./src/events.ts"),A=O("./src/utils/logger.ts"),M=O("./node_modules/eventemitter3/index.js"),C=O.n(M);function S(r){var n=new M.EventEmitter,u=function(e,t){r.postMessage({event:e,data:t})};n.on(T.Events.FRAG_DECRYPTED,u),n.on(T.Events.ERROR,u),r.addEventListener("message",function(l){var e=l.data;switch(e.cmd){case"init":{var t=JSON.parse(e.config);r.transmuxer=new L.default(n,e.typeSupported,t,e.vendor,e.id),Object(A.enableLogs)(t.debug),u("init",null);break}case"configure":{r.transmuxer.configure(e.config);break}case"demux":{var i=r.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(L.isPromise)(i)?i.then(function(p){x(r,p)}):x(r,i);break}case"flush":{var b=e.chunkMeta,_=r.transmuxer.flush(b);Object(L.isPromise)(_)?_.then(function(p){g(r,p,b)}):g(r,_,b);break}default:break}})}function x(r,n){if(s(n.remuxResult))return;var u=[],l=n.remuxResult,e=l.audio,t=l.video;e&&v(u,e),t&&v(u,t),r.postMessage({event:"transmuxComplete",data:n},u)}function v(r,n){n.data1&&r.push(n.data1.buffer),n.data2&&r.push(n.data2.buffer)}function g(r,n,u){n.forEach(function(l){x(r,l)}),r.postMessage({event:"flush",data:u})}function s(r){return!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment}},"./src/demux/transmuxer.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return t}),O.d(N,"isPromise",function(){return _}),O.d(N,"TransmuxConfig",function(){return p}),O.d(N,"TransmuxState",function(){return y});var L=O("./src/events.ts"),T=O("./src/errors.ts"),A=O("./src/crypt/decrypter.ts"),M=O("./src/demux/aacdemuxer.ts"),C=O("./src/demux/mp4demuxer.ts"),S=O("./src/demux/tsdemuxer.ts"),x=O("./src/demux/mp3demuxer.ts"),v=O("./src/remux/mp4-remuxer.ts"),g=O("./src/remux/passthrough-remuxer.ts"),s=O("./src/demux/chunk-cache.ts"),r=O("./src/utils/mp4-tools.ts"),n=O("./src/utils/logger.ts"),u;try{u=self.performance.now.bind(self.performance)}catch(m){n.logger.debug("Unable to use Performance API on this environment"),u=self.Date.now}var l=[{demux:S.default,remux:v.default},{demux:C.default,remux:g.default},{demux:M.default,remux:v.default},{demux:x.default,remux:v.default}],e=1024;l.forEach(function(m){var f=m.demux;e=Math.max(e,f.minProbeByteLength)});var t=function(){function m(d,a,o,c,h){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 s.default,this.observer=d,this.typeSupported=a,this.config=o,this.vendor=c,this.id=h}var f=m.prototype;return f.configure=function(a){this.transmuxConfig=a,this.decrypter&&this.decrypter.reset()},f.push=function(a,o,c,h){var E=this,R=c.transmuxing;R.executeStart=u();var w=new Uint8Array(a),P=this.cache,D=this.config,U=this.currentTransmuxState,I=this.transmuxConfig;h&&(this.currentTransmuxState=h);var k=i(w,o);if(k&&k.method==="AES-128"){var H=this.getDecrypter();if(D.enableSoftwareAES){var J=H.softwareDecrypt(w,k.key.buffer,k.iv.buffer);if(!J)return R.executeEnd=u(),b(c);w=new Uint8Array(J)}else return this.decryptionPromise=H.webCryptoDecrypt(w,k.key.buffer,k.iv.buffer).then(function(Se){var Ie=E.push(Se,null,c);return E.decryptionPromise=null,Ie}),this.decryptionPromise}var $=h||U,fe=$.contiguous,he=$.discontinuity,ce=$.trackSwitch,pe=$.accurateTimeOffset,_e=$.timeOffset,oe=I.audioCodec,ne=I.videoCodec,Ee=I.defaultInitPts,ke=I.duration,we=I.initSegmentData;if((he||ce)&&this.resetInitSegment(we,oe,ne,ke),he&&this.resetInitialTimestamp(Ee),fe||this.resetContiguity(),this.needsProbing(w,he,ce)){if(P.dataLength){var Re=P.flush();w=Object(r.appendUint8Array)(Re,w)}this.configureTransmuxer(w,I)}var Ue=this.transmux(w,k,_e,pe,c),be=this.currentTransmuxState;return be.contiguous=!0,be.discontinuity=!1,be.trackSwitch=!1,R.executeEnd=u(),Ue},f.flush=function(a){var o=this,c=a.transmuxing;c.executeStart=u();var h=this.decrypter,E=this.cache,R=this.currentTransmuxState,w=this.decryptionPromise;if(w)return w.then(function(){return o.flush(a)});var P=[],D=R.timeOffset;if(h){var U=h.flush();U&&P.push(this.push(U,null,a))}var I=E.dataLength;E.reset();var k=this.demuxer,H=this.remuxer;if(!k||!H)return I>=e&&this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),c.executeEnd=u(),[b(a)];var J=k.flush(D);return _(J)?J.then(function($){return o.flushRemux(P,$,a),P}):(this.flushRemux(P,J,a),P)},f.flushRemux=function(a,o,c){var h=o.audioTrack,E=o.avcTrack,R=o.id3Track,w=o.textTrack,P=this.currentTransmuxState,D=P.accurateTimeOffset,U=P.timeOffset;n.logger.log("[transmuxer.ts]: Flushed fragment "+c.sn+(c.part>-1?" p: "+c.part:"")+" of level "+c.level);var I=this.remuxer.remux(h,E,R,w,U,D,!0,this.id);a.push({remuxResult:I,chunkMeta:c}),c.transmuxing.executeEnd=u()},f.resetInitialTimestamp=function(a){var o=this.demuxer,c=this.remuxer;if(!o||!c)return;o.resetTimeStamp(a),c.resetTimeStamp(a)},f.resetContiguity=function(){var a=this.demuxer,o=this.remuxer;if(!a||!o)return;a.resetContiguity(),o.resetNextTimestamp()},f.resetInitSegment=function(a,o,c,h){var E=this.demuxer,R=this.remuxer;if(!E||!R)return;E.resetInitSegment(o,c,h),R.resetInitSegment(a,o,c)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(a,o,c,h,E){var R;return o&&o.method==="SAMPLE-AES"?R=this.transmuxSampleAes(a,o,c,h,E):R=this.transmuxUnencrypted(a,c,h,E),R},f.transmuxUnencrypted=function(a,o,c,h){var E=this.demuxer.demux(a,o,!1,!this.config.progressive),R=E.audioTrack,w=E.avcTrack,P=E.id3Track,D=E.textTrack,U=this.remuxer.remux(R,w,P,D,o,c,!1,this.id);return{remuxResult:U,chunkMeta:h}},f.transmuxSampleAes=function(a,o,c,h,E){var R=this;return this.demuxer.demuxSampleAes(a,o,c).then(function(w){var P=R.remuxer.remux(w.audioTrack,w.avcTrack,w.id3Track,w.textTrack,c,h,!1,R.id);return{remuxResult:P,chunkMeta:E}})},f.configureTransmuxer=function(a,o){for(var c=this.config,h=this.observer,E=this.typeSupported,R=this.vendor,w=o.audioCodec,P=o.defaultInitPts,D=o.duration,U=o.initSegmentData,I=o.videoCodec,k,H=0,J=l.length;H<J;H++)if(l[H].demux.probe(a)){k=l[H];break}k||(n.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),k={demux:C.default,remux:g.default});var $=this.demuxer,fe=this.remuxer,he=k.remux,ce=k.demux;(!fe||!(fe instanceof he))&&(this.remuxer=new he(h,c,E,R)),(!$||!($ instanceof ce))&&(this.demuxer=new ce(h,c,E),this.probe=ce.probe),this.resetInitSegment(U,w,I,D),this.resetInitialTimestamp(P)},f.needsProbing=function(a,o,c){return!this.demuxer||!this.remuxer||o||c},f.getDecrypter=function(){var a=this.decrypter;return a||(a=this.decrypter=new A.default(this.observer,this.config)),a},m}();function i(m,f){var d=null;return m.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(d=f),d}var b=function(f){return{remuxResult:{},chunkMeta:f}};function _(m){return"then"in m&&m.then instanceof Function}var p=function(f,d,a,o,c){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=d,this.initSegmentData=a,this.duration=o,this.defaultInitPts=c},y=function(f,d,a,o,c){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=d,this.accurateTimeOffset=a,this.trackSwitch=o,this.timeOffset=c}},"./src/demux/tsdemuxer.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"discardEPB",function(){return b});var L=O("./src/demux/adts.ts"),T=O("./src/demux/mpegaudio.ts"),A=O("./src/demux/exp-golomb.ts"),M=O("./src/demux/id3.ts"),C=O("./src/demux/sample-aes.ts"),S=O("./src/events.ts"),x=O("./src/utils/mp4-tools.ts"),v=O("./src/utils/logger.ts"),g=O("./src/errors.ts"),s={video:1,audio:2,id3:3,text:4},r=function(){function _(y,m,f){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=y,this.config=m,this.typeSupported=f}_.probe=function(m){var f=_.syncOffset(m);return f<0?!1:(f&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},_.syncOffset=function(m){for(var f=Math.min(1e3,m.length-3*188),d=0;d<f;){if(m[d]===71&&m[d+188]===71&&m[d+2*188]===71)return d;d++}return-1},_.createTrack=function(m,f){return{container:m==="video"||m==="audio"?"video/mp2t":void 0,type:m,id:s[m],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:m==="audio"?f:void 0}};var p=_.prototype;return p.resetInitSegment=function(m,f,d){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",d),this._audioTrack=_.createTrack("audio",d),this._id3Track=_.createTrack("id3",d),this._txtTrack=_.createTrack("text",d),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=m,this.videoCodec=f,this._duration=d},p.resetTimeStamp=function(){},p.resetContiguity=function(){var m=this._audioTrack,f=this._avcTrack,d=this._id3Track;m&&(m.pesData=null),f&&(f.pesData=null),d&&(d.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(m,f,d,a){d===void 0&&(d=!1),a===void 0&&(a=!1),d||(this.sampleAes=null);var o,c=this._avcTrack,h=this._audioTrack,E=this._id3Track,R=c.pid,w=c.pesData,P=h.pid,D=E.pid,U=h.pesData,I=E.pesData,k=!1,H=this.pmtParsed,J=this._pmtId,$=m.length;if(this.remainderData&&(m=Object(x.appendUint8Array)(this.remainderData,m),$=m.length,this.remainderData=null),$<188&&!a)return this.remainderData=m,{audioTrack:h,avcTrack:c,id3Track:E,textTrack:this._txtTrack};var fe=Math.max(0,_.syncOffset(m));$-=($+fe)%188,$<m.byteLength&&!a&&(this.remainderData=new Uint8Array(m.buffer,$,m.buffer.byteLength-$));for(var he=fe;he<$;he+=188)if(m[he]===71){var ce=!!(m[he+1]&64),pe=((m[he+1]&31)<<8)+m[he+2],_e=(m[he+3]&48)>>4,oe=void 0;if(_e>1){if(oe=he+5+m[he+4],oe===he+188)continue}else oe=he+4;switch(pe){case R:ce&&(w&&(o=e(w))&&this.parseAVCPES(o,!1),w={data:[],size:0}),w&&(w.data.push(m.subarray(oe,he+188)),w.size+=he+188-oe);break;case P:ce&&(U&&(o=e(U))&&(h.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),U={data:[],size:0}),U&&(U.data.push(m.subarray(oe,he+188)),U.size+=he+188-oe);break;case D:ce&&(I&&(o=e(I))&&this.parseID3PES(o),I={data:[],size:0}),I&&(I.data.push(m.subarray(oe,he+188)),I.size+=he+188-oe);break;case 0:ce&&(oe+=m[oe]+1),J=this._pmtId=u(m,oe);break;case J:{ce&&(oe+=m[oe]+1);var ne=l(m,oe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);R=ne.avc,R>0&&(c.pid=R),P=ne.audio,P>0&&(h.pid=P,h.isAAC=ne.isAAC),D=ne.id3,D>0&&(E.pid=D),k&&!H&&(v.logger.log("reparse from beginning"),k=!1,he=fe-188),H=this.pmtParsed=!0;break}case 17:case 8191:break;default:k=!0;break}}else this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});c.pesData=w,h.pesData=U,E.pesData=I;var Ee={audioTrack:h,avcTrack:c,id3Track:E,textTrack:this._txtTrack};return a&&this.extractRemainingSamples(Ee),Ee},p.flush=function(){var m=this.remainderData;this.remainderData=null;var f;return m?f=this.demux(m,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},p.extractRemainingSamples=function(m){var f=m.audioTrack,d=m.avcTrack,a=m.id3Track,o=d.pesData,c=f.pesData,h=a.pesData,E;o&&(E=e(o))?(this.parseAVCPES(E,!0),d.pesData=null):d.pesData=o,c&&(E=e(c))?(f.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),f.pesData=null):(c!=null&&c.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=c),h&&(E=e(h))?(this.parseID3PES(E),a.pesData=null):a.pesData=h},p.demuxSampleAes=function(m,f,d){var a=this.demux(m,d,!0,!this.config.progressive),o=this.sampleAes=new C.default(this.observer,this.config,f);return this.decrypt(a,o)},p.decrypt=function(m,f){return new Promise(function(d){var a=m.audioTrack,o=m.avcTrack;a.samples&&a.isAAC?f.decryptAacSamples(a.samples,0,function(){o.samples?f.decryptAvcSamples(o.samples,0,0,function(){d(m)}):d(m)}):o.samples&&f.decryptAvcSamples(o.samples,0,0,function(){d(m)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(m,f){var d=this,a=this._avcTrack,o=this.parseAVCNALu(m.data),c=!1,h=this.avcSample,E,R=!1;m.data=null,h&&o.length&&!a.audFound&&(t(h,a),h=this.avcSample=n(!1,m.pts,m.dts,"")),o.forEach(function(w){switch(w.type){case 1:{E=!0,h||(h=d.avcSample=n(!0,m.pts,m.dts,"")),c&&(h.debug+="NDR "),h.frame=!0;var P=w.data;if(R&&P.length>4){var D=new A.default(P).readSliceType();(D===2||D===4||D===7||D===9)&&(h.key=!0)}break}case 5:E=!0,h||(h=d.avcSample=n(!0,m.pts,m.dts,"")),c&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{E=!0,c&&h&&(h.debug+="SEI ");var U=new A.default(b(w.data));U.readUByte();for(var I=0,k=0,H=!1,J=0;!H&&U.bytesAvailable>1;){I=0;do J=U.readUByte(),I+=J;while(J===255);k=0;do J=U.readUByte(),k+=J;while(J===255);if(I===4&&U.bytesAvailable!==0){H=!0;var $=U.readUByte();if($===181){var fe=U.readUShort();if(fe===49){var he=U.readUInt();if(he===1195456820){var ce=U.readUByte();if(ce===3){for(var pe=U.readUByte(),_e=U.readUByte(),oe=31&pe,ne=[pe,_e],Ee=0;Ee<oe;Ee++)ne.push(U.readUByte()),ne.push(U.readUByte()),ne.push(U.readUByte());i(d._txtTrack.samples,{type:3,pts:m.pts,bytes:ne})}}}}}else if(I===5&&U.bytesAvailable!==0){if(H=!0,k>16){for(var ke=[],we=0;we<16;we++)ke.push(U.readUByte().toString(16)),(we===3||we===5||we===7||we===9)&&ke.push("-");for(var Re=k-16,Ue=new Uint8Array(Re),be=0;be<Re;be++)Ue[be]=U.readUByte();i(d._txtTrack.samples,{pts:m.pts,payloadType:I,uuid:ke.join(""),userData:Object(M.utf8ArrayToStr)(Ue),userDataBytes:Ue})}}else if(k<U.bytesAvailable)for(var Se=0;Se<k;Se++)U.readUByte()}break}case 7:if(E=!0,R=!0,c&&h&&(h.debug+="SPS "),!a.sps){var Ie=new A.default(w.data),Me=Ie.readSPS();a.width=Me.width,a.height=Me.height,a.pixelRatio=Me.pixelRatio,a.sps=[w.data],a.duration=d._duration;for(var De=w.data.subarray(1,4),Te="avc1.",ye=0;ye<3;ye++){var Ge=De[ye].toString(16);Ge.length<2&&(Ge="0"+Ge),Te+=Ge}a.codec=Te}break;case 8:E=!0,c&&h&&(h.debug+="PPS "),a.pps||(a.pps=[w.data]);break;case 9:E=!1,a.audFound=!0,h&&t(h,a),h=d.avcSample=n(!1,m.pts,m.dts,c?"AUD ":"");break;case 12:E=!1;break;default:E=!1,h&&(h.debug+="unknown NAL "+w.type+" ");break}if(h&&E){var Be=h.units;Be.push(w)}}),f&&h&&(t(h,a),this.avcSample=null)},p.getLastNalUnit=function(){var m,f=this.avcSample,d;if(!f||f.units.length===0){var a=this._avcTrack.samples;f=a[a.length-1]}if((m=f)!==null&&m!==void 0&&m.units){var o=f.units;d=o[o.length-1]}return d},p.parseAVCNALu=function(m){var f=m.byteLength,d=this._avcTrack,a=d.naluState||0,o=a,c=[],h=0,E,R,w,P=-1,D=0;for(a===-1&&(P=0,D=m[0]&31,a=0,h=1);h<f;){if(E=m[h++],!a){a=E?0:1;continue}if(a===1){a=E?0:2;continue}if(!E)a=3;else if(E===1){if(P>=0){var U={data:m.subarray(P,h-a-1),type:D};c.push(U)}else{var I=this.getLastNalUnit();if(I&&(o&&h<=4-o&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-o))),R=h-a-1,R>0)){var k=new Uint8Array(I.data.byteLength+R);k.set(I.data,0),k.set(m.subarray(0,R),I.data.byteLength),I.data=k,I.state=0}}h<f?(w=m[h]&31,P=h,D=w,a=0):a=-1}else a=0}if(P>=0&&a>=0){var H={data:m.subarray(P,f),type:D,state:a};c.push(H)}if(c.length===0){var J=this.getLastNalUnit();if(J){var $=new Uint8Array(J.data.byteLength+m.byteLength);$.set(J.data,0),$.set(m,J.data.byteLength),J.data=$}}return d.naluState=a,c},p.parseAACPES=function(m){var f=0,d=this._audioTrack,a=this.aacOverFlow,o=m.data;if(a){this.aacOverFlow=null;var c=a.sample.unit.byteLength,h=Math.min(a.missing,c),E=c-h;a.sample.unit.set(o.subarray(0,h),E),d.samples.push(a.sample),f=a.missing}var R,w;for(R=f,w=o.length;R<w-1&&!L.isHeader(o,R);R++);if(R!==f){var P,D;if(R<w-1?(P="AAC PES did not start with ADTS header,offset:"+R,D=!1):(P="no ADTS header found in AAC PES",D=!0),v.logger.warn("parsing error:"+P),this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:D,reason:P}),D)return}L.initTrackConfig(d,this.observer,o,R,this.audioCodec);var U;if(m.pts!==void 0)U=m.pts;else if(a){var I=L.getFrameDuration(d.samplerate);U=a.sample.pts+I}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var k=0;R<w;)if(L.isHeader(o,R)){if(R+5<w){var H=L.appendFrame(d,o,R,U,k);if(H)if(H.missing)this.aacOverFlow=H;else{R+=H.length,k++;continue}}break}else R++},p.parseMPEGPES=function(m){var f=m.data,d=f.length,a=0,o=0,c=m.pts;if(c===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<d;)if(T.isHeader(f,o)){var h=T.appendFrame(this._audioTrack,f,o,c,a);if(h)o+=h.length,a++;else break}else o++},p.parseID3PES=function(m){if(m.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(m)},_}();r.minProbeByteLength=188;function n(_,p,y,m){return{key:_,frame:!1,pts:p,dts:y,units:[],debug:m,length:0}}function u(_,p){return(_[p+10]&31)<<8|_[p+11]}function l(_,p,y,m){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},d=(_[p+1]&15)<<8|_[p+2],a=p+3+d-4,o=(_[p+10]&15)<<8|_[p+11];for(p+=12+o;p<a;){var c=(_[p+1]&31)<<8|_[p+2];switch(_[p]){case 207:if(!m){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=c);break;case 21:f.id3===-1&&(f.id3=c);break;case 219:if(!m){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=c);break;case 3:case 4:y?f.audio===-1&&(f.audio=c,f.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((_[p+3]&15)<<8|_[p+4])+5}return f}function e(_){var p=0,y,m,f,d,a,o=_.data;if(!_||_.size===0)return null;for(;o[0].length<19&&o.length>1;){var c=new Uint8Array(o[0].length+o[1].length);c.set(o[0]),c.set(o[1],o[0].length),o[0]=c,o.splice(1,1)}y=o[0];var h=(y[0]<<16)+(y[1]<<8)+y[2];if(h===1){if(m=(y[4]<<8)+y[5],m&&m>_.size-6)return null;var E=y[7];E&192&&(d=(y[9]&14)*536870912+(y[10]&255)*4194304+(y[11]&254)*16384+(y[12]&255)*128+(y[13]&254)/2,E&64?(a=(y[14]&14)*536870912+(y[15]&255)*4194304+(y[16]&254)*16384+(y[17]&255)*128+(y[18]&254)/2,d-a>60*9e4&&(v.logger.warn(Math.round((d-a)/9e4)+"s delta between PTS and DTS, align them"),d=a)):a=d),f=y[8];var R=f+9;if(_.size<=R)return null;_.size-=R;for(var w=new Uint8Array(_.size),P=0,D=o.length;P<D;P++){y=o[P];var U=y.byteLength;if(R)if(R>U){R-=U;continue}else y=y.subarray(R),U-=R,R=0;w.set(y,p),p+=U}return m&&(m-=f+3),{data:w,pts:d,dts:a,len:m}}return null}function t(_,p){if(_.units.length&&_.frame){if(_.pts===void 0){var y=p.samples,m=y.length;if(m){var f=y[m-1];_.pts=f.pts,_.dts=f.dts}else{p.dropped++;return}}p.samples.push(_)}_.debug.length&&v.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function i(_,p){var y=_.length;if(y>0){if(p.pts>=_[y-1].pts)_.push(p);else for(var m=y-1;m>=0;m--)if(p.pts<_[m].pts){_.splice(m,0,p);break}}else _.push(p)}function b(_){for(var p=_.byteLength,y=[],m=1;m<p-2;)_[m]===0&&_[m+1]===0&&_[m+2]===3?(y.push(m+2),m+=2):m++;if(y.length===0)return _;var f=p-y.length,d=new Uint8Array(f),a=0;for(m=0;m<f;a++,m++)a===y[0]&&(a++,y.shift()),d[m]=_[a];return d}N.default=r},"./src/errors.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"ErrorTypes",function(){return L}),O.d(N,"ErrorDetails",function(){return T});var L;(function(A){A.NETWORK_ERROR="networkError",A.MEDIA_ERROR="mediaError",A.KEY_SYSTEM_ERROR="keySystemError",A.MUX_ERROR="muxError",A.OTHER_ERROR="otherError"})(L||(L={}));var T;(function(A){A.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",A.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",A.KEY_SYSTEM_NO_SESSION="keySystemNoSession",A.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",A.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",A.MANIFEST_LOAD_ERROR="manifestLoadError",A.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",A.MANIFEST_PARSING_ERROR="manifestParsingError",A.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",A.LEVEL_EMPTY_ERROR="levelEmptyError",A.LEVEL_LOAD_ERROR="levelLoadError",A.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",A.LEVEL_SWITCH_ERROR="levelSwitchError",A.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",A.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",A.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",A.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",A.FRAG_LOAD_ERROR="fragLoadError",A.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",A.FRAG_DECRYPT_ERROR="fragDecryptError",A.FRAG_PARSING_ERROR="fragParsingError",A.REMUX_ALLOC_ERROR="remuxAllocError",A.KEY_LOAD_ERROR="keyLoadError",A.KEY_LOAD_TIMEOUT="keyLoadTimeOut",A.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",A.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",A.BUFFER_APPEND_ERROR="bufferAppendError",A.BUFFER_APPENDING_ERROR="bufferAppendingError",A.BUFFER_STALLED_ERROR="bufferStalledError",A.BUFFER_FULL_ERROR="bufferFullError",A.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",A.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",A.INTERNAL_EXCEPTION="internalException",A.INTERNAL_ABORTED="aborted",A.UNKNOWN="unknown"})(T||(T={}))},"./src/events.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"Events",function(){return L});var L;(function(T){T.MEDIA_ATTACHING="hlsMediaAttaching",T.MEDIA_ATTACHED="hlsMediaAttached",T.MEDIA_DETACHING="hlsMediaDetaching",T.MEDIA_DETACHED="hlsMediaDetached",T.BUFFER_RESET="hlsBufferReset",T.BUFFER_CODECS="hlsBufferCodecs",T.BUFFER_CREATED="hlsBufferCreated",T.BUFFER_APPENDING="hlsBufferAppending",T.BUFFER_APPENDED="hlsBufferAppended",T.BUFFER_EOS="hlsBufferEos",T.BUFFER_FLUSHING="hlsBufferFlushing",T.BUFFER_FLUSHED="hlsBufferFlushed",T.MANIFEST_LOADING="hlsManifestLoading",T.MANIFEST_LOADED="hlsManifestLoaded",T.MANIFEST_PARSED="hlsManifestParsed",T.LEVEL_SWITCHING="hlsLevelSwitching",T.LEVEL_SWITCHED="hlsLevelSwitched",T.LEVEL_LOADING="hlsLevelLoading",T.LEVEL_LOADED="hlsLevelLoaded",T.LEVEL_UPDATED="hlsLevelUpdated",T.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",T.LEVELS_UPDATED="hlsLevelsUpdated",T.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",T.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",T.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",T.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",T.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",T.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",T.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",T.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",T.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",T.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",T.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",T.CUES_PARSED="hlsCuesParsed",T.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",T.INIT_PTS_FOUND="hlsInitPtsFound",T.FRAG_LOADING="hlsFragLoading",T.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",T.FRAG_LOADED="hlsFragLoaded",T.FRAG_DECRYPTED="hlsFragDecrypted",T.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",T.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",T.FRAG_PARSING_METADATA="hlsFragParsingMetadata",T.FRAG_PARSED="hlsFragParsed",T.FRAG_BUFFERED="hlsFragBuffered",T.FRAG_CHANGED="hlsFragChanged",T.FPS_DROP="hlsFpsDrop",T.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",T.ERROR="hlsError",T.DESTROYING="hlsDestroying",T.KEY_LOADING="hlsKeyLoading",T.KEY_LOADED="hlsKeyLoaded",T.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",T.BACK_BUFFER_REACHED="hlsBackBufferReached"})(L||(L={}))},"./src/hls.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return _});var L=O("./node_modules/url-toolkit/src/url-toolkit.js"),T=O.n(L),A=O("./src/loader/playlist-loader.ts"),M=O("./src/loader/key-loader.ts"),C=O("./src/controller/id3-track-controller.ts"),S=O("./src/controller/latency-controller.ts"),x=O("./src/controller/level-controller.ts"),v=O("./src/controller/fragment-tracker.ts"),g=O("./src/controller/stream-controller.ts"),s=O("./src/is-supported.ts"),r=O("./src/utils/logger.ts"),n=O("./src/config.ts"),u=O("./node_modules/eventemitter3/index.js"),l=O.n(u),e=O("./src/events.ts"),t=O("./src/errors.ts");function i(p,y){for(var m=0;m<y.length;m++){var f=y[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function b(p,y,m){return y&&i(p.prototype,y),m&&i(p,m),p}var _=function(){p.isSupported=function(){return Object(s.isSupported)()};function p(m){m===void 0&&(m={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new u.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var f=this.config=Object(n.mergeConfig)(p.DefaultConfig,m);this.userConfig=m,Object(r.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(n.enableStreamingMode)(f);var d=f.abrController,a=f.bufferController,o=f.capLevelController,c=f.fpsController,h=this.abrController=new d(this),E=this.bufferController=new a(this),R=this.capLevelController=new o(this),w=new c(this),P=new A.default(this),D=new M.default(this),U=new C.default(this),I=this.levelController=new x.default(this),k=new v.FragmentTracker(this),H=this.streamController=new g.default(this,k);R.setStreamController(H),w.setStreamController(H);var J=[I,H];this.networkControllers=J;var $=[P,D,h,E,R,w,U,k];this.audioTrackController=this.createController(f.audioTrackController,null,J),this.createController(f.audioStreamController,k,J),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,J),this.createController(f.subtitleStreamController,k,J),this.createController(f.timelineController,null,$),this.emeController=this.createController(f.emeController,null,$),this.cmcdController=this.createController(f.cmcdController,null,$),this.latencyController=this.createController(S.default,null,$),this.coreComponents=$}var y=p.prototype;return y.createController=function(f,d,a){if(f){var o=d?new f(this,d):new f(this);return a&&a.push(o),o}return null},y.on=function(f,d,a){a===void 0&&(a=this),this._emitter.on(f,d,a)},y.once=function(f,d,a){a===void 0&&(a=this),this._emitter.once(f,d,a)},y.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},y.off=function(f,d,a,o){a===void 0&&(a=this),this._emitter.off(f,d,a,o)},y.listeners=function(f){return this._emitter.listeners(f)},y.emit=function(f,d,a){return this._emitter.emit(f,d,a)},y.trigger=function(f,d){if(this.config.debug)return this.emit(f,f,d);try{return this.emit(f,f,d)}catch(a){r.logger.error("An internal error happened while handling event "+f+'. Error message: "'+a.message+'". Here is a stacktrace:',a),this.trigger(e.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:a})}return!1},y.listenerCount=function(f){return this._emitter.listenerCount(f)},y.destroy=function(){r.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},y.attachMedia=function(f){r.logger.log("attachMedia"),this._media=f,this.trigger(e.Events.MEDIA_ATTACHING,{media:f})},y.detachMedia=function(){r.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},y.loadSource=function(f){this.stopLoad();var d=this.media,a=this.url,o=this.url=L.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});r.logger.log("loadSource:"+o),d&&a&&a!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(e.Events.MANIFEST_LOADING,{url:f})},y.startLoad=function(f){f===void 0&&(f=-1),r.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(d){d.startLoad(f)})},y.stopLoad=function(){r.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},y.swapAudioCodec=function(){r.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},y.recoverMediaError=function(){r.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},y.removeLevel=function(f,d){d===void 0&&(d=0),this.levelController.removeLevel(f,d)},b(p,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){r.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){r.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){r.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){r.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){r.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var d=!!f;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(r.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,d=this.config.minAutoBitrate;if(!f)return 0;for(var a=f.length,o=0;o<a;o++)if(f[o].maxBitrate>d)return o;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,d=this.autoLevelCapping,a;return d===-1&&f&&f.length?a=f.length-1:a=d,a}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var d=this.audioTrackController;d&&(d.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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 e.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:n.hlsDefaultConfig},set:function(f){p.defaultConfig=f}}]),p}();_.defaultConfig=void 0},"./src/is-supported.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"isSupported",function(){return A}),O.d(N,"changeTypeSupported",function(){return M});var L=O("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function A(){var C=Object(L.getMediaSource)();if(!C)return!1;var S=T(),x=C&&typeof C.isTypeSupported=="function"&&C.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!S||S.prototype&&typeof S.prototype.appendBuffer=="function"&&typeof S.prototype.remove=="function";return!!x&&!!v}function M(){var C,S=T();return typeof(S==null||((C=S.prototype)===null||C===void 0)?void 0:C.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return r}),O.d(N,"LoadError",function(){return u});var L=O("./src/polyfills/number.ts"),T=O("./src/errors.ts");function A(l,e){l.prototype=Object.create(e.prototype),l.prototype.constructor=l,v(l,e)}function M(l){var e=typeof Map=="function"?new Map:void 0;return M=function(i){if(i===null||!x(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(i))return e.get(i);e.set(i,b)}function b(){return C(i,arguments,g(this).constructor)}return b.prototype=Object.create(i.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v(b,i)},M(l)}function C(l,e,t){return S()?C=Reflect.construct:C=function(b,_,p){var y=[null];y.push.apply(y,_);var m=Function.bind.apply(b,y),f=new m;return p&&v(f,p.prototype),f},C.apply(null,arguments)}function S(){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(l){return!1}}function x(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function v(l,e){return v=Object.setPrototypeOf||function(i,b){return i.__proto__=b,i},v(l,e)}function g(l){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(l)}var s=Math.pow(2,17),r=function(){function l(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=l.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(i,b){var _=this,p=i.url;if(!p)return Promise.reject(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var y=this.config,m=y.fLoader,f=y.loader;return new Promise(function(d,a){_.loader&&_.loader.destroy();var o=_.loader=i.loader=m?new m(y):new f(y),c=n(i),h={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:s};i.stats=o.stats,o.load(c,h,{onSuccess:function(R,w,P,D){_.resetLoader(i,o),d({frag:i,part:null,payload:R.data,networkDetails:D})},onError:function(R,w,P){_.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:R,networkDetails:P}))},onAbort:function(R,w,P){_.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:P}))},onTimeout:function(R,w,P){_.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:P}))},onProgress:function(R,w,P,D){b&&b({frag:i,part:null,payload:P,networkDetails:D})}})})},e.loadPart=function(i,b,_){var p=this;this.abort();var y=this.config,m=y.fLoader,f=y.loader;return new Promise(function(d,a){p.loader&&p.loader.destroy();var o=p.loader=i.loader=m?new m(y):new f(y),c=n(i,b),h={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:s};b.stats=o.stats,o.load(c,h,{onSuccess:function(R,w,P,D){p.resetLoader(i,o),p.updateStatsFromPart(i,b);var U={frag:i,part:b,payload:R.data,networkDetails:D};_(U),d(U)},onError:function(R,w,P){p.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:b,response:R,networkDetails:P}))},onAbort:function(R,w,P){i.stats.aborted=b.stats.aborted,p.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:b,networkDetails:P}))},onTimeout:function(R,w,P){p.resetLoader(i,o),a(new u({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:b,networkDetails:P}))}})})},e.updateStatsFromPart=function(i,b){var _=i.stats,p=b.stats,y=p.total;if(_.loaded+=p.loaded,y){var m=Math.round(i.duration/b.duration),f=Math.min(Math.round(_.loaded/y),m),d=m-f,a=d*Math.round(_.loaded/f);_.total=_.loaded+a}else _.total=Math.max(_.loaded,_.total);var o=_.loading,c=p.loading;o.start?o.first+=c.first-c.start:(o.start=c.start,o.first=c.first),o.end=c.end},e.resetLoader=function(i,b){i.loader=null,this.loader===b&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),b.destroy()},l}();function n(l,e){e===void 0&&(e=null);var t=e||l,i={frag:l,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},b=t.byteRangeStartOffset,_=t.byteRangeEndOffset;return Object(L.isFiniteNumber)(b)&&Object(L.isFiniteNumber)(_)&&(i.rangeStart=b,i.rangeEnd=_),i}var u=function(l){A(e,l);function e(t){for(var i,b=arguments.length,_=new Array(b>1?b-1:0),p=1;p<b;p++)_[p-1]=arguments[p];return i=l.call.apply(l,[this].concat(_))||this,i.data=void 0,i.data=t,i}return e}(M(Error))},"./src/loader/fragment.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"ElementaryStreamTypes",function(){return r}),O.d(N,"BaseSegment",function(){return n}),O.d(N,"Fragment",function(){return u}),O.d(N,"Part",function(){return l});var L=O("./src/polyfills/number.ts"),T=O("./node_modules/url-toolkit/src/url-toolkit.js"),A=O.n(T),M=O("./src/utils/logger.ts"),C=O("./src/loader/level-key.ts"),S=O("./src/loader/load-stats.ts");function x(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v(e,t)}function v(e,t){return v=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},v(e,t)}function g(e,t){for(var i=0;i<t.length;i++){var b=t[i];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(e,b.key,b)}}function s(e,t,i){return t&&g(e.prototype,t),i&&g(e,i),e}var r;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(r||(r={}));var n=function(){function e(i){var b;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(b={},b[r.AUDIO]=null,b[r.VIDEO]=null,b[r.AUDIOVIDEO]=null,b),this.baseurl=i}var t=e.prototype;return t.setByteRange=function(b,_){var p=b.split("@",2),y=[];p.length===1?y[0]=_?_.byteRangeEndOffset:0:y[0]=parseInt(p[1]),y[1]=parseInt(p[0])+y[0],this._byteRange=y},s(e,[{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(T.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(b){this._url=b}}]),e}(),u=function(e){x(t,e);function t(b,_){var p;return p=e.call(this,_)||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 S.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=b,p}var i=t.prototype;return i.createInitializationVector=function(_){for(var p=new Uint8Array(16),y=12;y<16;y++)p[y]=_>>8*(15-y)&255;return p},i.setDecryptDataFromLevelKey=function(_,p){var y=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(y=C.LevelKey.fromURI(_.uri),y.method=_.method,y.iv=this.createInitializationVector(p),y.keyFormat="identity"),y},i.setElementaryStreamInfo=function(_,p,y,m,f,d){d===void 0&&(d=!1);var a=this.elementaryStreams,o=a[_];if(!o){a[_]={startPTS:p,endPTS:y,startDTS:m,endDTS:f,partial:d};return}o.startPTS=Math.min(o.startPTS,p),o.endPTS=Math.max(o.endPTS,y),o.startDTS=Math.min(o.startDTS,m),o.endDTS=Math.max(o.endDTS,f)},i.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[r.AUDIO]=null,_[r.VIDEO]=null,_[r.AUDIOVIDEO]=null},s(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&M.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(L.isFiniteNumber)(this.programDateTime))return null;var _=Object(L.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),t}(n),l=function(e){x(t,e);function t(i,b,_,p,y){var m;m=e.call(this,_)||this,m.fragOffset=0,m.duration=0,m.gap=!1,m.independent=!1,m.relurl=void 0,m.fragment=void 0,m.index=void 0,m.stats=new S.LoadStats,m.duration=i.decimalFloatingPoint("DURATION"),m.gap=i.bool("GAP"),m.independent=i.bool("INDEPENDENT"),m.relurl=i.enumeratedString("URI"),m.fragment=b,m.index=p;var f=i.enumeratedString("BYTERANGE");return f&&m.setByteRange(f,y),y&&(m.fragOffset=y.fragOffset+y.duration),m}return s(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var b=this.elementaryStreams;return!!(b.audio||b.video||b.audiovideo)}}]),t}(n)},"./src/loader/key-loader.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return M});var L=O("./src/events.ts"),T=O("./src/errors.ts"),A=O("./src/utils/logger.ts"),M=function(){function C(x){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=x,this._registerListeners()}var S=C.prototype;return S._registerListeners=function(){this.hls.on(L.Events.KEY_LOADING,this.onKeyLoading,this)},S._unregisterListeners=function(){this.hls.off(L.Events.KEY_LOADING,this.onKeyLoading)},S.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var g=this.loaders[v];g&&g.destroy()}this.loaders={}},S.onKeyLoading=function(v,g){var s=g.frag,r=s.type,n=this.loaders[r];if(!s.decryptdata){A.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var u=s.decryptdata.uri;if(u!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(n&&(A.logger.warn("abort previous key loader for type:"+r),n.abort()),!u){A.logger.warn("key uri is falsy");return}var e=l.loader,t=s.loader=this.loaders[r]=new e(l);this.decrypturl=u,this.decryptkey=null;var i={url:u,frag:s,responseType:"arraybuffer"},b={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(i,b,_)}else this.decryptkey&&(s.decryptdata.key=this.decryptkey,this.hls.trigger(L.Events.KEY_LOADED,{frag:s}))},S.loadsuccess=function(v,g,s){var r=s.frag;if(!r.decryptdata){A.logger.error("after key load, decryptdata unset");return}this.decryptkey=r.decryptdata.key=new Uint8Array(v.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(L.Events.KEY_LOADED,{frag:r})},S.loaderror=function(v,g){var s=g.frag,r=s.loader;r&&r.abort(),delete this.loaders[s.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:s,response:v})},S.loadtimeout=function(v,g){var s=g.frag,r=s.loader;r&&r.abort(),delete this.loaders[s.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:s})},C}()},"./src/loader/level-details.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"LevelDetails",function(){return C});var L=O("./src/polyfills/number.ts");function T(S,x){for(var v=0;v<x.length;v++){var g=x[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function A(S,x,v){return x&&T(S.prototype,x),v&&T(S,v),S}var M=10,C=function(){function S(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var x=S.prototype;return x.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var s=this.lastPartSn-g.lastPartSn,r=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!r||!!s,this.advanced=this.endSN>g.endSN||s>0||s===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},A(S,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(L.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||M}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var s=this.driftEnd-this.driftStart;return s*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),S}()},"./src/loader/level-key.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"LevelKey",function(){return C});var L=O("./node_modules/url-toolkit/src/url-toolkit.js"),T=O.n(L);function A(S,x){for(var v=0;v<x.length;v++){var g=x[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function M(S,x,v){return x&&A(S.prototype,x),v&&A(S,v),S}var C=function(){S.fromURL=function(v,g){return new S(v,g)},S.fromURI=function(v){return new S(v)};function S(x,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(L.buildAbsoluteURL)(x,v,{alwaysNormalize:!0}):this._uri=x}return M(S,[{key:"uri",get:function(){return this._uri}}]),S}()},"./src/loader/load-stats.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"LoadStats",function(){return L});var L=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(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return t});var L=O("./src/polyfills/number.ts"),T=O("./node_modules/url-toolkit/src/url-toolkit.js"),A=O.n(T),M=O("./src/loader/fragment.ts"),C=O("./src/loader/level-details.ts"),S=O("./src/loader/level-key.ts"),x=O("./src/utils/attr-list.ts"),v=O("./src/utils/logger.ts"),g=O("./src/utils/codecs.ts"),s=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,r=/#EXT-X-MEDIA:(.*)/g,n=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),u=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function e(y){var m,f;return l.test((m=(f=T.parseURL(y))===null||f===void 0?void 0:f.path)!=null?m:"")}var t=function(){function y(){}return y.findGroup=function(f,d){for(var a=0;a<f.length;a++){var o=f[a];if(o.id===d)return o}},y.convertAVC1ToAVCOTI=function(f){var d=f.split(".");if(d.length>2){var a=d.shift()+".";return a+=parseInt(d.shift()).toString(16),a+=("000"+parseInt(d.shift()).toString(16)).substr(-4),a}return f},y.resolve=function(f,d){return T.buildAbsoluteURL(d,f,{alwaysNormalize:!0})},y.parseMasterPlaylist=function(f,d){var a=[],o={},c=!1;s.lastIndex=0;for(var h;(h=s.exec(f))!=null;)if(h[1]){var E=new x.AttrList(h[1]),R={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:y.resolve(h[2],d)},w=E.decimalResolution("RESOLUTION");w&&(R.width=w.width,R.height=w.height),i((E.CODECS||"").split(/[ ,]+/).filter(function(D){return D}),R),R.videoCodec&&R.videoCodec.indexOf("avc1")!==-1&&(R.videoCodec=y.convertAVC1ToAVCOTI(R.videoCodec)),a.push(R)}else if(h[3]){var P=new x.AttrList(h[3]);P["DATA-ID"]&&(c=!0,o[P["DATA-ID"]]=P)}return{levels:a,sessionData:c?o:null}},y.parseMasterPlaylistMedia=function(f,d,a,o){o===void 0&&(o=[]);var c,h=[],E=0;for(r.lastIndex=0;(c=r.exec(f))!==null;){var R=new x.AttrList(c[1]);if(R.TYPE===a){var w={attrs:R,bitrate:0,id:E++,groupId:R["GROUP-ID"],instreamId:R["INSTREAM-ID"],name:R.NAME||R.LANGUAGE||"",type:a,default:R.bool("DEFAULT"),autoselect:R.bool("AUTOSELECT"),forced:R.bool("FORCED"),lang:R.LANGUAGE,url:R.URI?y.resolve(R.URI,d):""};if(o.length){var P=y.findGroup(o,w.groupId)||o[0];b(w,P,"audioCodec"),b(w,P,"textCodec")}h.push(w)}}return h},y.parseLevelPlaylist=function(f,d,a,o,c){var h=new C.LevelDetails(d),E=h.fragments,R=null,w=0,P=0,D=0,U=0,I=null,k=new M.Fragment(o,d),H,J,$,fe=-1,he=!1;for(n.lastIndex=0,h.m3u8=f;(H=n.exec(f))!==null;){he&&(he=!1,k=new M.Fragment(o,d),k.start=D,k.sn=w,k.cc=U,k.level=a,R&&(k.initSegment=R,k.rawProgramDateTime=R.rawProgramDateTime));var ce=H[1];if(ce){k.duration=parseFloat(ce);var pe=(" "+H[2]).slice(1);k.title=pe||null,k.tagList.push(pe?["INF",ce,pe]:["INF",ce])}else if(H[3])Object(L.isFiniteNumber)(k.duration)&&(k.start=D,$&&(k.levelkey=$),k.sn=w,k.level=a,k.cc=U,k.urlId=c,E.push(k),k.relurl=(" "+H[3]).slice(1),p(k,I),I=k,D+=k.duration,w++,P=0,he=!0);else if(H[4]){var _e=(" "+H[4]).slice(1);I?k.setByteRange(_e,I):k.setByteRange(_e)}else if(H[5])k.rawProgramDateTime=(" "+H[5]).slice(1),k.tagList.push(["PROGRAM-DATE-TIME",k.rawProgramDateTime]),fe===-1&&(fe=E.length);else{if(H=H[0].match(u),!H){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(J=1;J<H.length&&!(typeof H[J]!="undefined");J++);var oe=(" "+H[J]).slice(1),ne=(" "+H[J+1]).slice(1),Ee=H[J+2]?(" "+H[J+2]).slice(1):"";switch(oe){case"PLAYLIST-TYPE":h.type=ne.toUpperCase();break;case"MEDIA-SEQUENCE":w=h.startSN=parseInt(ne);break;case"SKIP":{var ke=new x.AttrList(ne),we=ke.decimalInteger("SKIPPED-SEGMENTS");if(Object(L.isFiniteNumber)(we)){h.skippedSegments=we;for(var Re=we;Re--;)E.unshift(null);w+=we}var Ue=ke.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ue&&(h.recentlyRemovedDateranges=Ue.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(ne);break;case"VERSION":h.version=parseInt(ne);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(ne||Ee)&&k.tagList.push(Ee?[ne,Ee]:[ne]);break;case"DIS":U++;case"GAP":k.tagList.push([oe]);break;case"BITRATE":k.tagList.push([oe,ne]);break;case"DISCONTINUITY-SEQ":U=parseInt(ne);break;case"KEY":{var be,Se=new x.AttrList(ne),Ie=Se.enumeratedString("METHOD"),Me=Se.URI,De=Se.hexadecimalInteger("IV"),Te=Se.enumeratedString("KEYFORMATVERSIONS"),ye=Se.enumeratedString("KEYID"),Ge=(be=Se.enumeratedString("KEYFORMAT"))!=null?be:"identity",Be=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Be.indexOf(Ge)>-1){v.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;Ie&&($=S.LevelKey.fromURL(d,Me),Me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&($.method=Ie,$.keyFormat=Ge,ye&&($.keyID=ye),Te&&($.keyFormatVersions=Te),$.iv=De));break}case"START":{var He=new x.AttrList(ne),Ne=He.decimalFloatingPoint("TIME-OFFSET");Object(L.isFiniteNumber)(Ne)&&(h.startTimeOffset=Ne);break}case"MAP":{var Ve=new x.AttrList(ne);k.relurl=Ve.URI,Ve.BYTERANGE&&k.setByteRange(Ve.BYTERANGE),k.level=a,k.sn="initSegment",$&&(k.levelkey=$),k.initSegment=null,R=k,he=!0;break}case"SERVER-CONTROL":{var ze=new x.AttrList(ne);h.canBlockReload=ze.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=ze.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&ze.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=ze.optionalFloat("PART-HOLD-BACK",0),h.holdBack=ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Fe=new x.AttrList(ne);h.partTarget=Fe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=h.partList;Ce||(Ce=h.partList=[]);var We=P>0?Ce[Ce.length-1]:void 0,je=P++,me=new M.Part(new x.AttrList(ne),k,d,je,We);Ce.push(me),k.duration+=me.duration;break}case"PRELOAD-HINT":{var Le=new x.AttrList(ne);h.preloadHint=Le;break}case"RENDITION-REPORT":{var re=new x.AttrList(ne);h.renditionReports=h.renditionReports||[],h.renditionReports.push(re);break}default:v.logger.warn("line parsed but not handled: "+H);break}}}I&&!I.relurl?(E.pop(),D-=I.duration,h.partList&&(h.fragmentHint=I)):h.partList&&(p(k,I),k.cc=U,h.fragmentHint=k);var q=E.length,Z=E[0],B=E[q-1];if(D+=h.skippedSegments*h.targetduration,D>0&&q&&B){h.averagetargetduration=D/q;var W=B.sn;h.endSN=W!=="initSegment"?W:0,Z&&(h.startCC=Z.cc,Z.initSegment||h.fragments.every(function(z){return z.relurl&&e(z.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),k=new M.Fragment(o,d),k.relurl=B.relurl,k.level=a,k.sn="initSegment",Z.initSegment=k,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(D+=h.fragmentHint.duration),h.totalduration=D,h.endCC=U,fe>0&&_(E,fe),h},y}();function i(y,m){["video","audio","text"].forEach(function(f){var d=y.filter(function(o){return Object(g.isCodecType)(o,f)});if(d.length){var a=d.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});m[f+"Codec"]=a.length>0?a[0]:d[0],y=y.filter(function(o){return d.indexOf(o)===-1})}}),m.unknownCodecs=y}function b(y,m,f){var d=m[f];d&&(y[f]=d)}function _(y,m){for(var f=y[m],d=m;d--;){var a=y[d];if(!a)return;a.programDateTime=f.programDateTime-a.duration*1e3,f=a}}function p(y,m){y.rawProgramDateTime?y.programDateTime=Date.parse(y.rawProgramDateTime):m!=null&&m.programDateTime&&(y.programDateTime=m.endProgramDateTime),Object(L.isFiniteNumber)(y.programDateTime)||(y.programDateTime=null,y.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/polyfills/number.ts"),T=O("./src/events.ts"),A=O("./src/errors.ts"),M=O("./src/utils/logger.ts"),C=O("./src/utils/mp4-tools.ts"),S=O("./src/loader/m3u8-parser.ts"),x=O("./src/types/loader.ts"),v=O("./src/utils/attr-list.ts");function g(n){var u=n.type;switch(u){case x.PlaylistContextType.AUDIO_TRACK:return x.PlaylistLevelType.AUDIO;case x.PlaylistContextType.SUBTITLE_TRACK:return x.PlaylistLevelType.SUBTITLE;default:return x.PlaylistLevelType.MAIN}}function s(n,u){var l=n.url;return(l===void 0||l.indexOf("data:")===0)&&(l=u.url),l}var r=function(){function n(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var u=n.prototype;return u.registerListeners=function(){var e=this.hls;e.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.unregisterListeners=function(){var e=this.hls;e.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.createInternalLoader=function(e){var t=this.hls.config,i=t.pLoader,b=t.loader,_=i||b,p=new _(t);return e.loader=p,this.loaders[e.type]=p,p},u.getInternalLoader=function(e){return this.loaders[e.type]},u.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},u.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},u.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},u.onManifestLoading=function(e,t){var i=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:x.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},u.onLevelLoading=function(e,t){var i=t.id,b=t.level,_=t.url,p=t.deliveryDirectives;this.load({id:i,groupId:null,level:b,responseType:"text",type:x.PlaylistContextType.LEVEL,url:_,deliveryDirectives:p})},u.onAudioTrackLoading=function(e,t){var i=t.id,b=t.groupId,_=t.url,p=t.deliveryDirectives;this.load({id:i,groupId:b,level:null,responseType:"text",type:x.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:p})},u.onSubtitleTrackLoading=function(e,t){var i=t.id,b=t.groupId,_=t.url,p=t.deliveryDirectives;this.load({id:i,groupId:b,level:null,responseType:"text",type:x.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:p})},u.load=function(e){var t,i=this.hls.config,b=this.getInternalLoader(e);if(b){var _=b.context;if(_&&_.url===e.url){M.logger.trace("[playlist-loader]: playlist request ongoing");return}M.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),b.abort()}var p,y,m,f;switch(e.type){case x.PlaylistContextType.MANIFEST:p=i.manifestLoadingMaxRetry,y=i.manifestLoadingTimeOut,m=i.manifestLoadingRetryDelay,f=i.manifestLoadingMaxRetryTimeout;break;case x.PlaylistContextType.LEVEL:case x.PlaylistContextType.AUDIO_TRACK:case x.PlaylistContextType.SUBTITLE_TRACK:p=0,y=i.levelLoadingTimeOut;break;default:p=i.levelLoadingMaxRetry,y=i.levelLoadingTimeOut,m=i.levelLoadingRetryDelay,f=i.levelLoadingMaxRetryTimeout;break}if(b=this.createInternalLoader(e),(t=e.deliveryDirectives)!==null&&t!==void 0&&t.part){var d;if(e.type===x.PlaylistContextType.LEVEL&&e.level!==null?d=this.hls.levels[e.level].details:e.type===x.PlaylistContextType.AUDIO_TRACK&&e.id!==null?d=this.hls.audioTracks[e.id].details:e.type===x.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(d=this.hls.subtitleTracks[e.id].details),d){var a=d.partTarget,o=d.targetduration;a&&o&&(y=Math.min(Math.max(a*3,o*.8)*1e3,y))}}var c={timeout:y,maxRetry:p,retryDelay:m,maxRetryDelay:f,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};b.load(e,c,h)},u.loadsuccess=function(e,t,i,b){if(b===void 0&&(b=null),i.isSidxRequest){this.handleSidxRequest(e,i),this.handlePlaylistLoaded(e,t,i,b);return}this.resetInternalLoader(i.type);var _=e.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,i,"no EXTM3U delimiter",b);return}t.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,i,b):this.handleMasterPlaylist(e,t,i,b)},u.loaderror=function(e,t,i){i===void 0&&(i=null),this.handleNetworkError(t,i,!1,e)},u.loadtimeout=function(e,t,i){i===void 0&&(i=null),this.handleNetworkError(t,i,!0)},u.handleMasterPlaylist=function(e,t,i,b){var _=this.hls,p=e.data,y=s(e,i),m=S.default.parseMasterPlaylist(p,y),f=m.levels,d=m.sessionData;if(!f.length){this.handleManifestParsingError(e,i,"no level found in manifest",b);return}var a=f.map(function(w){return{id:w.attrs.AUDIO,audioCodec:w.audioCodec}}),o=f.map(function(w){return{id:w.attrs.SUBTITLES,textCodec:w.textCodec}}),c=S.default.parseMasterPlaylistMedia(p,y,"AUDIO",a),h=S.default.parseMasterPlaylistMedia(p,y,"SUBTITLES",o),E=S.default.parseMasterPlaylistMedia(p,y,"CLOSED-CAPTIONS");if(c.length){var R=c.some(function(w){return!w.url});!R&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(M.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),c.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}_.trigger(T.Events.MANIFEST_LOADED,{levels:f,audioTracks:c,subtitles:h,captions:E,url:y,stats:t,networkDetails:b,sessionData:d})},u.handleTrackOrLevelPlaylist=function(e,t,i,b){var _=this.hls,p=i.id,y=i.level,m=i.type,f=s(e,i),d=Object(L.isFiniteNumber)(p)?p:0,a=Object(L.isFiniteNumber)(y)?y:d,o=g(i),c=S.default.parseLevelPlaylist(e.data,f,a,o,d);if(!c.fragments.length){_.trigger(T.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(m===x.PlaylistContextType.MANIFEST){var h={attrs:new v.AttrList({}),bitrate:0,details:c,name:"",url:f};_.trigger(T.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:f,stats:t,networkDetails:b,sessionData:null})}if(t.parsing.end=performance.now(),c.needSidxRanges){var E,R=(E=c.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:R,isSidxRequest:!0,type:m,level:y,levelDetails:c,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=c,this.handlePlaylistLoaded(e,t,i,b)},u.handleSidxRequest=function(e,t){var i=Object(C.parseSegmentIndex)(new Uint8Array(e.data));if(!i)return;var b=i.references,_=t.levelDetails;b.forEach(function(p,y){var m=p.info,f=_.fragments[y];f.byteRange.length===0&&f.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),f.initSegment&&f.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},u.handleManifestParsingError=function(e,t,i,b){this.hls.trigger(T.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===x.PlaylistContextType.MANIFEST,url:e.url,reason:i,response:e,context:t,networkDetails:b})},u.handleNetworkError=function(e,t,i,b){i===void 0&&(i=!1),M.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var _=A.ErrorDetails.UNKNOWN,p=!1,y=this.getInternalLoader(e);switch(e.type){case x.PlaylistContextType.MANIFEST:_=i?A.ErrorDetails.MANIFEST_LOAD_TIMEOUT:A.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case x.PlaylistContextType.LEVEL:_=i?A.ErrorDetails.LEVEL_LOAD_TIMEOUT:A.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case x.PlaylistContextType.AUDIO_TRACK:_=i?A.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:A.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case x.PlaylistContextType.SUBTITLE_TRACK:_=i?A.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:A.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}y&&this.resetInternalLoader(e.type);var m={type:A.ErrorTypes.NETWORK_ERROR,details:_,fatal:p,url:e.url,loader:y,context:e,networkDetails:t};b&&(m.response=b),this.hls.trigger(T.Events.ERROR,m)},u.handlePlaylistLoaded=function(e,t,i,b){var _=i.type,p=i.level,y=i.id,m=i.groupId,f=i.loader,d=i.levelDetails,a=i.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(e,i,"invalid target duration",b);return}if(!f)return;d.live&&(f.getCacheAge&&(d.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(_){case x.PlaylistContextType.MANIFEST:case x.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:d,level:p||0,id:y||0,stats:t,networkDetails:b,deliveryDirectives:a});break;case x.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:d,id:y||0,groupId:m||"",stats:t,networkDetails:b,deliveryDirectives:a});break;case x.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:d,id:y||0,groupId:m||"",stats:t,networkDetails:b,deliveryDirectives:a});break}},n}();N.default=r},"./src/polyfills/number.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"isFiniteNumber",function(){return L}),O.d(N,"MAX_SAFE_INTEGER",function(){return T});var L=Number.isFinite||function(A){return typeof A=="number"&&isFinite(A)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(le,N,O){"use strict";O.r(N);var L=function(){function T(){}return T.getSilentFrame=function(M,C){switch(M){case"mp4a.40.2":if(C===1)return new Uint8Array([0,200,0,128,35,128]);if(C===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(C===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(C===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(C===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(C===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(C===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(C===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(C===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},T}();N.default=L},"./src/remux/mp4-generator.ts":function(le,N,O){"use strict";O.r(N);var L=Math.pow(2,32)-1,T=function(){function A(){}return A.init=function(){A.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 C;for(C in A.types)A.types.hasOwnProperty(C)&&(A.types[C]=[C.charCodeAt(0),C.charCodeAt(1),C.charCodeAt(2),C.charCodeAt(3)]);var S=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]),x=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]);A.HDLR_TYPES={video:S,audio:x};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);A.STTS=A.STSC=A.STCO=g,A.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),A.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),A.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),A.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),r=new Uint8Array([97,118,99,49]),n=new Uint8Array([0,0,0,1]);A.FTYP=A.box(A.types.ftyp,s,n,s,r),A.DINF=A.box(A.types.dinf,A.box(A.types.dref,v))},A.box=function(C){for(var S=8,x=arguments.length,v=new Array(x>1?x-1:0),g=1;g<x;g++)v[g-1]=arguments[g];for(var s=v.length,r=s;s--;)S+=v[s].byteLength;var n=new Uint8Array(S);for(n[0]=S>>24&255,n[1]=S>>16&255,n[2]=S>>8&255,n[3]=S&255,n.set(C,4),s=0,S=8;s<r;s++)n.set(v[s],S),S+=v[s].byteLength;return n},A.hdlr=function(C){return A.box(A.types.hdlr,A.HDLR_TYPES[C])},A.mdat=function(C){return A.box(A.types.mdat,C)},A.mdhd=function(C,S){S*=C;var x=Math.floor(S/(L+1)),v=Math.floor(S%(L+1));return A.box(A.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,x>>24,x>>16&255,x>>8&255,x&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},A.mdia=function(C){return A.box(A.types.mdia,A.mdhd(C.timescale,C.duration),A.hdlr(C.type),A.minf(C))},A.mfhd=function(C){return A.box(A.types.mfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255]))},A.minf=function(C){return C.type==="audio"?A.box(A.types.minf,A.box(A.types.smhd,A.SMHD),A.DINF,A.stbl(C)):A.box(A.types.minf,A.box(A.types.vmhd,A.VMHD),A.DINF,A.stbl(C))},A.moof=function(C,S,x){return A.box(A.types.moof,A.mfhd(C),A.traf(x,S))},A.moov=function(C){for(var S=C.length,x=[];S--;)x[S]=A.trak(C[S]);return A.box.apply(null,[A.types.moov,A.mvhd(C[0].timescale,C[0].duration)].concat(x).concat(A.mvex(C)))},A.mvex=function(C){for(var S=C.length,x=[];S--;)x[S]=A.trex(C[S]);return A.box.apply(null,[A.types.mvex].concat(x))},A.mvhd=function(C,S){S*=C;var x=Math.floor(S/(L+1)),v=Math.floor(S%(L+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,x>>24,x>>16&255,x>>8&255,x&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return A.box(A.types.mvhd,g)},A.sdtp=function(C){var S=C.samples||[],x=new Uint8Array(4+S.length),v,g;for(v=0;v<S.length;v++)g=S[v].flags,x[v+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return A.box(A.types.sdtp,x)},A.stbl=function(C){return A.box(A.types.stbl,A.stsd(C),A.box(A.types.stts,A.STTS),A.box(A.types.stsc,A.STSC),A.box(A.types.stsz,A.STSZ),A.box(A.types.stco,A.STCO))},A.avc1=function(C){var S=[],x=[],v,g,s;for(v=0;v<C.sps.length;v++)g=C.sps[v],s=g.byteLength,S.push(s>>>8&255),S.push(s&255),S=S.concat(Array.prototype.slice.call(g));for(v=0;v<C.pps.length;v++)g=C.pps[v],s=g.byteLength,x.push(s>>>8&255),x.push(s&255),x=x.concat(Array.prototype.slice.call(g));var r=A.box(A.types.avcC,new Uint8Array([1,S[3],S[4],S[5],252|3,224|C.sps.length].concat(S).concat([C.pps.length]).concat(x))),n=C.width,u=C.height,l=C.pixelRatio[0],e=C.pixelRatio[1];return A.box(A.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,n>>8&255,n&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,A.box(A.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),A.box(A.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,e>>24,e>>16&255,e>>8&255,e&255])))},A.esds=function(C){var S=C.config.length;return new Uint8Array([0,0,0,0,3,23+S,0,1,0,4,15+S,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([S]).concat(C.config).concat([6,1,2]))},A.mp4a=function(C){var S=C.samplerate;return A.box(A.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,S>>8&255,S&255,0,0]),A.box(A.types.esds,A.esds(C)))},A.mp3=function(C){var S=C.samplerate;return A.box(A.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,S>>8&255,S&255,0,0]))},A.stsd=function(C){return C.type==="audio"?!C.isAAC&&C.codec==="mp3"?A.box(A.types.stsd,A.STSD,A.mp3(C)):A.box(A.types.stsd,A.STSD,A.mp4a(C)):A.box(A.types.stsd,A.STSD,A.avc1(C))},A.tkhd=function(C){var S=C.id,x=C.duration*C.timescale,v=C.width,g=C.height,s=Math.floor(x/(L+1)),r=Math.floor(x%(L+1));return A.box(A.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,S>>24&255,S>>16&255,S>>8&255,S&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,g>>8&255,g&255,0,0]))},A.traf=function(C,S){var x=A.sdtp(C),v=C.id,g=Math.floor(S/(L+1)),s=Math.floor(S%(L+1));return A.box(A.types.traf,A.box(A.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),A.box(A.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,s>>24,s>>16&255,s>>8&255,s&255])),A.trun(C,x.length+16+20+8+16+8+8),x)},A.trak=function(C){return C.duration=C.duration||4294967295,A.box(A.types.trak,A.tkhd(C),A.mdia(C))},A.trex=function(C){var S=C.id;return A.box(A.types.trex,new Uint8Array([0,0,0,0,S>>24,S>>16&255,S>>8&255,S&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},A.trun=function(C,S){var x=C.samples||[],v=x.length,g=12+16*v,s=new Uint8Array(g),r,n,u,l,e,t;for(S+=8+g,s.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255],0),r=0;r<v;r++)n=x[r],u=n.duration,l=n.size,e=n.flags,t=n.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*r);return A.box(A.types.trun,s)},A.initSegment=function(C){A.types||A.init();var S=A.moov(C),x=new Uint8Array(A.FTYP.byteLength+S.byteLength);return x.set(A.FTYP),x.set(S,A.FTYP.byteLength),x},A}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0,N.default=T},"./src/remux/mp4-remuxer.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return t}),O.d(N,"normalizePts",function(){return i});var L=O("./src/polyfills/number.ts"),T=O("./src/remux/aac-helper.ts"),A=O("./src/remux/mp4-generator.ts"),M=O("./src/events.ts"),C=O("./src/errors.ts"),S=O("./src/utils/logger.ts"),x=O("./src/types/loader.ts"),v=O("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(y){for(var m=1;m<arguments.length;m++){var f=arguments[m];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(y[d]=f[d])}return y},g.apply(this,arguments)}var s=10*1e3,r=1024,n=1152,u=null,l=null,e=!1,t=function(){function y(f,d,a,o){if(o===void 0&&(o=""),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=f,this.config=d,this.typeSupported=a,this.ISGenerated=!1,u===null){var c=navigator.userAgent||"",h=c.match(/Chrome\/(\d+)/i);u=h?parseInt(h[1]):0}if(l===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);l=E?parseInt(E[1]):0}e=!!u&&u<75||!!l&&l<600}var m=y.prototype;return m.destroy=function(){},m.resetTimeStamp=function(d){S.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=d},m.resetNextTimestamp=function(){S.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},m.resetInitSegment=function(){S.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},m.getVideoStartPts=function(d){var a=!1,o=d.reduce(function(c,h){var E=h.pts-c;return E<-4294967296?(a=!0,i(c,h.pts)):E>0?c:h.pts},d[0].pts);return a&&S.logger.debug("PTS rollover detected"),o},m.remux=function(d,a,o,c,h,E,R,w){var P,D,U,I,k,H,J=h,$=h,fe=d.pid>-1,he=a.pid>-1,ce=a.samples.length,pe=d.samples.length>0,_e=ce>1,oe=(!fe||pe)&&(!he||_e)||this.ISGenerated||R;if(oe){this.ISGenerated||(U=this.generateIS(d,a,h));var ne=this.isVideoContiguous,Ee=-1;if(_e&&(Ee=b(a.samples),!ne&&this.config.forceKeyFrameOnDiscontinuity))if(H=!0,Ee>0){S.logger.warn("[mp4-remuxer]: Dropped "+Ee+" out of "+ce+" video samples due to a missing keyframe");var ke=this.getVideoStartPts(a.samples);a.samples=a.samples.slice(Ee),a.dropped+=Ee,$+=(a.samples[0].pts-ke)/(a.timescale||9e4)}else Ee===-1&&(S.logger.warn("[mp4-remuxer]: No keyframe found out of "+ce+" video samples"),H=!1);if(this.ISGenerated){if(pe&&_e){var we=this.getVideoStartPts(a.samples),Re=i(d.samples[0].pts,we)-we,Ue=Re/a.inputTimeScale;J+=Math.max(0,Ue),$+=Math.max(0,-Ue)}if(pe){if(d.samplerate||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(d,a,h)),D=this.remuxAudio(d,J,this.isAudioContiguous,E,he||_e||w===x.PlaylistLevelType.AUDIO?$:void 0),_e){var be=D?D.endPTS-D.startPTS:0;a.inputTimeScale||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(d,a,h)),P=this.remuxVideo(a,$,ne,be)}}else _e&&(P=this.remuxVideo(a,$,ne,0));P&&(P.firstKeyFrame=Ee,P.independent=Ee!==-1)}}return this.ISGenerated&&(o.samples.length&&(k=this.remuxID3(o,h)),c.samples.length&&(I=this.remuxText(c,h))),{audio:D,video:P,initSegment:U,independent:H,text:I,id3:k}},m.generateIS=function(d,a,o){var c=d.samples,h=a.samples,E=this.typeSupported,R={},w=!Object(L.isFiniteNumber)(this._initPTS),P="audio/mp4",D,U,I;if(w&&(D=U=Infinity),d.config&&c.length&&(d.timescale=d.samplerate,d.isAAC||(E.mpeg?(P="audio/mpeg",d.codec=""):E.mp3&&(d.codec="mp3")),R.audio={id:"audio",container:P,codec:d.codec,initSegment:!d.isAAC&&E.mpeg?new Uint8Array(0):A.default.initSegment([d]),metadata:{channelCount:d.channelCount}},w&&(I=d.inputTimeScale,D=U=c[0].pts-Math.round(I*o))),a.sps&&a.pps&&h.length&&(a.timescale=a.inputTimeScale,R.video={id:"main",container:"video/mp4",codec:a.codec,initSegment:A.default.initSegment([a]),metadata:{width:a.width,height:a.height}},w)){I=a.inputTimeScale;var k=this.getVideoStartPts(h),H=Math.round(I*o);U=Math.min(U,i(h[0].dts,k)-H),D=Math.min(D,k-H)}if(Object.keys(R).length)return this.ISGenerated=!0,w&&(this._initPTS=D,this._initDTS=U),{tracks:R,initPTS:D,timescale:I}},m.remuxVideo=function(d,a,o,c){var h=d.inputTimeScale,E=d.samples,R=[],w=E.length,P=this._initPTS,D=this.nextAvcDts,U=8,I,k,H,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,fe=0,he=!1;if(!o||D===null){var ce=a*h,pe=E[0].pts-i(E[0].dts,E[0].pts);D=ce-pe}for(var _e=0;_e<w;_e++){var oe=E[_e];if(oe.pts=i(oe.pts-P,D),oe.dts=i(oe.dts-P,D),oe.dts>oe.pts){var ne=9e4*.2;fe=Math.max(Math.min(fe,oe.pts-oe.dts),-1*ne)}oe.dts<E[_e>0?_e-1:_e].dts&&(he=!0)}he&&E.sort(function(St,ht){var $e=St.dts-ht.dts,Dt=St.pts-ht.pts;return $e||Dt}),k=E[0].dts,H=E[E.length-1].dts;var Ee=Math.round((H-k)/(w-1));if(fe<0){if(fe<Ee*-2){S.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-Ee,!0)+" ms");for(var ke=fe,we=0;we<w;we++)E[we].dts=ke=Math.max(ke,E[we].pts-Ee),E[we].pts=Math.max(ke,E[we].pts)}else{S.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Re=0;Re<w;Re++)E[Re].dts=E[Re].dts+fe}k=E[0].dts}if(o){var Ue=k-D,be=Ue>Ee,Se=Ue<-1;if(be||Se){be?S.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ue,!0)+" ms ("+Ue+"dts) hole between fragments detected, filling it"):S.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ue,!0)+" ms ("+Ue+"dts) overlapping between fragments detected"),k=D;var Ie=E[0].pts-Ue;E[0].dts=k,E[0].pts=Ie,S.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(v.toMsFromMpegTsClock)(k,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ue,!0)+" ms")}}e&&(k=Math.max(0,k));for(var Me=0,De=0,Te=0;Te<w;Te++){for(var ye=E[Te],Ge=ye.units,Be=Ge.length,He=0,Ne=0;Ne<Be;Ne++)He+=Ge[Ne].data.length;De+=He,Me+=Be,ye.length=He,ye.dts=Math.max(ye.dts,k),ye.pts=Math.max(ye.pts,ye.dts,0),J=Math.min(ye.pts,J),$=Math.max(ye.pts,$)}H=E[w-1].dts;var Ve=De+4*Me+8,ze;try{ze=new Uint8Array(Ve)}catch(St){this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ve,reason:"fail allocating video mdat "+Ve});return}var Fe=new DataView(ze.buffer);Fe.setUint32(0,Ve),ze.set(A.default.types.mdat,4);for(var Ce=0;Ce<w;Ce++){for(var We=E[Ce],je=We.units,me=0,Le=0,re=je.length;Le<re;Le++){var q=je[Le],Z=q.data,B=q.data.byteLength;Fe.setUint32(U,B),U+=4,ze.set(Z,U),U+=B,me+=4+B}if(Ce<w-1)I=E[Ce+1].dts-We.dts;else{var W=this.config,z=We.dts-E[Ce>0?Ce-1:Ce].dts;if(W.stretchShortVideoTrack&&this.nextAudioPts!==null){var Q=Math.floor(W.maxBufferHole*h),de=(c?J+c*h:this.nextAudioPts)-We.pts;de>Q?(I=de-z,I<0&&(I=z),S.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=z}else I=z}var ve=Math.round(We.pts-We.dts);R.push(new _(We.key,I,me,ve))}if(R.length&&u&&u<70){var Ae=R[0].flags;Ae.dependsOn=2,Ae.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=D=H+I,this.isVideoContiguous=!0;var Ye=A.default.moof(d.sequenceNumber++,k,g({},d,{samples:R})),qe="video",Qe={data1:Ye,data2:ze,startPTS:J/h,endPTS:($+I)/h,startDTS:k/h,endDTS:D/h,type:qe,hasAudio:!1,hasVideo:!0,nb:R.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(ze.length,"MDAT length must not be zero"),Qe},m.remuxAudio=function(d,a,o,c,h){var E=d.inputTimeScale,R=d.samplerate?d.samplerate:E,w=E/R,P=d.isAAC?r:n,D=P*w,U=this._initPTS,I=!d.isAAC&&this.typeSupported.mpeg,k=[],H=d.samples,J=I?0:8,$=this.nextAudioPts||-1,fe=a*E;if(this.isAudioContiguous=o=o||H.length&&$>0&&(c&&Math.abs(fe-$)<9e3||Math.abs(i(H[0].pts-U,fe)-$)<20*D),H.forEach(function(Z){Z.pts=i(Z.pts-U,fe)}),!o||$<0){if(H=H.filter(function(Z){return Z.pts>=0}),!H.length)return;h===0?$=0:c?$=Math.max(0,fe):$=H[0].pts}if(d.isAAC)for(var he=h!==void 0,ce=this.config.maxAudioFramesDrift,pe=0,_e=$;pe<H.length;pe++){var oe=H[pe],ne=oe.pts,Ee=ne-_e,ke=Math.abs(1e3*Ee/E);if(Ee<=-ce*D&&he)pe===0&&(S.logger.warn("Audio frame @ "+(ne/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ee/E)+" ms."),this.nextAudioPts=$=_e=ne);else if(Ee>=ce*D&&ke<s&&he){var we=Math.round(Ee/D);_e=ne-we*D,_e<0&&(we--,_e+=D),pe===0&&(this.nextAudioPts=$=_e),S.logger.warn("[mp4-remuxer]: Injecting "+we+" audio frame @ "+(_e/E).toFixed(3)+"s due to "+Math.round(1e3*Ee/E)+" ms gap.");for(var Re=0;Re<we;Re++){var Ue=Math.max(_e,0),be=T.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);be||(S.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),be=oe.unit.subarray()),H.splice(pe,0,{unit:be,pts:Ue}),_e+=D,pe++}}oe.pts=_e,_e+=D}for(var Se=null,Ie=null,Me,De=0,Te=H.length;Te--;)De+=H[Te].unit.byteLength;for(var ye=0,Ge=H.length;ye<Ge;ye++){var Be=H[ye],He=Be.unit,Ne=Be.pts;if(Ie!==null){var Ve=k[ye-1];Ve.duration=Math.round((Ne-Ie)/w)}else if(o&&d.isAAC&&(Ne=$),Se=Ne,De>0){De+=J;try{Me=new Uint8Array(De)}catch(Z){this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating audio mdat "+De});return}if(!I){var ze=new DataView(Me.buffer);ze.setUint32(0,De),Me.set(A.default.types.mdat,4)}}else return;Me.set(He,J);var Fe=He.byteLength;J+=Fe,k.push(new _(!0,P,Fe,0)),Ie=Ne}var Ce=k.length;if(!Ce)return;var We=k[k.length-1];this.nextAudioPts=$=Ie+w*We.duration;var je=I?new Uint8Array(0):A.default.moof(d.sequenceNumber++,Se/w,g({},d,{samples:k}));d.samples=[];var me=Se/E,Le=$/E,re="audio",q={data1:je,data2:Me,startPTS:me,endPTS:Le,startDTS:me,endDTS:Le,type:re,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(Me.length,"MDAT length must not be zero"),q},m.remuxEmptyAudio=function(d,a,o,c){var h=d.inputTimeScale,E=d.samplerate?d.samplerate:h,R=h/E,w=this.nextAudioPts,P=(w!==null?w:c.startDTS*h)+this._initDTS,D=c.endDTS*h+this._initDTS,U=R*r,I=Math.ceil((D-P)/U),k=T.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(S.logger.warn("[mp4-remuxer]: remux empty Audio"),!k){S.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var H=[],J=0;J<I;J++){var $=P+J*U;H.push({unit:k,pts:$,dts:$})}return d.samples=H,this.remuxAudio(d,a,o,!1)},m.remuxID3=function(d,a){var o=d.samples.length;if(!o)return;for(var c=d.inputTimeScale,h=this._initPTS,E=this._initDTS,R=0;R<o;R++){var w=d.samples[R];w.pts=i(w.pts-h,a*c)/c,w.dts=i(w.dts-E,a*c)/c}var P=d.samples;return d.samples=[],{samples:P}},m.remuxText=function(d,a){var o=d.samples.length;if(!o)return;for(var c=d.inputTimeScale,h=this._initPTS,E=0;E<o;E++){var R=d.samples[E];R.pts=i(R.pts-h,a*c)/c}d.samples.sort(function(P,D){return P.pts-D.pts});var w=d.samples;return d.samples=[],{samples:w}},y}();function i(y,m){var f;if(m===null)return y;for(m<y?f=-8589934592:f=8589934592;Math.abs(y-m)>4294967296;)y+=f;return y}function b(y){for(var m=0;m<y.length;m++)if(y[m].key)return m;return-1}var _=function(m,f,d,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=d,this.cts=a,this.flags=new p(m)},p=function(m){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=m?2:1,this.isNonSync=m?0:1}},"./src/remux/passthrough-remuxer.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/polyfills/number.ts"),T=O("./src/utils/mp4-tools.ts"),A=O("./src/loader/fragment.ts"),M=O("./src/utils/logger.ts"),C=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var g=v.prototype;return g.destroy=function(){},g.resetTimeStamp=function(r){this.initPTS=r,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(r,n,u){this.audioCodec=n,this.videoCodec=u,this.generateInitSegment(r),this.emitInitSegment=!0},g.generateInitSegment=function(r){var n=this.audioCodec,u=this.videoCodec;if(!r||!r.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(T.parseInitSegment)(r);n||(n=x(l.audio,A.ElementaryStreamTypes.AUDIO)),u||(u=x(l.video,A.ElementaryStreamTypes.VIDEO));var e={};l.audio&&l.video?e.audiovideo={container:"video/mp4",codec:n+","+u,initSegment:r,id:"main"}:l.audio?e.audio={container:"audio/mp4",codec:n,initSegment:r,id:"audio"}:l.video?e.video={container:"video/mp4",codec:u,initSegment:r,id:"main"}:M.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},g.remux=function(r,n,u,l,e){var t=this.initPTS,i=this.lastEndDTS,b={audio:void 0,video:void 0,text:l,id3:u,initSegment:void 0};Object(L.isFiniteNumber)(i)||(i=this.lastEndDTS=e||0);var _=n.samples;if(!_||!_.length)return b;var p={initPTS:void 0,timescale:1},y=this.initData;if((!y||!y.length)&&(this.generateInitSegment(_),y=this.initData),!y||!y.length)return M.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),b;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(L.isFiniteNumber)(t)||(this.initPTS=p.initPTS=t=S(y,_,i));var m=Object(T.getDuration)(_,y),f=i,d=m+f;Object(T.offsetStartDTS)(y,_,t),m>0?this.lastEndDTS=d:(M.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var a=!!y.audio,o=!!y.video,c="";a&&(c+="audio"),o&&(c+="video");var h={data1:_,startPTS:f,startDTS:f,endPTS:d,endDTS:d,type:c,hasAudio:a,hasVideo:o,nb:1,dropped:0};return b.audio=h.type==="audio"?h:void 0,b.video=h.type!=="audio"?h:void 0,b.text=l,b.id3=u,b.initSegment=p,b},v}(),S=function(g,s,r){return Object(T.getStartDTS)(g,s)-r};function x(v,g){var s=v==null?void 0:v.codec;return s&&s.length>4?s:s==="hvc1"?"hvc1.1.c.L120.90":s==="av01"?"av01.0.04M.08":s==="avc1"||g===A.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}N.default=C},"./src/task-loop.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return L});var L=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var A=T.prototype;return A.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},A.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},A.onHandlerDestroyed=function(){},A.hasInterval=function(){return!!this._tickInterval},A.hasNextTick=function(){return!!this._tickTimer},A.setInterval=function(C){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,C),!0)},A.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},A.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},A.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},A.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},A.doTick=function(){},T}()},"./src/types/cmcd.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"CMCDVersion",function(){return L}),O.d(N,"CMCDObjectType",function(){return T}),O.d(N,"CMCDStreamingFormat",function(){return A}),O.d(N,"CMCDStreamType",function(){return M});var L=1,T;(function(C){C.MANIFEST="m",C.AUDIO="a",C.VIDEO="v",C.MUXED="av",C.INIT="i",C.CAPTION="c",C.TIMED_TEXT="tt",C.KEY="k",C.OTHER="o"})(T||(T={}));var A;(function(C){C.DASH="d",C.HLS="h",C.SMOOTH="s",C.OTHER="o"})(A||(A={}));var M;(function(C){C.VOD="v",C.LIVE="l"})(M||(M={}))},"./src/types/level.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"HlsSkip",function(){return A}),O.d(N,"getSkipValue",function(){return M}),O.d(N,"HlsUrlParameters",function(){return C}),O.d(N,"Level",function(){return S});function L(x,v){for(var g=0;g<v.length;g++){var s=v[g];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(x,s.key,s)}}function T(x,v,g){return v&&L(x.prototype,v),g&&L(x,g),x}var A;(function(x){x.No="",x.Yes="YES",x.v2="v2"})(A||(A={}));function M(x,v){var g=x.canSkipUntil,s=x.canSkipDateRanges,r=x.endSN,n=v!==void 0?v-r:0;return g&&n<g?s?A.v2:A.Yes:A.No}var C=function(){function x(g,s,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=s,this.skip=r}var v=x.prototype;return v.addDirectives=function(s){var r=new self.URL(s);return this.msn!==void 0&&r.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&r.searchParams.set("_HLS_part",this.part.toString()),this.skip&&r.searchParams.set("_HLS_skip",this.skip),r.toString()},x}(),S=function(){function x(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return T(x,[{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(g){var s=g%this.url.length;this._urlId!==s&&(this.details=void 0,this._urlId=s)}}]),x}()},"./src/types/loader.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"PlaylistContextType",function(){return L}),O.d(N,"PlaylistLevelType",function(){return T});var L;(function(A){A.MANIFEST="manifest",A.LEVEL="level",A.AUDIO_TRACK="audioTrack",A.SUBTITLE_TRACK="subtitleTrack"})(L||(L={}));var T;(function(A){A.MAIN="main",A.AUDIO="audio",A.SUBTITLE="subtitle"})(T||(T={}))},"./src/types/transmuxer.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"ChunkMetadata",function(){return L});var L=function(M,C,S,x,v,g){x===void 0&&(x=0),v===void 0&&(v=-1),g===void 0&&(g=!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=T(),this.buffering={audio:T(),video:T(),audiovideo:T()},this.level=M,this.sn=C,this.id=S,this.size=x,this.part=v,this.partial=g};function T(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"AttrList",function(){return A});var L=/^(\d+)x(\d+)$/,T=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,A=function(){function M(S){typeof S=="string"&&(S=M.parseAttrList(S));for(var x in S)S.hasOwnProperty(x)&&(this[x]=S[x])}var C=M.prototype;return C.decimalInteger=function(x){var v=parseInt(this[x],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},C.hexadecimalInteger=function(x){if(this[x]){var v=(this[x]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var g=new Uint8Array(v.length/2),s=0;s<v.length/2;s++)g[s]=parseInt(v.slice(s*2,s*2+2),16);return g}else return null},C.hexadecimalIntegerAsNumber=function(x){var v=parseInt(this[x],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},C.decimalFloatingPoint=function(x){return parseFloat(this[x])},C.optionalFloat=function(x,v){var g=this[x];return g?parseFloat(g):v},C.enumeratedString=function(x){return this[x]},C.bool=function(x){return this[x]==="YES"},C.decimalResolution=function(x){var v=L.exec(this[x]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},M.parseAttrList=function(x){var v,g={},s='"';for(T.lastIndex=0;(v=T.exec(x))!==null;){var r=v[2];r.indexOf(s)===0&&r.lastIndexOf(s)===r.length-1&&(r=r.slice(1,-1)),g[v[1]]=r}return g},M}()},"./src/utils/binary-search.ts":function(le,N,O){"use strict";O.r(N);var L={search:function(A,M){for(var C=0,S=A.length-1,x=null,v=null;C<=S;){x=(C+S)/2|0,v=A[x];var g=M(v);if(g>0)C=x+1;else if(g<0)S=x-1;else return v}return null}};N.default=L},"./src/utils/buffer-helper.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"BufferHelper",function(){return A});var L=O("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},A=function(){function M(){}return M.isBuffered=function(S,x){try{if(S){for(var v=M.getBuffered(S),g=0;g<v.length;g++)if(x>=v.start(g)&&x<=v.end(g))return!0}}catch(s){}return!1},M.bufferInfo=function(S,x,v){try{if(S){var g=M.getBuffered(S),s=[],r;for(r=0;r<g.length;r++)s.push({start:g.start(r),end:g.end(r)});return this.bufferedInfo(s,x,v)}}catch(n){}return{len:0,start:x,end:x,nextStart:void 0}},M.bufferedInfo=function(S,x,v){x=Math.max(0,x),S.sort(function(p,y){var m=p.start-y.start;return m||y.end-p.end});var g=[];if(v)for(var s=0;s<S.length;s++){var r=g.length;if(r){var n=g[r-1].end;S[s].start-n<v?S[s].end>n&&(g[r-1].end=S[s].end):g.push(S[s])}else g.push(S[s])}else g=S;for(var u=0,l,e=x,t=x,i=0;i<g.length;i++){var b=g[i].start,_=g[i].end;if(x+v>=b&&x<_)e=b,t=_,u=t-x;else if(x+v<b){l=b;break}}return{len:u,start:e||0,end:t||0,nextStart:l}},M.getBuffered=function(S){try{return S.buffered}catch(x){return L.logger.log("failed to get media.buffered",x),T}},M}()},"./src/utils/cea-608-parser.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"Row",function(){return t}),O.d(N,"CaptionScreen",function(){return i});var L=O("./src/utils/logger.ts"),T={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},A=function(d){var a=d;return T.hasOwnProperty(d)&&(a=T[d]),String.fromCharCode(a)},M=15,C=100,S={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},x={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],r;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(r||(r={}));var n=function(){function f(){this.time=null,this.verboseLevel=r.ERROR}var d=f.prototype;return d.log=function(o,c){this.verboseLevel>=o&&L.logger.log(this.time+" ["+o+"] "+c)},f}(),u=function(d){for(var a=[],o=0;o<d.length;o++)a.push(d[o].toString(16));return a},l=function(){function f(a,o,c,h,E){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=a||"white",this.underline=o||!1,this.italics=c||!1,this.background=h||"black",this.flash=E||!1}var d=f.prototype;return d.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},d.setStyles=function(o){for(var c=["foreground","underline","italics","background","flash"],h=0;h<c.length;h++){var E=c[h];o.hasOwnProperty(E)&&(this[E]=o[E])}},d.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},d.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},d.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},d.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),e=function(){function f(a,o,c,h,E,R){this.uchar=void 0,this.penState=void 0,this.uchar=a||" ",this.penState=new l(o,c,h,E,R)}var d=f.prototype;return d.reset=function(){this.uchar=" ",this.penState.reset()},d.setChar=function(o,c){this.uchar=o,this.penState.copy(c)},d.setPenState=function(o){this.penState.copy(o)},d.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},d.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},d.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),t=function(){function f(a){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<C;o++)this.chars.push(new e);this.logger=a,this.pos=0,this.currPenState=new l}var d=f.prototype;return d.equals=function(o){for(var c=!0,h=0;h<C;h++)if(!this.chars[h].equals(o.chars[h])){c=!1;break}return c},d.copy=function(o){for(var c=0;c<C;c++)this.chars[c].copy(o.chars[c])},d.isEmpty=function(){for(var o=!0,c=0;c<C;c++)if(!this.chars[c].isEmpty()){o=!1;break}return o},d.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>C&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=C)},d.moveCursor=function(o){var c=this.pos+o;if(o>1)for(var h=this.pos+1;h<c+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(c)},d.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},d.insertChar=function(o){o>=144&&this.backSpace();var c=A(o);if(this.pos>=C){this.logger.log(r.ERROR,"Cannot insert "+o.toString(16)+" ("+c+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(c,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(o){var c;for(c=o;c<C;c++)this.chars[c].reset()},d.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},d.clearToEndOfRow=function(){this.clearFromPos(this.pos)},d.getTextString=function(){for(var o=[],c=!0,h=0;h<C;h++){var E=this.chars[h].uchar;E!==" "&&(c=!1),o.push(E)}return c?"":o.join("")},d.setPenStyles=function(o){this.currPenState.setStyles(o);var c=this.chars[this.pos];c.setPenState(this.currPenState)},f}(),i=function(){function f(a){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<M;o++)this.rows.push(new t(a));this.logger=a,this.currRow=M-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var d=f.prototype;return d.reset=function(){for(var o=0;o<M;o++)this.rows[o].clear();this.currRow=M-1},d.equals=function(o){for(var c=!0,h=0;h<M;h++)if(!this.rows[h].equals(o.rows[h])){c=!1;break}return c},d.copy=function(o){for(var c=0;c<M;c++)this.rows[c].copy(o.rows[c])},d.isEmpty=function(){for(var o=!0,c=0;c<M;c++)if(!this.rows[c].isEmpty()){o=!1;break}return o},d.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},d.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},d.insertChar=function(o){var c=this.rows[this.currRow];c.insertChar(o)},d.setPen=function(o){var c=this.rows[this.currRow];c.setPenStyles(o)},d.moveCursor=function(o){var c=this.rows[this.currRow];c.moveCursor(o)},d.setCursor=function(o){this.logger.log(r.INFO,"setCursor: "+o);var c=this.rows[this.currRow];c.setCursor(o)},d.setPAC=function(o){this.logger.log(r.INFO,"pacData = "+JSON.stringify(o));var c=o.row-1;if(this.nrRollUpRows&&c<this.nrRollUpRows-1&&(c=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==c){for(var h=0;h<M;h++)this.rows[h].clear();var E=this.currRow+1-this.nrRollUpRows,R=this.lastOutputScreen;if(R){var w=R.rows[E].cueStartTime,P=this.logger.time;if(w&&P!==null&&w<P)for(var D=0;D<this.nrRollUpRows;D++)this.rows[c-this.nrRollUpRows+D+1].copy(R.rows[E+D])}}this.currRow=c;var U=this.rows[this.currRow];if(o.indent!==null){var I=o.indent,k=Math.max(I-1,0);U.setCursor(o.indent),o.color=U.chars[k].penState.foreground}var H={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(H)},d.setBkgData=function(o){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},d.setRollUpRows=function(o){this.nrRollUpRows=o},d.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(r.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,c=this.rows.splice(o,1)[0];c.clear(),this.rows.splice(this.currRow,0,c),this.logger.log(r.INFO,"Rolling up")},d.getDisplayText=function(o){o=o||!1;for(var c=[],h="",E=-1,R=0;R<M;R++){var w=this.rows[R].getTextString();w&&(E=R+1,o?c.push("Row "+E+": '"+w+"'"):c.push(w.trim()))}return c.length>0&&(o?h="["+c.join(" | ")+"]":h=c.join(`
`)),h},d.getTextAndFormat=function(){return this.rows},f}(),b=function(){function f(a,o,c){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=a,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new i(c),this.nonDisplayedMemory=new i(c),this.lastOutputScreen=new i(c),this.currRollUpRow=this.displayedMemory.rows[M-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=c}var d=f.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[M-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(o){this.outputFilter=o},d.setPAC=function(o){this.writeScreen.setPAC(o)},d.setBkgData=function(o){this.writeScreen.setBkgData(o)},d.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(r.INFO,"MODE="+o),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=o},d.insertChars=function(o){for(var c=0;c<o.length;c++)this.writeScreen.insertChar(o[c]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},d.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},d.ccBS=function(){if(this.logger.log(r.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},d.ccAOF=function(){},d.ccAON=function(){},d.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},d.ccRU=function(o){this.logger.log(r.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},d.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},d.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},d.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},d.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},d.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},d.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},d.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},d.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},d.ccTO=function(o){this.logger.log(r.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},d.ccMIDROW=function(o){var c={flash:!1};if(c.underline=o%2===1,c.italics=o>=46,c.italics)c.foreground="white";else{var h=Math.floor(o/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];c.foreground=E[h]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(c)),this.writeScreen.setPen(c)},d.outputDataUpdate=function(o){o===void 0&&(o=!1);var c=this.logger.time;if(c===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=c:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,c,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:c),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},f}(),_=function(){function f(a,o,c){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new n;this.channels=[null,new b(a,o,h),new b(a+1,c,h)],this.cmdHistory=m(),this.logger=h}var d=f.prototype;return d.getHandler=function(o){return this.channels[o].getHandler()},d.setHandler=function(o,c){this.channels[o].setHandler(c)},d.addData=function(o,c){var h,E,R,w=!1;this.logger.time=o;for(var P=0;P<c.length;P+=2){if(E=c[P]&127,R=c[P+1]&127,E===0&&R===0)continue;if(this.logger.log(r.DATA,"["+u([c[P],c[P+1]])+"] -> ("+u([E,R])+")"),h=this.parseCmd(E,R),h||(h=this.parseMidrow(E,R)),h||(h=this.parsePAC(E,R)),h||(h=this.parseBackgroundAttributes(E,R)),!h&&(w=this.parseChars(E,R),w)){var D=this.currentChannel;if(D&&D>0){var U=this.channels[D];U.insertChars(w)}else this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!w&&this.logger.log(r.WARNING,"Couldn't parse cleaned data "+u([E,R])+" orig: "+u([c[P],c[P+1]]))}},d.parseCmd=function(o,c){var h=this.cmdHistory,E=(o===20||o===28||o===21||o===29)&&c>=32&&c<=47,R=(o===23||o===31)&&c>=33&&c<=35;if(!(E||R))return!1;if(y(o,c,h))return p(null,null,h),this.logger.log(r.DEBUG,"Repeated command ("+u([o,c])+") is dropped"),!0;var w=o===20||o===21||o===23?1:2,P=this.channels[w];return o===20||o===21||o===28||o===29?c===32?P.ccRCL():c===33?P.ccBS():c===34?P.ccAOF():c===35?P.ccAON():c===36?P.ccDER():c===37?P.ccRU(2):c===38?P.ccRU(3):c===39?P.ccRU(4):c===40?P.ccFON():c===41?P.ccRDC():c===42?P.ccTR():c===43?P.ccRTD():c===44?P.ccEDM():c===45?P.ccCR():c===46?P.ccENM():c===47&&P.ccEOC():P.ccTO(c-32),p(o,c,h),this.currentChannel=w,!0},d.parseMidrow=function(o,c){var h=0;if((o===17||o===25)&&c>=32&&c<=47){if(o===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[h];return E?(E.ccMIDROW(c),this.logger.log(r.DEBUG,"MIDROW ("+u([o,c])+")"),!0):!1}return!1},d.parsePAC=function(o,c){var h,E=this.cmdHistory,R=(o>=17&&o<=23||o>=25&&o<=31)&&c>=64&&c<=127,w=(o===16||o===24)&&c>=64&&c<=95;if(!(R||w))return!1;if(y(o,c,E))return p(null,null,E),!0;var P=o<=23?1:2;c>=64&&c<=95?h=P===1?S[o]:v[o]:h=P===1?x[o]:g[o];var D=this.channels[P];return D?(D.setPAC(this.interpretPAC(h,c)),p(o,c,E),this.currentChannel=P,!0):!1},d.interpretPAC=function(o,c){var h,E={color:null,italics:!1,indent:null,underline:!1,row:o};return c>95?h=c-96:h=c-64,E.underline=(h&1)===1,h<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((h-16)/2)*4,E},d.parseChars=function(o,c){var h,E=null,R=null;if(o>=25?(h=2,R=o-8):(h=1,R=o),R>=17&&R<=19){var w;R===17?w=c+80:R===18?w=c+112:w=c+144,this.logger.log(r.INFO,"Special char '"+A(w)+"' in channel "+h),E=[w]}else o>=32&&o<=127&&(E=c===0?[o]:[o,c]);if(E){var P=u(E);this.logger.log(r.DEBUG,"Char codes = "+P.join(",")),p(o,c,this.cmdHistory)}return E},d.parseBackgroundAttributes=function(o,c){var h=(o===16||o===24)&&c>=32&&c<=47,E=(o===23||o===31)&&c>=45&&c<=47;if(!(h||E))return!1;var R,w={};o===16||o===24?(R=Math.floor((c-32)/2),w.background=s[R],c%2===1&&(w.background=w.background+"_semi")):c===45?w.background="transparent":(w.foreground="black",c===47&&(w.underline=!0));var P=o<=23?1:2,D=this.channels[P];return D.setBkgData(w),p(o,c,this.cmdHistory),!0},d.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var c=this.channels[o];c&&c.reset()}this.cmdHistory=m()},d.cueSplitAtTime=function(o){for(var c=0;c<this.channels.length;c++){var h=this.channels[c];h&&h.cueSplitAtTime(o)}},f}();function p(f,d,a){a.a=f,a.b=d}function y(f,d,a){return a.a===f&&a.b===d}function m(){return{a:null,b:null}}N.default=_},"./src/utils/codecs.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"isCodecType",function(){return T}),O.d(N,"isCodecSupportedInMp4",function(){return A});var L={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 T(M,C){var S=L[C];return!!S&&S[M.slice(0,4)]===!0}function A(M,C){return MediaSource.isTypeSupported((C||"video")+'/mp4;codecs="'+M+'"')}},"./src/utils/cues.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/utils/vttparser.ts"),T=O("./src/utils/webvtt-parser.ts"),A=O("./src/utils/texttrack-utils.ts"),M=/\s/,C={newCue:function(x,v,g,s){for(var r=[],n,u,l,e,t,i=self.VTTCue||self.TextTrackCue,b=0;b<s.rows.length;b++)if(n=s.rows[b],l=!0,e=0,t="",!n.isEmpty()){for(var _=0;_<n.chars.length;_++)M.test(n.chars[_].uchar)&&l?e++:(t+=n.chars[_].uchar,l=!1);n.cueStartTime=v,v===g&&(g+=1e-4),e>=16?e--:e++;var p=Object(L.fixLineBreaks)(t.trim()),y=Object(T.generateCueId)(v,g,p);(!x||!x.cues||!x.cues.getCueById(y))&&(u=new i(v,g,p),u.id=y,u.line=b+1,u.align="left",u.position=10+Math.min(80,Math.floor(e*8/32)*10),r.push(u))}return x&&r.length&&(r.sort(function(m,f){return m.line==="auto"||f.line==="auto"?0:m.line>8&&f.line>8?f.line-m.line:m.line-f.line}),r.forEach(function(m){return Object(A.addCueToTrack)(x,m)})),r}};N.default=C},"./src/utils/discontinuities.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"findFirstFragWithCC",function(){return M}),O.d(N,"shouldAlignOnDiscontinuities",function(){return C}),O.d(N,"findDiscontinuousReferenceFrag",function(){return S}),O.d(N,"adjustSlidingStart",function(){return v}),O.d(N,"alignStream",function(){return g}),O.d(N,"alignPDT",function(){return r}),O.d(N,"alignFragmentByPDTDelta",function(){return n}),O.d(N,"alignMediaPlaylistByPDT",function(){return u});var L=O("./src/polyfills/number.ts"),T=O("./src/utils/logger.ts"),A=O("./src/controller/level-helper.ts");function M(l,e){for(var t=null,i=0,b=l.length;i<b;i++){var _=l[i];if(_&&_.cc===e){t=_;break}}return t}function C(l,e,t){return!!(e.details&&(t.endCC>t.startCC||l&&l.cc<t.startCC))}function S(l,e){var t=l.fragments,i=e.fragments;if(!i.length||!t.length){T.logger.log("No fragments to align");return}var b=M(t,i[0].cc);if(!b||b&&!b.startPTS){T.logger.log("No frag in previous level to align on");return}return b}function x(l,e){if(l){var t=l.start+e;l.start=l.startPTS=t,l.endPTS=t+l.duration}}function v(l,e){for(var t=e.fragments,i=0,b=t.length;i<b;i++)x(t[i],l);e.fragmentHint&&x(e.fragmentHint,l),e.alignedSliding=!0}function g(l,e,t){if(!e)return;s(l,t,e),!t.alignedSliding&&e.details&&r(t,e.details),!t.alignedSliding&&e.details&&!t.skippedSegments&&Object(A.adjustSliding)(e.details,t)}function s(l,e,t){if(C(l,t,e)){var i=S(t.details,e);i&&Object(L.isFiniteNumber)(i.start)&&(T.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),v(i.start,e))}}function r(l,e){if(!e.fragments.length||!l.hasProgramDateTime||!e.hasProgramDateTime)return;var t=e.fragments[0].programDateTime,i=l.fragments[0].programDateTime,b=(i-t)/1e3+e.fragments[0].start;b&&Object(L.isFiniteNumber)(b)&&(T.logger.log("Adjusting PTS using programDateTime delta "+(i-t)+"ms, sliding:"+b.toFixed(3)+" "+l.url+" "),v(b,l))}function n(l,e){var t=l.programDateTime;if(!t)return;var i=(t-e)/1e3;l.start=l.startPTS=i,l.endPTS=i+l.duration}function u(l,e){if(!e.fragments.length||!l.hasProgramDateTime||!e.hasProgramDateTime)return;var t=e.fragments[0].programDateTime,i=e.fragments[0].start,b=t-i*1e3;l.fragments.forEach(function(_){n(_,b)}),l.fragmentHint&&n(l.fragmentHint,b),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/utils/ewma.ts"),T=function(){function A(C,S,x){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=x,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new L.default(C),this.fast_=new L.default(S)}var M=A.prototype;return M.update=function(S,x){var v=this.slow_,g=this.fast_;this.slow_.halfLife!==S&&(this.slow_=new L.default(S,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==x&&(this.fast_=new L.default(x,g.getEstimate(),g.getTotalWeight()))},M.sample=function(S,x){S=Math.max(S,this.minDelayMs_);var v=8*x,g=S/1e3,s=v/g;this.fast_.sample(g,s),this.slow_.sample(g,s)},M.canEstimate=function(){var S=this.fast_;return S&&S.getTotalWeight()>=this.minWeight_},M.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},M.destroy=function(){},A}();N.default=T},"./src/utils/ewma.ts":function(le,N,O){"use strict";O.r(N);var L=function(){function T(M,C,S){C===void 0&&(C=0),S===void 0&&(S=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=M,this.alpha_=M?Math.exp(Math.log(.5)/M):0,this.estimate_=C,this.totalWeight_=S}var A=T.prototype;return A.sample=function(C,S){var x=Math.pow(this.alpha_,C);this.estimate_=S*(1-x)+x*this.estimate_,this.totalWeight_+=C},A.getTotalWeight=function(){return this.totalWeight_},A.getEstimate=function(){if(this.alpha_){var C=1-Math.pow(this.alpha_,this.totalWeight_);if(C)return this.estimate_/C}return this.estimate_},T}();N.default=L},"./src/utils/fetch-loader.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"fetchSupported",function(){return n});var L=O("./src/polyfills/number.ts"),T=O("./src/loader/load-stats.ts"),A=O("./src/demux/chunk-cache.ts");function M(i,b){i.prototype=Object.create(b.prototype),i.prototype.constructor=i,g(i,b)}function C(i){var b=typeof Map=="function"?new Map:void 0;return C=function(p){if(p===null||!v(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof b!="undefined"){if(b.has(p))return b.get(p);b.set(p,y)}function y(){return S(p,arguments,s(this).constructor)}return y.prototype=Object.create(p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g(y,p)},C(i)}function S(i,b,_){return x()?S=Reflect.construct:S=function(y,m,f){var d=[null];d.push.apply(d,m);var a=Function.bind.apply(y,d),o=new a;return f&&g(o,f.prototype),o},S.apply(null,arguments)}function x(){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(i){return!1}}function v(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function g(i,b){return g=Object.setPrototypeOf||function(p,y){return p.__proto__=y,p},g(i,b)}function s(i){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},s(i)}function r(){return r=Object.assign||function(i){for(var b=1;b<arguments.length;b++){var _=arguments[b];for(var p in _)Object.prototype.hasOwnProperty.call(_,p)&&(i[p]=_[p])}return i},r.apply(this,arguments)}function n(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var u=function(){function i(_){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=_.fetchSetup||e,this.controller=new self.AbortController,this.stats=new T.LoadStats}var b=i.prototype;return b.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},b.abortInternal=function(){var p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},b.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},b.load=function(p,y,m){var f=this,d=this.stats;if(d.loading.start)throw new Error("Loader can only be used once.");d.loading.start=self.performance.now();var a=l(p,this.controller.signal),o=m.onProgress,c=p.responseType==="arraybuffer",h=c?"byteLength":"length";this.context=p,this.config=y,this.callbacks=m,this.request=this.fetchSetup(p,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),m.onTimeout(d,p,f.response)},y.timeout),self.fetch(this.request).then(function(E){if(f.response=f.loader=E,!E.ok){var R=E.status,w=E.statusText;throw new t(w||"fetch, bad network response",R,E)}return d.loading.first=Math.max(self.performance.now(),d.loading.start),d.total=parseInt(E.headers.get("Content-Length")||"0"),o&&Object(L.isFiniteNumber)(y.highWaterMark)?f.loadProgressively(E,d,p,y.highWaterMark,o):c?E.arrayBuffer():E.text()}).then(function(E){var R=f.response;self.clearTimeout(f.requestTimeout),d.loading.end=Math.max(self.performance.now(),d.loading.first),d.loaded=d.total=E[h];var w={url:R.url,data:E};o&&!Object(L.isFiniteNumber)(y.highWaterMark)&&o(d,p,E,R),m.onSuccess(w,d,p,R)}).catch(function(E){if(self.clearTimeout(f.requestTimeout),d.aborted)return;var R=E.code||0;m.onError({code:R,text:E.message},p,E.details)})},b.getCacheAge=function(){var p=null;if(this.response){var y=this.response.headers.get("age");p=y?parseFloat(y):null}return p},b.loadProgressively=function(p,y,m,f,d){f===void 0&&(f=0);var a=new A.default,o=p.body.getReader(),c=function h(){return o.read().then(function(E){if(E.done)return a.dataLength&&d(y,m,a.flush(),p),Promise.resolve(new ArrayBuffer(0));var R=E.value,w=R.length;return y.loaded+=w,w<f||a.dataLength?(a.push(R),a.dataLength>=f&&d(y,m,a.flush(),p)):d(y,m,R,p),h()}).catch(function(){return Promise.reject()})};return c()},i}();function l(i,b){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:b,headers:new self.Headers(r({},i.headers))};return i.rangeEnd&&_.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),_}function e(i,b){return new self.Request(i.url,b)}var t=function(i){M(b,i);function b(_,p,y){var m;return m=i.call(this,_)||this,m.code=void 0,m.details=void 0,m.code=p,m.details=y,m}return b}(C(Error));N.default=u},"./src/utils/imsc1-ttml-parser.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"IMSC1_CODEC",function(){return v}),O.d(N,"parseIMSC1",function(){return n});var L=O("./src/utils/mp4-tools.ts"),T=O("./src/utils/vttparser.ts"),A=O("./src/utils/vttcue.ts"),M=O("./src/demux/id3.ts"),C=O("./src/utils/timescale-conversion.ts"),S=O("./src/utils/webvtt-parser.ts");function x(){return x=Object.assign||function(f){for(var d=1;d<arguments.length;d++){var a=arguments[d];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(f[o]=a[o])}return f},x.apply(this,arguments)}var v="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,s=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,r={left:"start",center:"center",right:"end",start:"start",end:"end"};function n(f,d,a,o,c){var h=Object(L.findBox)(new Uint8Array(f),["mdat"]);if(h.length===0){c(new Error("Could not parse IMSC1 mdat"));return}var E=h[0],R=Object(M.utf8ArrayToStr)(new Uint8Array(f,E.start,E.end-E.start)),w=Object(C.toTimescaleFromScale)(d,1,a);try{o(u(R,w))}catch(P){c(P)}}function u(f,d){var a=new DOMParser,o=a.parseFromString(f,"text/xml"),c=o.getElementsByTagName("tt")[0];if(!c)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(h).reduce(function(U,I){return U[I]=c.getAttribute("ttp:"+I)||h[I],U},{}),R=c.getAttribute("xml:space")!=="preserve",w=e(l(c,"styling","style")),P=e(l(c,"layout","region")),D=l(c,"body","[begin]");return[].map.call(D,function(U){var I=t(U,R);if(!I||!U.hasAttribute("begin"))return null;var k=p(U.getAttribute("begin"),E),H=p(U.getAttribute("dur"),E),J=p(U.getAttribute("end"),E);if(k===null)throw _(U);if(J===null){if(H===null)throw _(U);J=k+H}var $=new A.default(k-d,J-d,I);$.id=Object(S.generateCueId)($.startTime,$.endTime,$.text);var fe=P[U.getAttribute("region")],he=w[U.getAttribute("style")];$.position=10,$.size=80;var ce=i(fe,he),pe=ce.textAlign;if(pe){var _e=r[pe];_e&&($.lineAlign=_e),$.align=pe}return x($,ce),$}).filter(function(U){return U!==null})}function l(f,d,a){var o=f.getElementsByTagName(d)[0];return o?[].slice.call(o.querySelectorAll(a)):[]}function e(f){return f.reduce(function(d,a){var o=a.getAttribute("xml:id");return o&&(d[o]=a),d},{})}function t(f,d){return[].slice.call(f.childNodes).reduce(function(a,o,c){var h;return o.nodeName==="br"&&c?a+`
`:(h=o.childNodes)!==null&&h!==void 0&&h.length?t(o,d):d?a+o.textContent.trim().replace(/\s+/g," "):a+o.textContent},"")}function i(f,d){var a="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(c,h){var E=b(d,a,h)||b(f,a,h);return E&&(c[h]=E),c},{})}function b(f,d,a){return f.hasAttributeNS(d,a)?f.getAttributeNS(d,a):null}function _(f){return new Error("Could not parse ttml timestamp "+f)}function p(f,d){if(!f)return null;var a=Object(T.parseTimeStamp)(f);return a===null&&(g.test(f)?a=y(f,d):s.test(f)&&(a=m(f,d))),a}function y(f,d){var a=g.exec(f),o=(a[4]|0)+(a[5]|0)/d.subFrameRate;return(a[1]|0)*3600+(a[2]|0)*60+(a[3]|0)+o/d.frameRate}function m(f,d){var a=s.exec(f),o=Number(a[1]),c=a[2];switch(c){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/d.frameRate;case"t":return o/d.tickRate}return o}},"./src/utils/logger.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"enableLogs",function(){return S}),O.d(N,"logger",function(){return x});var L=function(){},T={trace:L,debug:L,log:L,warn:L,info:L,error:L},A=T;function M(v){var g=self.console[v];return g?g.bind(self.console,"["+v+"] >"):L}function C(v){for(var g=arguments.length,s=new Array(g>1?g-1:0),r=1;r<g;r++)s[r-1]=arguments[r];s.forEach(function(n){A[n]=v[n]?v[n].bind(v):M(n)})}function S(v){if(self.console&&v===!0||typeof v=="object"){C(v,"debug","log","info","warn","error");try{A.log()}catch(g){A=T}}else A=T}var x=A},"./src/utils/mediakeys-helper.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"KeySystems",function(){return L}),O.d(N,"requestMediaKeySystemAccess",function(){return T});var L;(function(A){A.WIDEVINE="com.widevine.alpha",A.PLAYREADY="com.microsoft.playready"})(L||(L={}));var T=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"getMediaSource",function(){return L});function L(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"bin2str",function(){return C}),O.d(N,"readUint16",function(){return S}),O.d(N,"readUint32",function(){return x}),O.d(N,"writeUint32",function(){return v}),O.d(N,"findBox",function(){return g}),O.d(N,"parseSegmentIndex",function(){return s}),O.d(N,"parseInitSegment",function(){return r}),O.d(N,"getStartDTS",function(){return n}),O.d(N,"getDuration",function(){return u}),O.d(N,"computeRawDurationFromSamples",function(){return l}),O.d(N,"offsetStartDTS",function(){return e}),O.d(N,"segmentValidRange",function(){return t}),O.d(N,"appendUint8Array",function(){return i});var L=O("./src/utils/typed-array.ts"),T=O("./src/loader/fragment.ts"),A=Math.pow(2,32)-1,M=[].push;function C(b){return String.fromCharCode.apply(null,b)}function S(b,_){"data"in b&&(_+=b.start,b=b.data);var p=b[_]<<8|b[_+1];return p<0?65536+p:p}function x(b,_){"data"in b&&(_+=b.start,b=b.data);var p=b[_]<<24|b[_+1]<<16|b[_+2]<<8|b[_+3];return p<0?4294967296+p:p}function v(b,_,p){"data"in b&&(_+=b.start,b=b.data),b[_]=p>>24,b[_+1]=p>>16&255,b[_+2]=p>>8&255,b[_+3]=p&255}function g(b,_){var p=[];if(!_.length)return p;var y,m,f;"data"in b?(y=b.data,m=b.start,f=b.end):(y=b,m=0,f=y.byteLength);for(var d=m;d<f;){var a=x(y,d),o=C(y.subarray(d+4,d+8)),c=a>1?d+a:f;if(o===_[0])if(_.length===1)p.push({data:y,start:d+8,end:c});else{var h=g({data:y,start:d+8,end:c},_.slice(1));h.length&&M.apply(p,h)}d=c}return p}function s(b){var _=g(b,["moov"]),p=_[0],y=p?p.end:null,m=g(b,["sidx"]);if(!m||!m[0])return null;var f=[],d=m[0],a=d.data[0],o=a===0?8:16,c=x(d,o);o+=4;var h=0,E=0;a===0?o+=8:o+=16,o+=2;var R=d.end+E,w=S(d,o);o+=2;for(var P=0;P<w;P++){var D=o,U=x(d,D);D+=4;var I=U&2147483647,k=(U&2147483648)>>>31;if(k===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var H=x(d,D);D+=4,f.push({referenceSize:I,subsegmentDuration:H,info:{duration:H/c,start:R,end:R+I-1}}),R+=I,D+=4,o=D}return{earliestPresentationTime:h,timescale:c,version:a,referencesCount:w,references:f,moovEndOffset:y}}function r(b){for(var _=[],p=g(b,["moov","trak"]),y=0;y<p.length;y++){var m=p[y],f=g(m,["tkhd"])[0];if(f){var d=f.data[f.start],a=d===0?12:20,o=x(f,a),c=g(m,["mdia","mdhd"])[0];if(c){d=c.data[c.start],a=d===0?12:20;var h=x(c,a),E=g(m,["mdia","hdlr"])[0];if(E){var R=C(E.data.subarray(E.start+8,E.start+12)),w={soun:T.ElementaryStreamTypes.AUDIO,vide:T.ElementaryStreamTypes.VIDEO}[R];if(w){var P=g(m,["mdia","minf","stbl","stsd"])[0],D=void 0;P&&(D=C(P.data.subarray(P.start+12,P.start+16))),_[o]={timescale:h,type:w},_[w]={timescale:h,id:o,codec:D}}}}}}var U=g(b,["moov","mvex","trex"]);return U.forEach(function(I){var k=x(I,4),H=_[k];H&&(H.default={duration:x(I,12),flags:x(I,20)})}),_}function n(b,_){return g(_,["moof","traf"]).reduce(function(p,y){var m=g(y,["tfdt"])[0],f=m.data[m.start],d=g(y,["tfhd"]).reduce(function(a,o){var c=x(o,4),h=b[c];if(h){var E=x(m,4);f===1&&(E*=Math.pow(2,32),E+=x(m,8));var R=h.timescale||9e4,w=E/R;if(isFinite(w)&&(a===null||w<a))return w}return a},null);return d!==null&&isFinite(d)&&(p===null||d<p)?d:p},null)||0}function u(b,_){for(var p=0,y=0,m=0,f=g(b,["moof","traf"]),d=0;d<f.length;d++){var a=f[d],o=g(a,["tfhd"])[0],c=x(o,4),h=_[c];if(!h)continue;var E=h.default,R=x(o,0)|(E==null?void 0:E.flags),w=E==null?void 0:E.duration;R&8&&(R&2?w=x(o,12):w=x(o,8));for(var P=h.timescale||9e4,D=g(a,["trun"]),U=0;U<D.length;U++){if(w){var I=x(D[U],4);p=w*I}else p=l(D[U]);h.type===T.ElementaryStreamTypes.VIDEO?y+=p/P:h.type===T.ElementaryStreamTypes.AUDIO&&(m+=p/P)}}if(y===0&&m===0){var k=s(b);if(k!=null&&k.references)return k.references.reduce(function(H,J){return H+J.info.duration||0},0)}return y||m}function l(b){var _=x(b,0),p=8;_&1&&(p+=4),_&4&&(p+=4);for(var y=0,m=x(b,4),f=0;f<m;f++){if(_&256){var d=x(b,p);y+=d,p+=4}_&512&&(p+=4),_&1024&&(p+=4),_&2048&&(p+=4)}return y}function e(b,_,p){g(_,["moof","traf"]).forEach(function(y){g(y,["tfhd"]).forEach(function(m){var f=x(m,4),d=b[f];if(!d)return;var a=d.timescale||9e4;g(y,["tfdt"]).forEach(function(o){var c=o.data[o.start],h=x(o,4);if(c===0)v(o,4,h-p*a);else{h*=Math.pow(2,32),h+=x(o,8),h-=p*a,h=Math.max(h,0);var E=Math.floor(h/(A+1)),R=Math.floor(h%(A+1));v(o,4,E),v(o,8,R)}})})})}function t(b){var _={valid:null,remainder:null},p=g(b,["moof"]);if(p){if(p.length<2)return _.remainder=b,_}else return _;var y=p[p.length-1];return _.valid=Object(L.sliceUint8)(b,0,y.start-8),_.remainder=Object(L.sliceUint8)(b,y.start-8),_}function i(b,_){var p=new Uint8Array(b.length+_.length);return p.set(b),p.set(_,b.length),p}},"./src/utils/output-filter.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"default",function(){return L});var L=function(){function T(M,C){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=M,this.trackName=C}var A=T.prototype;return A.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},A.newCue=function(C,S,x){(this.startTime===null||this.startTime>C)&&(this.startTime=C),this.endTime=S,this.screen=x,this.timelineController.createCaptionsTrack(this.trackName)},A.reset=function(){this.cueRanges=[]},T}()},"./src/utils/texttrack-utils.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"sendAddTrackEvent",function(){return T}),O.d(N,"addCueToTrack",function(){return A}),O.d(N,"clearCurrentCues",function(){return M}),O.d(N,"removeCuesInRange",function(){return C}),O.d(N,"getCuesInRange",function(){return x});var L=O("./src/utils/logger.ts");function T(v,g){var s;try{s=new Event("addtrack")}catch(r){s=document.createEvent("Event"),s.initEvent("addtrack",!1,!1)}s.track=v,g.dispatchEvent(s)}function A(v,g){var s=v.mode;if(s==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(g.id))try{if(v.addCue(g),!v.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(n){L.logger.debug("[texttrack-utils]: "+n);var r=new self.TextTrackCue(g.startTime,g.endTime,g.text);r.id=g.id,v.addCue(r)}s==="disabled"&&(v.mode=s)}function M(v){var g=v.mode;if(g==="disabled"&&(v.mode="hidden"),v.cues)for(var s=v.cues.length;s--;)v.removeCue(v.cues[s]);g==="disabled"&&(v.mode=g)}function C(v,g,s){var r=v.mode;if(r==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var n=x(v.cues,g,s),u=0;u<n.length;u++)v.removeCue(n[u]);r==="disabled"&&(v.mode=r)}function S(v,g){if(g<v[0].startTime)return 0;var s=v.length-1;if(g>v[s].endTime)return-1;for(var r=0,n=s;r<=n;){var u=Math.floor((n+r)/2);if(g<v[u].startTime)n=u-1;else if(g>v[u].startTime&&r<s)r=u+1;else return u}return v[r].startTime-g<g-v[n].startTime?r:n}function x(v,g,s){var r=[],n=S(v,g);if(n>-1)for(var u=n,l=v.length;u<l;u++){var e=v[u];if(e.startTime>=g&&e.endTime<=s)r.push(e);else if(e.startTime>s)return r}return r}},"./src/utils/time-ranges.ts":function(le,N,O){"use strict";O.r(N);var L={toString:function(A){for(var M="",C=A.length,S=0;S<C;S++)M+="["+A.start(S).toFixed(3)+","+A.end(S).toFixed(3)+"]";return M}};N.default=L},"./src/utils/timescale-conversion.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"toTimescaleFromBase",function(){return T}),O.d(N,"toTimescaleFromScale",function(){return A}),O.d(N,"toMsFromMpegTsClock",function(){return M}),O.d(N,"toMpegTsClockFromTimescale",function(){return C});var L=9e4;function T(S,x,v,g){v===void 0&&(v=1),g===void 0&&(g=!1);var s=S*x*v;return g?Math.round(s):s}function A(S,x,v,g){return v===void 0&&(v=1),g===void 0&&(g=!1),T(S,x,1/v,g)}function M(S,x){return x===void 0&&(x=!1),T(S,1e3,1/L,x)}function C(S,x){return x===void 0&&(x=1),T(S,L,1/x)}},"./src/utils/typed-array.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"sliceUint8",function(){return L});function L(T,A,M){return Uint8Array.prototype.slice?T.slice(A,M):new Uint8Array(Array.prototype.slice.call(T,A,M))}},"./src/utils/vttcue.ts":function(le,N,O){"use strict";O.r(N),N.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var L=["","lr","rl"],T=["start","middle","end","left","right"];function A(v,g){if(typeof g!="string")return!1;if(!Array.isArray(v))return!1;var s=g.toLowerCase();return~v.indexOf(s)?s:!1}function M(v){return A(L,v)}function C(v){return A(T,v)}function S(v){for(var g=arguments.length,s=new Array(g>1?g-1:0),r=1;r<g;r++)s[r-1]=arguments[r];for(var n=1;n<arguments.length;n++){var u=arguments[n];for(var l in u)v[l]=u[l]}return v}function x(v,g,s){var r=this,n={enumerable:!0};r.hasBeenReset=!1;var u="",l=!1,e=v,t=g,i=s,b=null,_="",p=!0,y="auto",m="start",f=50,d="middle",a=50,o="middle";Object.defineProperty(r,"id",S({},n,{get:function(){return u},set:function(h){u=""+h}})),Object.defineProperty(r,"pauseOnExit",S({},n,{get:function(){return l},set:function(h){l=!!h}})),Object.defineProperty(r,"startTime",S({},n,{get:function(){return e},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");e=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",S({},n,{get:function(){return t},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");t=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",S({},n,{get:function(){return i},set:function(h){i=""+h,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",S({},n,{get:function(){return b},set:function(h){b=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",S({},n,{get:function(){return _},set:function(h){var E=M(h);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",S({},n,{get:function(){return p},set:function(h){p=!!h,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",S({},n,{get:function(){return y},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",S({},n,{get:function(){return m},set:function(h){var E=C(h);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");m=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",S({},n,{get:function(){return f},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");f=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",S({},n,{get:function(){return d},set:function(h){var E=C(h);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");d=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",S({},n,{get:function(){return a},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");a=h,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",S({},n,{get:function(){return o},set:function(h){var E=C(h);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");o=E,this.hasBeenReset=!0}})),r.displayState=void 0}return x.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},x}()},"./src/utils/vttparser.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"parseTimeStamp",function(){return A}),O.d(N,"fixLineBreaks",function(){return g}),O.d(N,"VTTParser",function(){return s});var L=O("./src/utils/vttcue.ts"),T=function(){function r(){}var n=r.prototype;return n.decode=function(l,e){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},r}();function A(r){function n(l,e,t,i){return(l|0)*3600+(e|0)*60+(t|0)+parseFloat(i||0)}var u=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return u?parseFloat(u[2])>59?n(u[2],u[3],0,u[4]):n(u[1],u[2],u[3],u[4]):null}var M=function(){function r(){this.values=Object.create(null)}var n=r.prototype;return n.set=function(l,e){!this.get(l)&&e!==""&&(this.values[l]=e)},n.get=function(l,e,t){return t?this.has(l)?this.values[l]:e[t]:this.has(l)?this.values[l]:e},n.has=function(l){return l in this.values},n.alt=function(l,e,t){for(var i=0;i<t.length;++i)if(e===t[i]){this.set(l,e);break}},n.integer=function(l,e){/^-?\d+$/.test(e)&&this.set(l,parseInt(e,10))},n.percent=function(l,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var t=parseFloat(e);if(t>=0&&t<=100)return this.set(l,t),!0}return!1},r}();function C(r,n,u,l){var e=l?r.split(l):[r];for(var t in e){if(typeof e[t]!="string")continue;var i=e[t].split(u);if(i.length!==2)continue;var b=i[0],_=i[1];n(b,_)}}var S=new L.default(0,0,""),x=S.align==="middle"?"middle":"center";function v(r,n,u){var l=r;function e(){var b=A(r);if(b===null)throw new Error("Malformed timestamp: "+l);return r=r.replace(/^[^\sa-zA-Z-]+/,""),b}function t(b,_){var p=new M;C(b,function(f,d){var a;switch(f){case"region":for(var o=u.length-1;o>=0;o--)if(u[o].id===d){p.set(f,u[o].region);break}break;case"vertical":p.alt(f,d,["rl","lr"]);break;case"line":a=d.split(","),p.integer(f,a[0]),p.percent(f,a[0])&&p.set("snapToLines",!1),p.alt(f,a[0],["auto"]),a.length===2&&p.alt("lineAlign",a[1],["start",x,"end"]);break;case"position":a=d.split(","),p.percent(f,a[0]),a.length===2&&p.alt("positionAlign",a[1],["start",x,"end","line-left","line-right","auto"]);break;case"size":p.percent(f,d);break;case"align":p.alt(f,d,["start",x,"end","left","right"]);break}},/:/,/\s/),_.region=p.get("region",null),_.vertical=p.get("vertical","");var y=p.get("line","auto");y==="auto"&&S.line===-1&&(y=-1),_.line=y,_.lineAlign=p.get("lineAlign","start"),_.snapToLines=p.get("snapToLines",!0),_.size=p.get("size",100),_.align=p.get("align",x);var m=p.get("position","auto");m==="auto"&&S.position===50&&(m=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=m}function i(){r=r.replace(/^\s+/,"")}if(i(),n.startTime=e(),i(),r.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);r=r.substr(3),i(),n.endTime=e(),i(),t(r,n)}function g(r){return r.replace(/<br(?: \/)?>/gi,`
`)}var s=function(){function r(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var n=r.prototype;return n.parse=function(l){var e=this;l&&(e.buffer+=e.decoder.decode(l,{stream:!0}));function t(){var m=e.buffer,f=0;for(m=g(m);f<m.length&&m[f]!=="\r"&&m[f]!==`
`;)++f;var d=m.substr(0,f);return m[f]==="\r"&&++f,m[f]===`
`&&++f,e.buffer=m.substr(f),d}function i(m){C(m,function(f,d){},/:/)}try{var b="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;b=t();var _=b.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var p=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;p?p=!1:b=t();switch(e.state){case"HEADER":/:/.test(b)?i(b):b||(e.state="ID");continue;case"NOTE":b||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(b)){e.state="NOTE";break}if(!b)continue;if(e.cue=new L.default(0,0,""),e.state="CUE",b.indexOf("-->")===-1){e.cue.id=b;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{v(b,e.cue,e.regionList)}catch(m){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var y=b.indexOf("-->")!==-1;if(!b||y&&(p=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
`),e.cue.text+=b}continue;case"BADCUE":b||(e.state="ID")}}}catch(m){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},n.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){l.onparsingerror&&l.onparsingerror(e)}return l.onflush&&l.onflush(),this},r}()},"./src/utils/webvtt-parser.ts":function(le,N,O){"use strict";O.r(N),O.d(N,"generateCueId",function(){return s}),O.d(N,"parseWebVTT",function(){return n});var L=O("./src/polyfills/number.ts"),T=O("./src/utils/vttparser.ts"),A=O("./src/demux/id3.ts"),M=O("./src/utils/timescale-conversion.ts"),C=O("./src/remux/mp4-remuxer.ts"),S=/\r\n|\n\r|\n|\r/g,x=function(l,e,t){return t===void 0&&(t=0),l.substr(t,e.length)===e},v=function(l){var e=parseInt(l.substr(-3)),t=parseInt(l.substr(-6,2)),i=parseInt(l.substr(-9,2)),b=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(L.isFiniteNumber)(e)||!Object(L.isFiniteNumber)(t)||!Object(L.isFiniteNumber)(i)||!Object(L.isFiniteNumber)(b))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return e+=1e3*t,e+=60*1e3*i,e+=60*60*1e3*b,e},g=function(l){for(var e=5381,t=l.length;t;)e=e*33^l.charCodeAt(--t);return(e>>>0).toString()};function s(u,l,e){return g(u.toString())+g(l.toString())+g(e)}var r=function(l,e,t){var i=l[e],b=l[i.prevCC];if(!b||!b.new&&i.new){l.ccOffset=l.presentationOffset=i.start,i.new=!1;return}for(;(_=b)!==null&&_!==void 0&&_.new;){var _;l.ccOffset+=i.start-b.start,i.new=!1,i=b,b=l[i.prevCC]}l.presentationOffset=t};function n(u,l,e,t,i,b,_,p){var y=new T.VTTParser,m=Object(A.utf8ArrayToStr)(new Uint8Array(u)).trim().replace(S,`
`).split(`
`),f=[],d=Object(M.toMpegTsClockFromTimescale)(l,e),a="00:00.000",o=0,c=0,h,E=!0,R=!1;y.oncue=function(w){var P=t[i],D=t.ccOffset,U=(o-d)/9e4;if(P!=null&&P.new&&(c!==void 0?D=t.ccOffset=P.start:r(t,i,U)),U&&(D=U-t.presentationOffset),R){var I=w.endTime-w.startTime,k=Object(C.normalizePts)((w.startTime+D-c)*9e4,b*9e4)/9e4;w.startTime=k,w.endTime=k+I}var H=w.text.trim();w.text=decodeURIComponent(encodeURIComponent(H)),w.id||(w.id=s(w.startTime,w.endTime,H)),w.endTime>0&&f.push(w)},y.onparsingerror=function(w){h=w},y.onflush=function(){if(h){p(h);return}_(f)},m.forEach(function(w){if(E)if(x(w,"X-TIMESTAMP-MAP=")){E=!1,R=!0,w.substr(16).split(",").forEach(function(P){x(P,"LOCAL:")?a=P.substr(6):x(P,"MPEGTS:")&&(o=parseInt(P.substr(7)))});try{c=v(a)/1e3}catch(P){R=!1,h=P}return}else w===""&&(E=!1);y.parse(w+`
`)}),y.flush()}},"./src/utils/xhr-loader.ts":function(le,N,O){"use strict";O.r(N);var L=O("./src/utils/logger.ts"),T=O("./src/loader/load-stats.ts"),A=/^age:\s*[\d.]+\s*$/m,M=function(){function C(x){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=x?x.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var S=C.prototype;return S.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},S.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},S.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},S.load=function(v,g,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=g,this.callbacks=s,this.retryDelay=g.retryDelay,this.loadInternal()},S.loadInternal=function(){var v=this.config,g=this.context;if(!v)return;var s=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(s,g.url)}catch(e){s.open("GET",g.url,!0),n(s,g.url)}s.readyState||s.open("GET",g.url,!0);var u=this.context.headers;if(u)for(var l in u)s.setRequestHeader(l,u[l])}catch(e){this.callbacks.onError({code:s.status,text:e.message},g,s);return}g.rangeEnd&&s.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),s.onreadystatechange=this.readystatechange.bind(this),s.onprogress=this.loadprogress.bind(this),s.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),s.send()},S.readystatechange=function(){var v=this.context,g=this.loader,s=this.stats;if(!v||!g)return;var r=g.readyState,n=this.config;if(s.aborted)return;if(r>=2)if(self.clearTimeout(this.requestTimeout),s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start)),r===4){g.onreadystatechange=null,g.onprogress=null;var u=g.status;if(u>=200&&u<300){s.loading.end=Math.max(self.performance.now(),s.loading.first);var l,e;if(v.responseType==="arraybuffer"?(l=g.response,e=l.byteLength):(l=g.responseText,e=l.length),s.loaded=s.total=e,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(s,v,l,g),!this.callbacks)return;var i={url:g.responseURL,data:l};this.callbacks.onSuccess(i,s,v,g)}else s.retry>=n.maxRetry||u>=400&&u<499?(L.logger.error(u+" while loading "+v.url),this.callbacks.onError({code:u,text:g.statusText},v,g)):(L.logger.warn(u+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),s.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)},S.loadtimeout=function(){L.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},S.loadprogress=function(v){var g=this.stats;g.loaded=v.loaded,v.lengthComputable&&(g.total=v.total)},S.getCacheAge=function(){var v=null;if(this.loader&&A.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");v=g?parseFloat(g):null}return v},C}();N.default=M}}).default})},vHTk:function(ut,tt,te){ut.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);