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__Video__Detail__id.bfaec7...

117 lines
1.0 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[6444],{98280:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return qt}});function Z(G){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},Z(G)}function ae(G,J){if(Z(G)!="object"||!G)return G;var Y=G[Symbol.toPrimitive];if(Y!==void 0){var ve=Y.call(G,J||"default");if(Z(ve)!="object")return ve;throw new TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(G)}function Q(G){var J=ae(G,"string");return Z(J)=="symbol"?J:J+""}function K(G,J,Y){return(J=Q(J))in G?Object.defineProperty(G,J,{value:Y,enumerable:!0,configurable:!0,writable:!0}):G[J]=Y,G}function C(G,J){var Y=Object.keys(G);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(G);J&&(ve=ve.filter(function(Pe){return Object.getOwnPropertyDescriptor(G,Pe).enumerable})),Y.push.apply(Y,ve)}return Y}function k(G){for(var J=1;J<arguments.length;J++){var Y=arguments[J]!=null?arguments[J]:{};J%2?C(Object(Y),!0).forEach(function(ve){K(G,ve,Y[ve])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Y)):C(Object(Y)).forEach(function(ve){Object.defineProperty(G,ve,Object.getOwnPropertyDescriptor(Y,ve))})}return G}function O(G){if(Array.isArray(G))return G}function B(G,J){var Y=G==null?null:typeof Symbol!="undefined"&&G[Symbol.iterator]||G["@@iterator"];if(Y!=null){var ve,Pe,Ye,nt,xt=[],yt=!0,kt=!1;try{if(Ye=(Y=Y.call(G)).next,J===0){if(Object(Y)!==Y)return;yt=!1}else for(;!(yt=(ve=Ye.call(Y)).done)&&(xt.push(ve.value),xt.length!==J);yt=!0);}catch(pt){kt=!0,Pe=pt}finally{try{if(!yt&&Y.return!=null&&(nt=Y.return(),Object(nt)!==nt))return}finally{if(kt)throw Pe}}return xt}}function e(G,J){(J==null||J>G.length)&&(J=G.length);for(var Y=0,ve=Array(J);Y<J;Y++)ve[Y]=G[Y];return ve}function I(G,J){if(G){if(typeof G=="string")return e(G,J);var Y={}.toString.call(G).slice(8,-1);return Y==="Object"&&G.constructor&&(Y=G.constructor.name),Y==="Map"||Y==="Set"?Array.from(G):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(G,J):void 0}}function w(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(G,J){return O(G)||B(G,J)||I(G,J)||w()}function p(G,J){if(G==null)return{};var Y={};for(var ve in G)if({}.hasOwnProperty.call(G,ve)){if(J.indexOf(ve)!==-1)continue;Y[ve]=G[ve]}return Y}function c(G,J){if(G==null)return{};var Y,ve,Pe=p(G,J);if(Object.getOwnPropertySymbols){var Ye=Object.getOwnPropertySymbols(G);for(ve=0;ve<Ye.length;ve++)Y=Ye[ve],J.indexOf(Y)===-1&&{}.propertyIsEnumerable.call(G,Y)&&(Pe[Y]=G[Y])}return Pe}function m(G){if(Array.isArray(G))return G}function l(G,J){var Y=G==null?null:typeof Symbol!="undefined"&&G[Symbol.iterator]||G["@@iterator"];if(Y!=null){var ve,Pe,Ye,nt,xt=[],yt=!0,kt=!1;try{if(Ye=(Y=Y.call(G)).next,J===0){if(Object(Y)!==Y)return;yt=!1}else for(;!(yt=(ve=Ye.call(Y)).done)&&(xt.push(ve.value),xt.length!==J);yt=!0);}catch(pt){kt=!0,Pe=pt}finally{try{if(!yt&&Y.return!=null&&(nt=Y.return(),Object(nt)!==nt))return}finally{if(kt)throw Pe}}return xt}}function g(G,J){(J==null||J>G.length)&&(J=G.length);for(var Y=0,ve=new Array(J);Y<J;Y++)ve[Y]=G[Y];return ve}function _(G,J){if(G){if(typeof G=="string")return g(G,J);var Y=Object.prototype.toString.call(G).slice(8,-1);if(Y==="Object"&&G.constructor&&(Y=G.constructor.name),Y==="Map"||Y==="Set")return Array.from(G);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return g(G,J)}}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(G,J){return m(G)||l(G,J)||_(G,J)||o()}var n=j(67294),r=j.t(n,2),v=j(73935);function E(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var f={};function S(G,J){}function L(G,J){}function A(){f={}}function D(G,J,Y){!J&&!f[Y]&&(G(!1,Y),f[Y]=!0)}function a(G,J){D(S,G,J)}function i(G,J){D(L,G,J)}var t=null;function h(G){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},h(G)}var b=j(81640);function T(G,J,Y){var ve=n.useRef({});return(!("value"in ve.current)||Y(ve.current.condition,J))&&(ve.current.value=G(),ve.current.condition=J),ve.current.value}function y(G,J){typeof G=="function"?G(J):h(G)==="object"&&G&&"current"in G&&(G.current=J)}function d(){for(var G=arguments.length,J=new Array(G),Y=0;Y<G;Y++)J[Y]=arguments[Y];var ve=J.filter(function(Pe){return Pe});return ve.length<=1?ve[0]:function(Pe){J.forEach(function(Ye){y(Ye,Pe)})}}function R(){for(var G=arguments.length,J=new Array(G),Y=0;Y<G;Y++)J[Y]=arguments[Y];return T(function(){return d.apply(void 0,J)},J,function(ve,Pe){return ve.length===Pe.length&&ve.every(function(Ye,nt){return Ye===Pe[nt]})})}function M(G){var J,Y,ve=(0,b.isMemo)(G)?G.type.type:G.type;return!(typeof ve=="function"&&!((J=ve.prototype)!==null&&J!==void 0&&J.render)||typeof G=="function"&&!((Y=G.prototype)!==null&&Y!==void 0&&Y.render))}var F=n.createContext(null),U=F;function V(G){if(Array.isArray(G))return g(G)}function re(G){if(typeof Symbol!="undefined"&&G[Symbol.iterator]!=null||G["@@iterator"]!=null)return Array.from(G)}function $(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(G){return V(G)||re(G)||_(G)||$()}var te=E()?n.useLayoutEffect:n.useEffect,_e=te,fe=function(J,Y){var ve=React.useRef(!0);te(function(){if(!ve.current)return J()},Y),te(function(){return ve.current=!1,function(){ve.current=!0}},[])},me=[];function Ae(G,J){var Y=n.useState(function(){if(!E())return null;var Ut=document.createElement("div");return Ut}),ve=s(Y,1),Pe=ve[0],Ye=n.useRef(!1),nt=n.useContext(U),xt=n.useState(me),yt=s(xt,2),kt=yt[0],pt=yt[1],vt=nt||(Ye.current?void 0:function(Ut){pt(function(tr){var Ht=[Ut].concat(le(tr));return Ht})});function At(){Pe.parentElement||document.body.appendChild(Pe),Ye.current=!0}function Dt(){var Ut;(Ut=Pe.parentElement)===null||Ut===void 0||Ut.removeChild(Pe),Ye.current=!1}return _e(function(){return G?nt?nt(At):At():Dt(),Dt},[G]),_e(function(){kt.length&&(kt.forEach(function(Ut){return Ut()}),pt(me))},[kt]),[Pe,vt]}function Be(G,J){if(!G)return!1;if(G.contains)return G.contains(J);for(var Y=J;Y;){if(Y===G)return!0;Y=Y.parentNode}return!1}var Le="data-rc-order",Ie="rc-util-key",pe=new Map;function Ke(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=G.mark;return J?J.startsWith("data-")?J:"data-".concat(J):Ie}function Ce(G){if(G.attachTo)return G.attachTo;var J=document.querySelector("head");return J||document.body}function ie(G){return G==="queue"?"prependQueue":G?"prepend":"append"}function X(G){return Array.from((pe.get(G)||G).children).filter(function(J){return J.tagName==="STYLE"})}function q(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!E())return null;var Y=J.csp,ve=J.prepend,Pe=document.createElement("style");Pe.setAttribute(Le,ie(ve)),Y!=null&&Y.nonce&&(Pe.nonce=Y==null?void 0:Y.nonce),Pe.innerHTML=G;var Ye=Ce(J),nt=Ye.firstChild;if(ve){if(ve==="queue"){var xt=X(Ye).filter(function(yt){return["prepend","prependQueue"].includes(yt.getAttribute(Le))});if(xt.length)return Ye.insertBefore(Pe,xt[xt.length-1].nextSibling),Pe}Ye.insertBefore(Pe,nt)}else Ye.appendChild(Pe);return Pe}function ue(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=Ce(J);return X(Y).find(function(ve){return ve.getAttribute(Ke(J))===G})}function ee(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=ue(G,J);if(Y){var ve=Ce(J);ve.removeChild(Y)}}function z(G,J){var Y=pe.get(G);if(!Y||!Be(document,Y)){var ve=q("",J),Pe=ve.parentNode;pe.set(G,Pe),G.removeChild(ve)}}function ne(){pe.clear()}function ce(G,J){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ve=Ce(Y);z(ve,Y);var Pe=ue(J,Y);if(Pe){var Ye,nt;if((Ye=Y.csp)!==null&&Ye!==void 0&&Ye.nonce&&Pe.nonce!==((nt=Y.csp)===null||nt===void 0?void 0:nt.nonce)){var xt;Pe.nonce=(xt=Y.csp)===null||xt===void 0?void 0:xt.nonce}return Pe.innerHTML!==G&&(Pe.innerHTML=G),Pe}var yt=q(G,Y);return yt.setAttribute(Ke(Y),J),yt}var ge;function ke(G){if(typeof document=="undefined")return 0;if(G||ge===void 0){var J=document.createElement("div");J.style.width="100%",J.style.height="200px";var Y=document.createElement("div"),ve=Y.style;ve.position="absolute",ve.top="0",ve.left="0",ve.pointerEvents="none",ve.visibility="hidden",ve.width="200px",ve.height="150px",ve.overflow="hidden",Y.appendChild(J),document.body.appendChild(Y);var Pe=J.offsetWidth;Y.style.overflow="scroll";var Ye=J.offsetWidth;Pe===Ye&&(Ye=Y.clientWidth),document.body.removeChild(Y),ge=Pe-Ye}return ge}function $e(G){var J=G.match(/^(.*)px$/),Y=Number(J==null?void 0:J[1]);return Number.isNaN(Y)?ke():Y}function ft(G){if(typeof document=="undefined"||!G||!(G instanceof Element))return{width:0,height:0};var J=getComputedStyle(G,"::-webkit-scrollbar"),Y=J.width,ve=J.height;return{width:$e(Y),height:$e(ve)}}function Ne(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Re="rc-util-locker-".concat(Date.now()),xe=0;function Ue(G){var J=!!G,Y=n.useState(function(){return xe+=1,"".concat(Re,"_").concat(xe)}),ve=s(Y,1),Pe=ve[0];_e(function(){if(J){var Ye=ft(document.body).width,nt=Ne();ce(`
html body {
overflow-y: hidden;
`.concat(nt?"width: calc(100% - ".concat(Ye,"px);"):"",`
}`),Pe)}else ee(Pe);return function(){ee(Pe)}},[J,Pe])}var ye=!1;function it(G){return typeof G=="boolean"&&(ye=G),ye}var rt=function(J){return J===!1?!1:!E()||!J?null:typeof J=="string"?document.querySelector(J):typeof J=="function"?J():J},tt=n.forwardRef(function(G,J){var Y=G.open,ve=G.autoLock,Pe=G.getContainer,Ye=G.debug,nt=G.autoDestroy,xt=nt===void 0?!0:nt,yt=G.children,kt=n.useState(Y),pt=s(kt,2),vt=pt[0],At=pt[1],Dt=vt||Y;n.useEffect(function(){(xt||Y)&&At(Y)},[Y,xt]);var Ut=n.useState(function(){return rt(Pe)}),tr=s(Ut,2),Ht=tr[0],or=tr[1];n.useEffect(function(){var Wr=rt(Pe);or(Wr!=null?Wr:null)});var er=Ae(Dt&&!Ht,Ye),Xt=s(er,2),lr=Xt[0],cr=Xt[1],jt=Ht!=null?Ht:lr;Ue(ve&&Y&&E()&&(jt===lr||jt===document.body));var Ir=null;if(yt&&M(yt)&&J){var Er=yt;Ir=Er.ref}var Dr=R(Ir,J);if(!Dt||!E()||Ht===void 0)return null;var Jr=jt===!1||it(),Pr=yt;return J&&(Pr=n.cloneElement(yt,{ref:Dr})),n.createElement(U.Provider,{value:cr},Jr?Pr:(0,v.createPortal)(Pr,jt))}),We=tt,ot=We,_t=j(94184),St=j.n(_t),gt=j(48555);function wt(G){return G instanceof HTMLElement||G instanceof SVGElement}function mt(G){return G&&_typeof(G)==="object"&&wt(G.nativeElement)?G.nativeElement:wt(G)?G:null}function Ct(G){var J=mt(G);if(J)return J;if(G instanceof React.Component){var Y;return(Y=ReactDOM.findDOMNode)===null||Y===void 0?void 0:Y.call(ReactDOM,G)}return null}function Ge(G){var J;return G==null||(J=G.getRootNode)===null||J===void 0?void 0:J.call(G)}function he(G){return Ge(G)instanceof ShadowRoot}function De(G){return he(G)?Ge(G):null}function be(G){var J=n.useRef();J.current=G;var Y=n.useCallback(function(){for(var ve,Pe=arguments.length,Ye=new Array(Pe),nt=0;nt<Pe;nt++)Ye[nt]=arguments[nt];return(ve=J.current)===null||ve===void 0?void 0:ve.call.apply(ve,[J].concat(Ye))},[]);return Y}function Ee(G){if(Array.isArray(G))return G}function je(G,J){var Y=G==null?null:typeof Symbol!="undefined"&&G[Symbol.iterator]||G["@@iterator"];if(Y!=null){var ve,Pe,Ye,nt,xt=[],yt=!0,kt=!1;try{if(Ye=(Y=Y.call(G)).next,J===0){if(Object(Y)!==Y)return;yt=!1}else for(;!(yt=(ve=Ye.call(Y)).done)&&(xt.push(ve.value),xt.length!==J);yt=!0);}catch(pt){kt=!0,Pe=pt}finally{try{if(!yt&&Y.return!=null&&(nt=Y.return(),Object(nt)!==nt))return}finally{if(kt)throw Pe}}return xt}}function Je(G,J){(J==null||J>G.length)&&(J=G.length);for(var Y=0,ve=new Array(J);Y<J;Y++)ve[Y]=G[Y];return ve}function Qe(G,J){if(G){if(typeof G=="string")return Je(G,J);var Y=Object.prototype.toString.call(G).slice(8,-1);if(Y==="Object"&&G.constructor&&(Y=G.constructor.name),Y==="Map"||Y==="Set")return Array.from(G);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return Je(G,J)}}function Xe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(G,J){return Ee(G)||je(G,J)||Qe(G,J)||Xe()}function Se(G){"@babel/helpers - typeof";return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},Se(G)}function x(G,J){if(Se(G)!=="object"||G===null)return G;var Y=G[Symbol.toPrimitive];if(Y!==void 0){var ve=Y.call(G,J||"default");if(Se(ve)!=="object")return ve;throw new TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(G)}function P(G){var J=x(G,"string");return Se(J)==="symbol"?J:String(J)}function N(G,J,Y){return J=P(J),J in G?Object.defineProperty(G,J,{value:Y,enumerable:!0,configurable:!0,writable:!0}):G[J]=Y,G}function W(G,J){var Y=Object.keys(G);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(G);J&&(ve=ve.filter(function(Pe){return Object.getOwnPropertyDescriptor(G,Pe).enumerable})),Y.push.apply(Y,ve)}return Y}function H(G){for(var J=1;J<arguments.length;J++){var Y=arguments[J]!=null?arguments[J]:{};J%2?W(Object(Y),!0).forEach(function(ve){N(G,ve,Y[ve])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(Y)):W(Object(Y)).forEach(function(ve){Object.defineProperty(G,ve,Object.getOwnPropertyDescriptor(Y,ve))})}return G}function oe(){var G=H({},r);return G.useId}var se=0;function Te(){}var we=oe(),Ze=we?function(J){var Y=we();return J||Y}:function(J){var Y=n.useState("ssr-id"),ve=He(Y,2),Pe=ve[0],Ye=ve[1];return n.useEffect(function(){var nt=se;se+=1,Ye("rc_unique_".concat(nt))},[]),J||Pe};function dt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Tt=dt()?n.useLayoutEffect:n.useEffect,ct=function(J,Y){var ve=n.useRef(!0);Tt(function(){return J(ve.current)},Y),Tt(function(){return ve.current=!1,function(){ve.current=!0}},[])},Rt=function(J,Y){ct(function(ve){if(!ve)return J()},Y)},at=ct,ze=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))};function st(){return st=Object.assign?Object.assign.bind():function(G){for(var J=1;J<arguments.length;J++){var Y=arguments[J];for(var ve in Y)({}).hasOwnProperty.call(Y,ve)&&(G[ve]=Y[ve])}return G},st.apply(null,arguments)}var lt=j(62874),bt=j(52481);function Ot(G,J,Y){var ve=n.useRef({});return(!("value"in ve.current)||Y(ve.current.condition,J))&&(ve.current.value=G(),ve.current.condition=J),ve.current.value}var Nt=Symbol.for("react.element"),It=Symbol.for("react.transitional.element"),ht=Symbol.for("react.fragment");function Bt(G){return G&&Se(G)==="object"&&(G.$$typeof===Nt||G.$$typeof===It)&&G.type===ht}var Pt=Number(n.version.split(".")[0]),Kt=function(J,Y){typeof J=="function"?J(Y):Se(J)==="object"&&J&&"current"in J&&(J.current=Y)},Wt=function(){for(var J=arguments.length,Y=new Array(J),ve=0;ve<J;ve++)Y[ve]=arguments[ve];var Pe=Y.filter(Boolean);return Pe.length<=1?Pe[0]:function(Ye){Y.forEach(function(nt){Kt(nt,Ye)})}},$t=function(){for(var J=arguments.length,Y=new Array(J),ve=0;ve<J;ve++)Y[ve]=arguments[ve];return Ot(function(){return Wt.apply(void 0,Y)},Y,function(Pe,Ye){return Pe.length!==Ye.length||Pe.every(function(nt,xt){return nt!==Ye[xt]})})},ir=function(J){var Y,ve;if(!J)return!1;if(ar(J)&&Pt>=19)return!0;var Pe=(0,bt.isMemo)(J)?J.type.type:J.type;return!(typeof Pe=="function"&&!((Y=Pe.prototype)!==null&&Y!==void 0&&Y.render)&&Pe.$$typeof!==bt.ForwardRef||typeof J=="function"&&!((ve=J.prototype)!==null&&ve!==void 0&&ve.render)&&J.$$typeof!==bt.ForwardRef)};function ar(G){return(0,n.isValidElement)(G)&&!Bt(G)}var hn=function(J){return ar(J)&&ir(J)},dn=function(J){if(J&&ar(J)){var Y=J;return Y.props.propertyIsEnumerable("ref")?Y.props.ref:Y.ref}return null};function vr(G){var J=G.prefixCls,Y=G.align,ve=G.arrow,Pe=G.arrowPos,Ye=ve||{},nt=Ye.className,xt=Ye.content,yt=Pe.x,kt=yt===void 0?0:yt,pt=Pe.y,vt=pt===void 0?0:pt,At=n.useRef();if(!Y||!Y.points)return null;var Dt={position:"absolute"};if(Y.autoArrow!==!1){var Ut=Y.points[0],tr=Y.points[1],Ht=Ut[0],or=Ut[1],er=tr[0],Xt=tr[1];Ht===er||!["t","b"].includes(Ht)?Dt.top=vt:Ht==="t"?Dt.top=0:Dt.bottom=0,or===Xt||!["l","r"].includes(or)?Dt.left=kt:or==="l"?Dt.left=0:Dt.right=0}return n.createElement("div",{ref:At,className:St()("".concat(J,"-arrow"),nt),style:Dt},xt)}function gn(G){var J=G.prefixCls,Y=G.open,ve=G.zIndex,Pe=G.mask,Ye=G.motion;return Pe?n.createElement(lt.Z,st({},Ye,{motionAppear:!0,visible:Y,removeOnLeave:!0}),function(nt){var xt=nt.className;return n.createElement("div",{style:{zIndex:ve},className:St()("".concat(J,"-mask"),xt)})}):null}var Rr=n.memo(function(G){var J=G.children;return J},function(G,J){return J.cache}),gr=Rr,yr=n.forwardRef(function(G,J){var Y=G.popup,ve=G.className,Pe=G.prefixCls,Ye=G.style,nt=G.target,xt=G.onVisibleChanged,yt=G.open,kt=G.keepDom,pt=G.fresh,vt=G.onClick,At=G.mask,Dt=G.arrow,Ut=G.arrowPos,tr=G.align,Ht=G.motion,or=G.maskMotion,er=G.forceRender,Xt=G.getPopupContainer,lr=G.autoDestroy,cr=G.portal,jt=G.zIndex,Ir=G.onMouseEnter,Er=G.onMouseLeave,Dr=G.onPointerEnter,Jr=G.onPointerDownCapture,Pr=G.ready,Wr=G.offsetX,br=G.offsetY,Mr=G.offsetR,jr=G.offsetB,Xr=G.onAlign,on=G.onPrepare,xr=G.stretch,kr=G.targetWidth,nr=G.targetHeight,ln=typeof Y=="function"?Y():Y,tn=yt||kt,Nr=(Xt==null?void 0:Xt.length)>0,ur=n.useState(!Xt||!Nr),rn=u(ur,2),xn=rn[0],Rn=rn[1];if(at(function(){!xn&&Nr&&nt&&Rn(!0)},[xn,Nr,nt]),!xn)return null;var Fr="auto",Ar={left:"-1000vw",top:"-1000vh",right:Fr,bottom:Fr};if(Pr||!yt){var An,Dn=tr.points,Cr=tr.dynamicInset||((An=tr._experimental)===null||An===void 0?void 0:An.dynamicInset),qr=Cr&&Dn[0][1]==="r",Gr=Cr&&Dn[0][0]==="b";qr?(Ar.right=Mr,Ar.left=Fr):(Ar.left=Wr,Ar.right=Fr),Gr?(Ar.bottom=jr,Ar.top=Fr):(Ar.top=br,Ar.bottom=Fr)}var Br={};return xr&&(xr.includes("height")&&nr?Br.height=nr:xr.includes("minHeight")&&nr&&(Br.minHeight=nr),xr.includes("width")&&kr?Br.width=kr:xr.includes("minWidth")&&kr&&(Br.minWidth=kr)),yt||(Br.pointerEvents="none"),n.createElement(cr,{open:er||tn,getContainer:Xt&&function(){return Xt(nt)},autoDestroy:lr},n.createElement(gn,{prefixCls:Pe,open:yt,zIndex:jt,mask:At,motion:or}),n.createElement(gt.Z,{onResize:Xr,disabled:!yt},function(un){return n.createElement(lt.Z,st({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:er,leavedClassName:"".concat(Pe,"-hidden")},Ht,{onAppearPrepare:on,onEnterPrepare:on,visible:yt,onVisibleChanged:function(Zr){var mr;Ht==null||(mr=Ht.onVisibleChanged)===null||mr===void 0||mr.call(Ht,Zr),xt(Zr)}}),function(En,Zr){var mr=En.className,zr=En.style,Vr=St()(Pe,mr,ve);return n.createElement("div",{ref:Wt(un,J,Zr),className:Vr,style:k(k(k(k({"--arrow-x":"".concat(Ut.x||0,"px"),"--arrow-y":"".concat(Ut.y||0,"px")},Ar),Br),zr),{},{boxSizing:"border-box",zIndex:jt},Ye),onMouseEnter:Ir,onMouseLeave:Er,onPointerEnter:Dr,onClick:vt,onPointerDownCapture:Jr},Dt&&n.createElement(vr,{prefixCls:Pe,arrow:Dt,arrowPos:Ut,align:tr}),n.createElement(gr,{cache:!yt&&!pt},ln))})}))}),vn=yr,Kr=n.forwardRef(function(G,J){var Y=G.children,ve=G.getTriggerDOMNode,Pe=ir(Y),Ye=n.useCallback(function(xt){Kt(J,ve?ve(xt):xt)},[ve]),nt=$t(Ye,dn(Y));return Pe?n.cloneElement(Y,{ref:nt}):Y}),$r=Kr,Cn=n.createContext(null),ii=Cn;function $n(G){return G?Array.isArray(G)?G:[G]:[]}function ai(G,J,Y,ve){return n.useMemo(function(){var Pe=$n(Y!=null?Y:J),Ye=$n(ve!=null?ve:J),nt=new Set(Pe),xt=new Set(Ye);return G&&(nt.has("hover")&&(nt.delete("hover"),nt.add("click")),xt.has("hover")&&(xt.delete("hover"),xt.add("click"))),[nt,xt]},[G,J,Y,ve])}var gi=function(G){if(!G)return!1;if(G instanceof Element){if(G.offsetParent)return!0;if(G.getBBox){var J=G.getBBox(),Y=J.width,ve=J.height;if(Y||ve)return!0}if(G.getBoundingClientRect){var Pe=G.getBoundingClientRect(),Ye=Pe.width,nt=Pe.height;if(Ye||nt)return!0}}return!1};function On(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Y=arguments.length>2?arguments[2]:void 0;return Y?G[0]===J[0]:G[0]===J[0]&&G[1]===J[1]}function yi(G,J,Y,ve){for(var Pe=Y.points,Ye=Object.keys(G),nt=0;nt<Ye.length;nt+=1){var xt,yt=Ye[nt];if(On((xt=G[yt])===null||xt===void 0?void 0:xt.points,Pe,ve))return"".concat(J,"-placement-").concat(yt)}return""}function Fn(G,J,Y,ve){return J||(Y?{motionName:"".concat(G,"-").concat(Y)}:ve?{motionName:ve}:null)}function Sn(G){return G.ownerDocument.defaultView}function Xn(G){for(var J=[],Y=G==null?void 0:G.parentElement,ve=["hidden","scroll","clip","auto"];Y;){var Pe=Sn(Y).getComputedStyle(Y),Ye=Pe.overflowX,nt=Pe.overflowY,xt=Pe.overflow;[Ye,nt,xt].some(function(yt){return ve.includes(yt)})&&J.push(Y),Y=Y.parentElement}return J}function Tn(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(G)?J:G}function sn(G){return Tn(parseFloat(G),0)}function yn(G,J){var Y=k({},G);return(J||[]).forEach(function(ve){if(!(ve instanceof HTMLBodyElement||ve instanceof HTMLHtmlElement)){var Pe=Sn(ve).getComputedStyle(ve),Ye=Pe.overflow,nt=Pe.overflowClipMargin,xt=Pe.borderTopWidth,yt=Pe.borderBottomWidth,kt=Pe.borderLeftWidth,pt=Pe.borderRightWidth,vt=ve.getBoundingClientRect(),At=ve.offsetHeight,Dt=ve.clientHeight,Ut=ve.offsetWidth,tr=ve.clientWidth,Ht=sn(xt),or=sn(yt),er=sn(kt),Xt=sn(pt),lr=Tn(Math.round(vt.width/Ut*1e3)/1e3),cr=Tn(Math.round(vt.height/At*1e3)/1e3),jt=(Ut-tr-er-Xt)*lr,Ir=(At-Dt-Ht-or)*cr,Er=Ht*cr,Dr=or*cr,Jr=er*lr,Pr=Xt*lr,Wr=0,br=0;if(Ye==="clip"){var Mr=sn(nt);Wr=Mr*lr,br=Mr*cr}var jr=vt.x+Jr-Wr,Xr=vt.y+Er-br,on=jr+vt.width+2*Wr-Jr-Pr-jt,xr=Xr+vt.height+2*br-Er-Dr-Ir;Y.left=Math.max(Y.left,jr),Y.top=Math.max(Y.top,Xr),Y.right=Math.min(Y.right,on),Y.bottom=Math.min(Y.bottom,xr)}}),Y}function Bn(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Y="".concat(J),ve=Y.match(/^(.*)\%$/);return ve?G*(parseFloat(ve[1])/100):parseFloat(Y)}function fi(G,J){var Y=J||[],ve=u(Y,2),Pe=ve[0],Ye=ve[1];return[Bn(G.width,Pe),Bn(G.height,Ye)]}function Ri(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[G[0],G[1]]}function pn(G,J){var Y=J[0],ve=J[1],Pe,Ye;return Y==="t"?Ye=G.y:Y==="b"?Ye=G.y+G.height:Ye=G.y+G.height/2,ve==="l"?Pe=G.x:ve==="r"?Pe=G.x+G.width:Pe=G.x+G.width/2,{x:Pe,y:Ye}}function en(G,J){var Y={t:"b",b:"t",l:"r",r:"l"};return G.map(function(ve,Pe){return Pe===J?Y[ve]||"c":ve}).join("")}function Ni(G,J,Y,ve,Pe,Ye,nt){var xt=n.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Pe[ve]||{}}),yt=u(xt,2),kt=yt[0],pt=yt[1],vt=n.useRef(0),At=n.useMemo(function(){return J?Xn(J):[]},[J]),Dt=n.useRef({}),Ut=function(){Dt.current={}};G||Ut();var tr=be(function(){if(J&&Y&&G){let Gn=function(ki,mi){var _i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Un,ji=ur.x+ki,zi=ur.y+mi,sa=ji+qr,oa=zi+Cr,la=Math.max(ji,_i.left),Mt=Math.max(zi,_i.top),Zt=Math.min(sa,_i.right),Ur=Math.min(oa,_i.bottom);return Math.max(0,(Zt-la)*(Ur-Mt))},Zi=function(){ei=ur.y+Tr,jn=ei+Cr,zn=ur.x+Sr,vi=zn+qr};var er,Xt,lr,cr,jt=J,Ir=jt.ownerDocument,Er=Sn(jt),Dr=Er.getComputedStyle(jt),Jr=Dr.width,Pr=Dr.height,Wr=Dr.position,br=jt.style.left,Mr=jt.style.top,jr=jt.style.right,Xr=jt.style.bottom,on=jt.style.overflow,xr=k(k({},Pe[ve]),Ye),kr=Ir.createElement("div");(er=jt.parentElement)===null||er===void 0||er.appendChild(kr),kr.style.left="".concat(jt.offsetLeft,"px"),kr.style.top="".concat(jt.offsetTop,"px"),kr.style.position=Wr,kr.style.height="".concat(jt.offsetHeight,"px"),kr.style.width="".concat(jt.offsetWidth,"px"),jt.style.left="0",jt.style.top="0",jt.style.right="auto",jt.style.bottom="auto",jt.style.overflow="hidden";var nr;if(Array.isArray(Y))nr={x:Y[0],y:Y[1],width:0,height:0};else{var ln,tn,Nr=Y.getBoundingClientRect();Nr.x=(ln=Nr.x)!==null&&ln!==void 0?ln:Nr.left,Nr.y=(tn=Nr.y)!==null&&tn!==void 0?tn:Nr.top,nr={x:Nr.x,y:Nr.y,width:Nr.width,height:Nr.height}}var ur=jt.getBoundingClientRect();ur.x=(Xt=ur.x)!==null&&Xt!==void 0?Xt:ur.left,ur.y=(lr=ur.y)!==null&&lr!==void 0?lr:ur.top;var rn=Ir.documentElement,xn=rn.clientWidth,Rn=rn.clientHeight,Fr=rn.scrollWidth,Ar=rn.scrollHeight,An=rn.scrollTop,Dn=rn.scrollLeft,Cr=ur.height,qr=ur.width,Gr=nr.height,Br=nr.width,un={left:0,top:0,right:xn,bottom:Rn},En={left:-Dn,top:-An,right:Fr-Dn,bottom:Ar-An},Zr=xr.htmlRegion,mr="visible",zr="visibleFirst";Zr!=="scroll"&&Zr!==zr&&(Zr=mr);var Vr=Zr===zr,ci=yn(En,At),pr=yn(un,At),Un=Zr===mr?pr:ci,Vn=Vr?pr:Un;jt.style.left="auto",jt.style.top="auto",jt.style.right="0",jt.style.bottom="0";var Hr=jt.getBoundingClientRect();jt.style.left=br,jt.style.top=Mr,jt.style.right=jr,jt.style.bottom=Xr,jt.style.overflow=on,(cr=jt.parentElement)===null||cr===void 0||cr.removeChild(kr);var In=Tn(Math.round(qr/parseFloat(Jr)*1e3)/1e3),bn=Tn(Math.round(Cr/parseFloat(Pr)*1e3)/1e3);if(In===0||bn===0||wt(Y)&&!gi(Y))return;var Kn=xr.offset,Yt=xr.targetOffset,rr=fi(ur,Kn),dr=u(rr,2),Or=dr[0],wr=dr[1],Fi=fi(nr,Yt),oi=u(Fi,2),wn=oi[0],Qn=oi[1];nr.x-=wn,nr.y-=Qn;var Bi=xr.points||[],Li=u(Bi,2),Ci=Li[0],hi=Li[1],Wn=Ri(hi),mn=Ri(Ci),Pn=pn(nr,Wn),fn=pn(ur,mn),Hn=k({},xr),Sr=Pn.x-fn.x+Or,Tr=Pn.y-fn.y+wr,Mn=Gn(Sr,Tr),Jn=Gn(Sr,Tr,pr),Ei=pn(nr,["t","l"]),Ln=pn(ur,["t","l"]),Oi=pn(nr,["b","r"]),bi=pn(ur,["b","r"]),Zn=xr.overflow||{},qn=Zn.adjustX,Si=Zn.adjustY,Ti=Zn.shiftX,di=Zn.shiftY,xi=function(mi){return typeof mi=="boolean"?mi:mi>=0},ei,jn,zn,vi;Zi();var li=xi(Si),Ai=mn[0]===Wn[0];if(li&&mn[0]==="t"&&(jn>Vn.bottom||Dt.current.bt)){var nn=Tr;Ai?nn-=Cr-Gr:nn=Ei.y-bi.y-wr;var Ii=Gn(Sr,nn),Ui=Gn(Sr,nn,pr);Ii>Mn||Ii===Mn&&(!Vr||Ui>=Jn)?(Dt.current.bt=!0,Tr=nn,wr=-wr,Hn.points=[en(mn,0),en(Wn,0)]):Dt.current.bt=!1}if(li&&mn[0]==="b"&&(ei<Vn.top||Dt.current.tb)){var ui=Tr;Ai?ui+=Cr-Gr:ui=Oi.y-Ln.y-wr;var Pi=Gn(Sr,ui),Lr=Gn(Sr,ui,pr);Pi>Mn||Pi===Mn&&(!Vr||Lr>=Jn)?(Dt.current.tb=!0,Tr=ui,wr=-wr,Hn.points=[en(mn,0),en(Wn,0)]):Dt.current.tb=!1}var hr=xi(qn),_r=mn[1]===Wn[1];if(hr&&mn[1]==="l"&&(vi>Vn.right||Dt.current.rl)){var Qr=Sr;_r?Qr-=qr-Br:Qr=Ei.x-bi.x-Or;var cn=Gn(Qr,Tr),Yn=Gn(Qr,Tr,pr);cn>Mn||cn===Mn&&(!Vr||Yn>=Jn)?(Dt.current.rl=!0,Sr=Qr,Or=-Or,Hn.points=[en(mn,1),en(Wn,1)]):Dt.current.rl=!1}if(hr&&mn[1]==="r"&&(zn<Vn.left||Dt.current.lr)){var kn=Sr;_r?kn+=qr-Br:kn=Oi.x-Ln.x-Or;var Mi=Gn(kn,Tr),wi=Gn(kn,Tr,pr);Mi>Mn||Mi===Mn&&(!Vr||wi>=Jn)?(Dt.current.lr=!0,Sr=kn,Or=-Or,Hn.points=[en(mn,1),en(Wn,1)]):Dt.current.lr=!1}Zi();var Nn=Ti===!0?0:Ti;typeof Nn=="number"&&(zn<pr.left&&(Sr-=zn-pr.left-Or,nr.x+Br<pr.left+Nn&&(Sr+=nr.x-pr.left+Br-Nn)),vi>pr.right&&(Sr-=vi-pr.right-Or,nr.x>pr.right-Nn&&(Sr+=nr.x-pr.right+Nn)));var _n=di===!0?0:di;typeof _n=="number"&&(ei<pr.top&&(Tr-=ei-pr.top-wr,nr.y+Gr<pr.top+_n&&(Tr+=nr.y-pr.top+Gr-_n)),jn>pr.bottom&&(Tr-=jn-pr.bottom-wr,nr.y>pr.bottom-_n&&(Tr+=nr.y-pr.bottom+_n)));var ti=ur.x+Sr,pi=ti+qr,ri=ur.y+Tr,Xi=ri+Cr,Gi=nr.x,Qi=Gi+Br,Ki=nr.y,Ji=Ki+Gr,qi=Math.max(ti,Gi),ea=Math.min(pi,Qi),Vi=(qi+ea)/2,ta=Vi-ti,ra=Math.max(ri,Ki),Hi=Math.min(Xi,Ji),na=(ra+Hi)/2,ia=na-ri;nt==null||nt(J,Hn);var Wi=Hr.right-ur.x-(Sr+ur.width),ni=Hr.bottom-ur.y-(Tr+ur.height);In===1&&(Sr=Math.round(Sr),Wi=Math.round(Wi)),bn===1&&(Tr=Math.round(Tr),ni=Math.round(ni));var aa={ready:!0,offsetX:Sr/In,offsetY:Tr/bn,offsetR:Wi/In,offsetB:ni/bn,arrowX:ta/In,arrowY:ia/bn,scaleX:In,scaleY:bn,align:Hn};pt(aa)}}),Ht=function(){vt.current+=1;var Xt=vt.current;Promise.resolve().then(function(){vt.current===Xt&&tr()})},or=function(){pt(function(Xt){return k(k({},Xt),{},{ready:!1})})};return at(or,[ve]),at(function(){G||or()},[G]),[kt.ready,kt.offsetX,kt.offsetY,kt.offsetR,kt.offsetB,kt.arrowX,kt.arrowY,kt.scaleX,kt.scaleY,kt.align,Ht]}function si(G){if(Array.isArray(G))return e(G)}function Di(G){if(typeof Symbol!="undefined"&&G[Symbol.iterator]!=null||G["@@iterator"]!=null)return Array.from(G)}function de(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Me(G){return si(G)||Di(G)||I(G)||de()}function Ve(G,J,Y,ve,Pe){at(function(){if(G&&J&&Y){let vt=function(){ve(),Pe()};var Ye=J,nt=Y,xt=Xn(Ye),yt=Xn(nt),kt=Sn(nt),pt=new Set([kt].concat(Me(xt),Me(yt)));return pt.forEach(function(At){At.addEventListener("scroll",vt,{passive:!0})}),kt.addEventListener("resize",vt,{passive:!0}),ve(),function(){pt.forEach(function(At){At.removeEventListener("scroll",vt),kt.removeEventListener("resize",vt)})}}},[G,J,Y])}var Oe={},qe=[],et=function(J){qe.push(J)};function ut(G,J){if(0)var Y}function Lt(G,J){if(0)var Y}function Gt(){Oe={}}function Ft(G,J,Y){!J&&!Oe[Y]&&(G(!1,Y),Oe[Y]=!0)}function Jt(G,J){Ft(ut,G,J)}function Vt(G,J){Ft(Lt,G,J)}Jt.preMessage=et,Jt.resetWarned=Gt,Jt.noteOnce=Vt;var Qt=null;function sr(G,J,Y,ve,Pe,Ye,nt,xt){var yt=n.useRef(G);yt.current=G;var kt=n.useRef(!1);n.useEffect(function(){if(J&&ve&&(!Pe||Ye)){var vt=function(){kt.current=!1},At=function(lr){var cr;yt.current&&!nt(((cr=lr.composedPath)===null||cr===void 0||(cr=cr.call(lr))===null||cr===void 0?void 0:cr[0])||lr.target)&&!kt.current&&xt(!1)},Dt=Sn(ve);Dt.addEventListener("pointerdown",vt,!0),Dt.addEventListener("mousedown",At,!0),Dt.addEventListener("contextmenu",At,!0);var Ut=De(Y);if(Ut&&(Ut.addEventListener("mousedown",At,!0),Ut.addEventListener("contextmenu",At,!0)),0)var tr,Ht,or,er;return function(){Dt.removeEventListener("pointerdown",vt,!0),Dt.removeEventListener("mousedown",At,!0),Dt.removeEventListener("contextmenu",At,!0),Ut&&(Ut.removeEventListener("mousedown",At,!0),Ut.removeEventListener("contextmenu",At,!0))}}},[J,Y,ve,Pe,Ye]);function pt(){kt.current=!0}return pt}var zt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function fr(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ot,J=n.forwardRef(function(Y,ve){var Pe=Y.prefixCls,Ye=Pe===void 0?"rc-trigger-popup":Pe,nt=Y.children,xt=Y.action,yt=xt===void 0?"hover":xt,kt=Y.showAction,pt=Y.hideAction,vt=Y.popupVisible,At=Y.defaultPopupVisible,Dt=Y.onPopupVisibleChange,Ut=Y.afterPopupVisibleChange,tr=Y.mouseEnterDelay,Ht=Y.mouseLeaveDelay,or=Ht===void 0?.1:Ht,er=Y.focusDelay,Xt=Y.blurDelay,lr=Y.mask,cr=Y.maskClosable,jt=cr===void 0?!0:cr,Ir=Y.getPopupContainer,Er=Y.forceRender,Dr=Y.autoDestroy,Jr=Y.destroyPopupOnHide,Pr=Y.popup,Wr=Y.popupClassName,br=Y.popupStyle,Mr=Y.popupPlacement,jr=Y.builtinPlacements,Xr=jr===void 0?{}:jr,on=Y.popupAlign,xr=Y.zIndex,kr=Y.stretch,nr=Y.getPopupClassNameFromAlign,ln=Y.fresh,tn=Y.alignPoint,Nr=Y.onPopupClick,ur=Y.onPopupAlign,rn=Y.arrow,xn=Y.popupMotion,Rn=Y.maskMotion,Fr=Y.popupTransitionName,Ar=Y.popupAnimation,An=Y.maskTransitionName,Dn=Y.maskAnimation,Cr=Y.className,qr=Y.getTriggerDOMNode,Gr=c(Y,zt),Br=Dr||Jr||!1,un=n.useState(!1),En=u(un,2),Zr=En[0],mr=En[1];at(function(){mr(ze())},[]);var zr=n.useRef({}),Vr=n.useContext(ii),ci=n.useMemo(function(){return{registerSubPopup:function(Zt,Ur){zr.current[Zt]=Ur,Vr==null||Vr.registerSubPopup(Zt,Ur)}}},[Vr]),pr=Ze(),Un=n.useState(null),Vn=u(Un,2),Hr=Vn[0],In=Vn[1],bn=n.useRef(null),Kn=be(function(Mt){bn.current=Mt,wt(Mt)&&Hr!==Mt&&In(Mt),Vr==null||Vr.registerSubPopup(pr,Mt)}),Yt=n.useState(null),rr=u(Yt,2),dr=rr[0],Or=rr[1],wr=n.useRef(null),Fi=be(function(Mt){wt(Mt)&&dr!==Mt&&(Or(Mt),wr.current=Mt)}),oi=n.Children.only(nt),wn=(oi==null?void 0:oi.props)||{},Qn={},Bi=be(function(Mt){var Zt,Ur,an=dr;return(an==null?void 0:an.contains(Mt))||((Zt=De(an))===null||Zt===void 0?void 0:Zt.host)===Mt||Mt===an||(Hr==null?void 0:Hr.contains(Mt))||((Ur=De(Hr))===null||Ur===void 0?void 0:Ur.host)===Mt||Mt===Hr||Object.values(zr.current).some(function(Yr){return(Yr==null?void 0:Yr.contains(Mt))||Mt===Yr})}),Li=Fn(Ye,xn,Ar,Fr),Ci=Fn(Ye,Rn,Dn,An),hi=n.useState(At||!1),Wn=u(hi,2),mn=Wn[0],Pn=Wn[1],fn=vt!=null?vt:mn,Hn=be(function(Mt){vt===void 0&&Pn(Mt)});at(function(){Pn(vt||!1)},[vt]);var Sr=n.useRef(fn);Sr.current=fn;var Tr=n.useRef([]);Tr.current=[];var Mn=be(function(Mt){var Zt;Hn(Mt),((Zt=Tr.current[Tr.current.length-1])!==null&&Zt!==void 0?Zt:fn)!==Mt&&(Tr.current.push(Mt),Dt==null||Dt(Mt))}),Jn=n.useRef(),Ei=function(){clearTimeout(Jn.current)},Ln=function(Zt){var Ur=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ei(),Ur===0?Mn(Zt):Jn.current=setTimeout(function(){Mn(Zt)},Ur*1e3)};n.useEffect(function(){return Ei},[]);var Oi=n.useState(!1),bi=u(Oi,2),Zn=bi[0],qn=bi[1];at(function(Mt){(!Mt||fn)&&qn(!0)},[fn]);var Si=n.useState(null),Ti=u(Si,2),di=Ti[0],xi=Ti[1],ei=n.useState(null),jn=u(ei,2),zn=jn[0],vi=jn[1],li=function(Zt){vi([Zt.clientX,Zt.clientY])},Ai=Ni(fn,Hr,tn&&zn!==null?zn:dr,Mr,Xr,on,ur),nn=u(Ai,11),Ii=nn[0],Ui=nn[1],ui=nn[2],Pi=nn[3],Lr=nn[4],hr=nn[5],_r=nn[6],Qr=nn[7],cn=nn[8],Yn=nn[9],kn=nn[10],Mi=ai(Zr,yt,kt,pt),wi=u(Mi,2),Nn=wi[0],_n=wi[1],ti=Nn.has("click"),pi=_n.has("click")||_n.has("contextMenu"),ri=be(function(){Zn||kn()}),Xi=function(){Sr.current&&tn&&pi&&Ln(!1)};Ve(fn,dr,Hr,ri,Xi),at(function(){ri()},[zn,Mr]),at(function(){fn&&!(Xr!=null&&Xr[Mr])&&ri()},[JSON.stringify(on)]);var Gi=n.useMemo(function(){var Mt=yi(Xr,Ye,Yn,tn);return St()(Mt,nr==null?void 0:nr(Yn))},[Yn,nr,Xr,Ye,tn]);n.useImperativeHandle(ve,function(){return{nativeElement:wr.current,popupElement:bn.current,forceAlign:ri}});var Qi=n.useState(0),Ki=u(Qi,2),Ji=Ki[0],qi=Ki[1],ea=n.useState(0),Vi=u(ea,2),ta=Vi[0],ra=Vi[1],Hi=function(){if(kr&&dr){var Zt=dr.getBoundingClientRect();qi(Zt.width),ra(Zt.height)}},na=function(){Hi(),ri()},ia=function(Zt){qn(!1),kn(),Ut==null||Ut(Zt)},Wi=function(){return new Promise(function(Zt){Hi(),xi(function(){return Zt})})};at(function(){di&&(kn(),di(),xi(null))},[di]);function ni(Mt,Zt,Ur,an){Qn[Mt]=function(Yr){var Yi;an==null||an(Yr),Ln(Zt,Ur);for(var ua=arguments.length,fa=new Array(ua>1?ua-1:0),$i=1;$i<ua;$i++)fa[$i-1]=arguments[$i];(Yi=wn[Mt])===null||Yi===void 0||Yi.call.apply(Yi,[wn,Yr].concat(fa))}}(ti||pi)&&(Qn.onClick=function(Mt){var Zt;Sr.current&&pi?Ln(!1):!Sr.current&&ti&&(li(Mt),Ln(!0));for(var Ur=arguments.length,an=new Array(Ur>1?Ur-1:0),Yr=1;Yr<Ur;Yr++)an[Yr-1]=arguments[Yr];(Zt=wn.onClick)===null||Zt===void 0||Zt.call.apply(Zt,[wn,Mt].concat(an))});var aa=sr(fn,pi,dr,Hr,lr,jt,Bi,Ln),Gn=Nn.has("hover"),Zi=_n.has("hover"),ki,mi;Gn&&(ni("onMouseEnter",!0,tr,function(Mt){li(Mt)}),ni("onPointerEnter",!0,tr,function(Mt){li(Mt)}),ki=function(Zt){(fn||Zn)&&Hr!==null&&Hr!==void 0&&Hr.contains(Zt.target)&&Ln(!0,tr)},tn&&(Qn.onMouseMove=function(Mt){var Zt;(Zt=wn.onMouseMove)===null||Zt===void 0||Zt.call(wn,Mt)})),Zi&&(ni("onMouseLeave",!1,or),ni("onPointerLeave",!1,or),mi=function(){Ln(!1,or)}),Nn.has("focus")&&ni("onFocus",!0,er),_n.has("focus")&&ni("onBlur",!1,Xt),Nn.has("contextMenu")&&(Qn.onContextMenu=function(Mt){var Zt;Sr.current&&_n.has("contextMenu")?Ln(!1):(li(Mt),Ln(!0)),Mt.preventDefault();for(var Ur=arguments.length,an=new Array(Ur>1?Ur-1:0),Yr=1;Yr<Ur;Yr++)an[Yr-1]=arguments[Yr];(Zt=wn.onContextMenu)===null||Zt===void 0||Zt.call.apply(Zt,[wn,Mt].concat(an))}),Cr&&(Qn.className=St()(wn.className,Cr));var _i=k(k({},wn),Qn),ji={},zi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];zi.forEach(function(Mt){Gr[Mt]&&(ji[Mt]=function(){for(var Zt,Ur=arguments.length,an=new Array(Ur),Yr=0;Yr<Ur;Yr++)an[Yr]=arguments[Yr];(Zt=_i[Mt])===null||Zt===void 0||Zt.call.apply(Zt,[_i].concat(an)),Gr[Mt].apply(Gr,an)})});var sa=n.cloneElement(oi,k(k({},_i),ji)),oa={x:hr,y:_r},la=rn?k({},rn!==!0?rn:{}):null;return n.createElement(n.Fragment,null,n.createElement(gt.Z,{disabled:!fn,ref:Fi,onResize:na},n.createElement($r,{getTriggerDOMNode:qr},sa)),n.createElement(ii.Provider,{value:ci},n.createElement(vn,{portal:G,ref:Kn,prefixCls:Ye,popup:Pr,className:St()(Wr,Gi),style:br,target:dr,onMouseEnter:ki,onMouseLeave:mi,onPointerEnter:ki,zIndex:xr,open:fn,keepDom:Zn,fresh:ln,onClick:Nr,onPointerDownCapture:aa,mask:lr,motion:Li,maskMotion:Ci,onVisibleChanged:ia,onPrepare:Wi,forceRender:Er,autoDestroy:Br,getPopupContainer:Ir,align:Yn,arrow:la,arrowPos:oa,ready:Ii,offsetX:Ui,offsetY:ui,offsetR:Pi,offsetB:Lr,onAlign:ri,stretch:kr,targetWidth:Ji/Qr,targetHeight:ta/cn})))});return J}var qt=fr(ot)},31632:function(Et,Fe){"use strict";var j;var Z=typeof Symbol=="function"&&Symbol.for,ae=Z?Symbol.for("react.element"):60103,Q=Z?Symbol.for("react.portal"):60106,K=Z?Symbol.for("react.fragment"):60107,C=Z?Symbol.for("react.strict_mode"):60108,k=Z?Symbol.for("react.profiler"):60114,O=Z?Symbol.for("react.provider"):60109,B=Z?Symbol.for("react.context"):60110,e=Z?Symbol.for("react.async_mode"):60111,I=Z?Symbol.for("react.concurrent_mode"):60111,w=Z?Symbol.for("react.forward_ref"):60112,u=Z?Symbol.for("react.suspense"):60113,p=Z?Symbol.for("react.suspense_list"):60120,c=Z?Symbol.for("react.memo"):60115,m=Z?Symbol.for("react.lazy"):60116,l=Z?Symbol.for("react.block"):60121,g=Z?Symbol.for("react.fundamental"):60117,_=Z?Symbol.for("react.responder"):60118,o=Z?Symbol.for("react.scope"):60119;function s(r){if(typeof r=="object"&&r!==null){var v=r.$$typeof;switch(v){case ae:switch(r=r.type,r){case e:case I:case K:case k:case C:case u:return r;default:switch(r=r&&r.$$typeof,r){case B:case w:case m:case c:case O:return r;default:return v}}case Q:return v}}}function n(r){return s(r)===I}j=e,j=I,j=B,j=O,j=ae,j=w,j=K,j=m,j=c,j=Q,j=k,j=C,j=u,j=function(r){return n(r)||s(r)===e},j=n,j=function(r){return s(r)===B},j=function(r){return s(r)===O},j=function(r){return typeof r=="object"&&r!==null&&r.$$typeof===ae},j=function(r){return s(r)===w},j=function(r){return s(r)===K},j=function(r){return s(r)===m},Fe.isMemo=function(r){return s(r)===c},j=function(r){return s(r)===Q},j=function(r){return s(r)===k},j=function(r){return s(r)===C},j=function(r){return s(r)===u},j=function(r){return typeof r=="string"||typeof r=="function"||r===K||r===I||r===k||r===C||r===u||r===p||typeof r=="object"&&r!==null&&(r.$$typeof===m||r.$$typeof===c||r.$$typeof===O||r.$$typeof===B||r.$$typeof===w||r.$$typeof===g||r.$$typeof===_||r.$$typeof===o||r.$$typeof===l)},j=s},81640:function(Et,Fe,j){"use strict";Et.exports=j(31632)},48482:function(Et,Fe){"use strict";var j;var Z=Symbol.for("react.element"),ae=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),O=Symbol.for("react.context"),B=Symbol.for("react.server_context"),e=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function l(g){if(typeof g=="object"&&g!==null){var _=g.$$typeof;switch(_){case Z:switch(g=g.type,g){case Q:case C:case K:case I:case w:return g;default:switch(g=g&&g.$$typeof,g){case B:case O:case e:case p:case u:case k:return g;default:return _}}case ae:return _}}}j=O,j=k,j=Z,Fe.ForwardRef=e,j=Q,j=p,j=u,j=ae,j=C,j=K,j=I,j=w,j=function(){return!1},j=function(){return!1},j=function(g){return l(g)===O},j=function(g){return l(g)===k},j=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===Z},j=function(g){return l(g)===e},j=function(g){return l(g)===Q},j=function(g){return l(g)===p},Fe.isMemo=function(g){return l(g)===u},j=function(g){return l(g)===ae},j=function(g){return l(g)===C},j=function(g){return l(g)===K},j=function(g){return l(g)===I},j=function(g){return l(g)===w},j=function(g){return typeof g=="string"||typeof g=="function"||g===Q||g===C||g===K||g===I||g===w||g===c||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===u||g.$$typeof===k||g.$$typeof===O||g.$$typeof===e||g.$$typeof===m||g.getModuleId!==void 0)},j=l},52481:function(Et,Fe,j){"use strict";Et.exports=j(48482)},26194:function(Et,Fe,j){"use strict";var Z=j(67294),ae=j(4977),Q=j(85804),K=Object.defineProperty,C=Object.defineProperties,k=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable,I=(c,m,l)=>m in c?K(c,m,{enumerable:!0,configurable:!0,writable:!0,value:l}):c[m]=l,w=(c,m)=>{for(var l in m||(m={}))B.call(m,l)&&I(c,l,m[l]);if(O)for(var l of O(m))e.call(m,l)&&I(c,l,m[l]);return c},u=(c,m)=>C(c,k(m));const p=({img:c,buttonProps:m={},styles:l={},customText:g,ButtonText:_,ButtonClick:o,Buttonclass:s,ButtonTwo:n,imgStyles:r,loading:v=!1,className:E=""})=>Z.createElement("section",{className:`tc animated fadeIn ${E}`,style:w({color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"},l)},Z.createElement("img",{src:c||ae,style:u(w({},r),{pointerEvents:"none",userSelect:"none"})}),Z.createElement("p",{className:"mt20 font14"},g||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),_&&Z.createElement(Q.ZP,w({className:s,onClick:o},m),_),n&&n);Fe.Z=p},20819:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return s}});var Z=j(67294),ae={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Q=j(85804),K=j(30153),C=j(36295),k=j(83062),O=j(28706),B=j(15835),e=j(26194),I=j(11320),w=j(66540),u=j(67294),p=Object.defineProperty,c=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,g=(n,r,v)=>r in n?p(n,r,{enumerable:!0,configurable:!0,writable:!0,value:v}):n[r]=v,_=(n,r)=>{for(var v in r||(r={}))m.call(r,v)&&g(n,v,r[v]);if(c)for(var v of c(r))l.call(r,v)&&g(n,v,r[v]);return n},o=(n,r,v)=>new Promise((E,f)=>{var S=D=>{try{A(v.next(D))}catch(a){f(a)}},L=D=>{try{A(v.throw(D))}catch(a){f(a)}},A=D=>D.done?E(D.value):Promise.resolve(D.value).then(S,L);A((v=v.apply(n,r)).next())}),s=({editOffice:n="view",data:r,issaver:v,onSaver:E,theme:f,type:S,filename:L,monacoEditor:A,className:D,style:a,close:i,onClose:t,hasMask:h,disabledDownload:b,onImgDimensions:T,showNodata:y,recordInfo:d})=>{const[R,M]=(0,Z.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[F,U]=(0,Z.useState)(""),[V,re]=(0,Z.useState)(),$=window.ENV==="build"?"/react/build":"",le=location.host.startsWith("localhost")?I.Z.PROXY_SERVER:I.Z.API_SERVER,_e=10*(1024*1024),fe=(0,Z.useRef)();r!=null&&r.startsWith("/api")&&S!=="txt"&&(r=I.Z.API_SERVER+r);const me=pe=>pe.substring(pe.lastIndexOf("/")+1).split(".").pop();L&&A&&(A.filename=L),(0,Z.useEffect)(()=>{var pe,Ke;const Ce=(Ke=(pe=document.cookie)==null?void 0:pe.replace(/\s/g,""))==null?void 0:Ke.split(";");Ce==null||Ce.map(ie=>{let X=ie.split("=");X[0]==="_educoder_session"&&U(X[1])})},[]),(0,Z.useEffect)(()=>{S==="office"&&(r.indexOf("bigfilescdn.")>-1||r.indexOf("bigfiles1")>-1?re({url:r,fileType:me(r),model:r.indexOf("model=edit")?"edit":"view"}):Be())},[S,r]);function Ae(pe){return o(this,null,function*(){pe.data.type==="pdfdata"&&(E(pe.data.data),window.removeEventListener("message",Ae,!1)),console.log("mess---:",pe.data)})}const Be=()=>o(void 0,null,function*(){console.log("data:",r);let pe=r;r.startsWith("http")||(pe=location.origin+pe);let Ke=new URL(pe).pathname.split("/").pop();const Ce=yield(0,B.gJ)({attachment_id:Ke});Ce.url=le+Ce.url,re(Ce)}),Le=()=>{if(r.startsWith("http")||r.startsWith("blob:")){Ie();return}(0,O.Sv)(L||"educoder",r,L)},Ie=()=>{d&&(0,w.fc)({id:d==null?void 0:d.id,watch_type:1,course_id:d==null?void 0:d.course_id}),(0,O.Nd)(L||"educoder",decodeURIComponent(r))};return u.createElement("div",{style:_({},a||{}),className:`${h&&ae.bgBlack} ${S?ae.wrp:"hide"}`},i&&u.createElement("div",{className:ae.close,ref:fe},!!T&&u.createElement(k.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>fe.current},u.createElement("span",{onClick:()=>{t(),T()}},u.createElement("i",{className:"icon-yulanpizhu"}))),!b&&u.createElement(k.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>fe.current},u.createElement("span",{onClick:Ie},u.createElement("i",{className:"icon-quxiaozhiding"}))),v&&u.createElement(k.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>fe.current},u.createElement("span",{className:"",onClick:()=>{const pe=document.getElementById("pdfiframe");window.addEventListener("message",Ae,!1),setTimeout(()=>{pe.contentWindow.postMessage("getData","*")},300)}},u.createElement("i",{className:"icon-baocun"}))),u.createElement(k.Z,{title:"\u5173\u95ED",getPopupContainer:()=>fe.current},u.createElement("span",{className:"",onClick:()=>{t()}},u.createElement("i",{className:"icon-guanbi1"})))),u.createElement("div",{className:`${ae[D]} ${D} ${ae.monaco} ${S==="txt"?"show":"hide"}`},S==="txt"&&u.createElement(u.Fragment,null,u.createElement(C.ZP,_({},A)))),S==="audio"&&u.createElement("audio",{src:`${(r==null?void 0:r.indexOf("http://"))>-1||(r==null?void 0:r.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${r}`,autoPlay:!0}),S==="video"&&u.createElement(u.Fragment,null,(r==null?void 0:r.indexOf("http"))>-1?u.createElement("video",{controls:!0,src:`${r}`,autoPlay:!0}):u.createElement("video",{controls:!0,src:`data:video/mp4;base64,${r}`,autoPlay:!0})),S==="office"&&V&&u.createElement("iframe",{src:`${$}/office.html?key=${V.key}&url=${btoa(V.url)}&callbackUrl=${le+(V.callbackUrl||"")}&fileType=${V.fileType}&title=${V.title||""}&model=${n}&officeServer=${I.Z.ONLYOFFICE}&disabledDownload=${!!b}`}),S==="html"&&u.createElement("iframe",{src:r+"&disposition=inline"}),S==="pdf"&&u.createElement("iframe",{id:"pdfiframe",src:`${$}/js/pdfview/index.html?filename=${L||"educoder.pdf"}&url=${encodeURIComponent(r)}&disabledDownload=${!!b}&model=${n}`}),S==="image"&&u.createElement("img",{src:`${(r==null?void 0:r.indexOf("http://"))>-1||(r==null?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,"}${r}`}),(S==="other"||S==="download")&&u.createElement(u.Fragment,null,y?u.createElement(e.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:u.createElement(Q.ZP,{icon:u.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Le,disabled:b},"\u4E0B\u8F7D")}):u.createElement(Q.ZP,{type:"primary",size:"middle",onClick:Le,disabled:b},u.createElement(K.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},6104:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return l}});var Z=j(67294),ae=j(2453),Q=j(85418),K=j(24577),C=j(67631),k=j.n(C),O=j(52262),B=j(74855),e=j(51959),I={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},w=(g,_,o)=>new Promise((s,n)=>{var r=f=>{try{E(o.next(f))}catch(S){n(S)}},v=f=>{try{E(o.throw(f))}catch(S){n(S)}},E=f=>f.done?s(f.value):Promise.resolve(f.value).then(r,v);E((o=o.apply(g,_)).next())});function u(g){if(isNaN(g))return{minutes:"00",seconds:"00"};const _=new Date(g*1e3).toISOString().substr(11,8);return{hour:_.substr(0,2),minutes:_.substr(3,2),seconds:_.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function p(g,_){return g-_}function c(g){g.sort(p);let _=0;for(let o=0;o<g.length-1;o++){let s=Math.abs(g[o+1]-g[o]);s<21&&(_+=s)}return _}const m=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var l=(0,Z.forwardRef)(({allow_skip:g,src:_,toLog:o,videoId:s,logWatchHistory:n,courseId:r=null,startTime:v,handlePause:E=()=>{},handlePlay:f=()=>{},handlePlayEnded:S=()=>{},autoPlay:L=!1,onPlayEnded:A=()=>{},isShowWaterMark:D=!0},a)=>{var i;_=_==null?void 0:_.replace("http://","https://");const h=((i=_==null?void 0:_.split("."))==null?void 0:i.pop())==="flv",b=(0,Z.useRef)(),T=(0,Z.useRef)(),y=(0,Z.useRef)(),d=(0,Z.useRef)(),R=(0,Z.useRef)(),M=(0,Z.useRef)(),F=(0,Z.useRef)(),U=(0,Z.useRef)(),V=(0,Z.useRef)(),re=(0,Z.useRef)(),$=(0,Z.useRef)(),le=(0,Z.useRef)(),te=(0,Z.useRef)(),_e=(0,Z.useRef)(),fe=navigator.userAgent.toLowerCase().match(m),me=fe?fe[0]:"pc",Ae=(0,Z.useRef)(!1),Be=(0,O.eY)();let Le=0,Ie=0,pe=0,Ke=null,Ce=!1,ie=20,X=1,q=!1,ue=!1,ee=[];(0,Z.useImperativeHandle)(a,()=>({getLastUpdatedTime:()=>b.current.currentTime,getDuration:()=>b.current.duration})),ae.ZP.config({maxCount:1,getContainer:()=>y.current});const z=(0,Z.useCallback)((Ne,Re=!1)=>{let xe={point:b.current.currentTime};Ke?(xe.log_id=Ke,xe.watch_duration=c(ee),xe.total_duration=Ie):(r?(xe.video_id=parseInt(s,10),xe.course_id=r):xe.video_id=s,xe.duration=Le,xe.device=me),Re&&(xe.ed="1");function Ue(){return w(this,null,function*(){q=!0,Ke=yield n==null?void 0:n(xe),q=!1,Ne&&Ne()})}Ue()},[s,r]);(0,Z.useEffect)(()=>{b.current&&(d.current.style.display="none",R.current.style.display="block"),ae.ZP.destroy();let Ne=null;return K.Z.isSupported&&h&&_&&(_==null?void 0:_.indexOf(".m3u8"))<0?(Ne=K.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:_,muted:!1}),b.current&&(Ne.attachMediaElement(b.current),Ne.load())):b.current.setAttribute("src",_),ce(),()=>{Ne&&(Ne.unload(),Ne.pause(),Ne.destroy(),Ne=null)}},[b,h,_]);function ne(){b.current.paused?(d.current.style.display="none",R.current.style.display="block"):(d.current.style.display="block",R.current.style.display="none")}function ce(){$.current.style.display="none",te.current.style.display="none",le.current.style.display="none",b.current.muted||b.current.volume===0?$.current.style.display="block":b.current.volume>0&&b.current.volume<=.5?te.current.style.display="block":le.current.style.display="block"}(0,Z.useEffect)(()=>{const Ne=document.getElementById("play"),Re=document.querySelectorAll(".playback-icons use");function xe(){f(),v&&!Ae.current&&(b.current.currentTime=v),Ae.current=!0,ee.push(b.current.currentTime),Ce||(Ce=!0,o&&z())}function Ue(){return w(this,null,function*(){ne(),ee.push(b.current.currentTime),o&&z(()=>{Ke=null,pe=0,Ce=!1,q=!1,ue=!1,ee=[],Ie=0,X=1},!0),A()})}function ye(){M.current.value=Math.round(b.current.currentTime),F.current.value=Math.round(b.current.currentTime)}function it(){const Ge=u(Math.round(b.current.currentTime));V.current.innerText=`${Ge.hour>0?Ge.hour+":":""}${Ge.minutes}:${Ge.seconds}`,V.current.setAttribute("datetime",`${Ge.hour>0?" "+Ge.hour+" ":""}${Ge.minutes}m ${Ge.seconds}s`)}function rt(){var Ge,he,De,be,Ee,je,Je;const Qe=Math.round((Ge=b.current)==null?void 0:Ge.duration);(De=(he=M.current)==null?void 0:he.setAttribute)==null||De.call(he,"max",Qe),(Ee=(be=F.current)==null?void 0:be.setAttribute)==null||Ee.call(be,"max",Qe);const Xe=u(Qe);U.current&&(U.current.innerText=`${Xe.hour>0?Xe.hour+":":""}${Xe.minutes}:${Xe.seconds}`,(Je=(je=U.current).setAttribute)==null||Je.call(je,"datetime",`${Xe.hour>0?" "+Xe.hour+" ":""}${Xe.minutes}m ${Xe.seconds}s`))}function tt(){try{const Ge=Math.round(b.current.duration);M.current.setAttribute("max",Ge),F.current.setAttribute("max",Ge);const he=u(Ge);U.current.innerText=`${he.hour>0?he.hour+":":""}${he.minutes}:${he.seconds}`,U.current.setAttribute("datetime",`${he.hour>0?" "+he.hour+" ":""}${he.minutes}m ${he.seconds}s`),ye(),it();const{width:De,height:be,x:Ee,y:je}=T.current.getBoundingClientRect();if(Ee<0||je<0,!ue){let Je=b.current.currentTime,Qe=Je-pe;Math.abs(Qe)<10?(Ie+=Math.abs(Qe),pe=Je,q||Ie-X*ie>=0&&(X++,ee.push(pe),o&&z())):(pe=Je,o&&z())}}catch(Ge){console.log("videoplaying:",Ge)}}function We(){ue=!0}function ot(){b.current.playing&&ee.push(b.current.currentTime,pe),pe=b.current.currentTime,ue=!1}function _t(){Le=b.current.duration,Le<=20&&(ie=Le/3),b.current.addEventListener("play",xe)}function St(Ge){Ge.preventDefault(),(0,e.vp)()?(b.current.style.width="100%",b.current.style.height="100%"):b.current.style.cssText=""}function gt(){E()}function wt(Ge){if(!g){ae.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const he=Ge.target.dataset.seek?Ge.target.dataset.seek:Ge.target.value;b.current.currentTime=he,F.current.value=he,M.current.value=he}function mt(Ge){const he=Math.round(Ge.offsetX/Ge.target.clientWidth*parseInt(Ge.target.getAttribute("max"),10));M.current.setAttribute("data-seek",he);const De=u(he);re.current.textContent=`${De.hour>0?De.hour+":":""}${De.minutes}:${De.seconds}`;const be=b.current.getBoundingClientRect();re.current.style.left=`${Ge.pageX-be.left}px`}function Ct(Ge){switch(Ge.code){case"Space":Ge.preventDefault(),$e();break;case"ArrowRight":if(Ge.preventDefault(),!g){ae.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(b.current.currentTime>=b.current.duration)break;b.current.currentTime=parseInt(b.current.currentTime)+5,ye();break;case"ArrowLeft":if(Ge.preventDefault(),!g){ae.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(b.current.currentTime===0)break;b.current.currentTime=parseInt(b.current.currentTime)-5,ye();break;case"ArrowUp":Ge.preventDefault(),b.current.volume<1&&(b.current.volume=(parseInt(b.current.volume*10)+1)/10);break;case"ArrowDown":Ge.preventDefault(),b.current.volume>0&&(b.current.volume=(parseInt(b.current.volume*10)-1)/10);break}}return y.current.addEventListener((0,e.gH)(),St),b.current.addEventListener("canplay",_t),b.current.addEventListener("ended",Ue),b.current.addEventListener("seeking",We),b.current.addEventListener("seeked",ot),b.current.addEventListener("loadedmetadata",rt),M.current.addEventListener("mousemove",mt),M.current.addEventListener("input",wt),b.current.addEventListener("timeupdate",tt),b.current.addEventListener("pause",gt),b.current.addEventListener("volumechange",ce),document.addEventListener("keydown",Ct),()=>{var Ge,he,De,be,Ee,je,Je,Qe,Xe,He,Se,x;(Ge=b.current)==null||Ge.removeEventListener("canplay",_t),(he=b.current)==null||he.removeEventListener("play",xe),(De=b.current)==null||De.removeEventListener("ended",Ue),(be=b.current)==null||be.removeEventListener("seeking",We),(Ee=b.current)==null||Ee.removeEventListener("seeked",ot),(je=M.current)==null||je.removeEventListener("mousemove",mt),(Je=M.current)==null||Je.removeEventListener("input",wt),(Qe=b.current)==null||Qe.removeEventListener("timeupdate",tt),(Xe=b.current)==null||Xe.removeEventListener("pause",gt),(He=b.current)==null||He.removeEventListener("loadedmetadata",rt),(Se=b.current)==null||Se.removeEventListener("volumechange",ce),document.removeEventListener("keydown",Ct),(x=b.current)!=null&&x.playing&&(ee.push(pe,b.current.currentTime),o&&z())}},[b,_]),(0,Z.useEffect)(()=>{if(b.current.onended=()=>{S(b)},b.current.oncontextmenu=()=>!1,(_==null?void 0:_.indexOf(".m3u8"))>-1){if(b.current.canPlayType("application/vnd.apple.mpegurl"))b.current.src=_;else if(k().isSupported()){var Ne=new(k());Ne.loadSource(_),Ne.attachMedia(b.current)}}},[_]);const[ge,ke]=(0,Z.useState)(1),$e=()=>{b.current.paused||b.current.ended?b.current.play():b.current.pause(),ne()};function ft(){b.current.muted=!b.current.muted,b.current.muted?(_e.current.setAttribute("data-volume",volume.value),_e.current.value=0):_e.current.value=_e.current.dataset.volume}return Z.createElement("div",{style:{position:"relative"},ref:y},Z.createElement("div",{ref:T,className:`${I.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${I.animate__loop}`},D&&Be?Be.login:" "),Z.createElement("div",{className:I.container},Z.createElement("div",{className:I["video-container"],id:"video-container"},Z.createElement("div",{className:I["playback-animation"],id:"playback-animation"},Z.createElement("svg",{className:I["playback-icons"]},Z.createElement("use",{className:"hidden",href:"#play-icon"}),Z.createElement("use",{href:"#pause"}))),Z.createElement("video",{className:I.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:b,autoPlay:L}),Z.createElement("div",{className:`${I["video-controls"]} `,id:"video-controls"},Z.createElement("div",{className:I["bottom-controls"]},Z.createElement("div",{className:I["left-controls"]},Z.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:$e},Z.createElement("svg",{className:I["playback-icons"]},Z.createElement("use",{ref:R,href:"#play-icon"}),Z.createElement("use",{ref:d,style:{display:"none"},href:"#pause"}))),Z.createElement("div",{className:I.time},Z.createElement("time",{id:"time-elapsed",ref:V},"00:00"),Z.createElement("span",null," / "),Z.createElement("time",{id:"duration",ref:U},"00:00"))),Z.createElement("div",{className:I["right-controls"]},g&&Z.createElement(Q.Z,{placement:"top",overlayClassName:I.rateOverlay,getPopupContainer:Ne=>Ne.parentNode,menu:{items:[{key:"1",label:Z.createElement("span",{onClick:()=>{ke(1),b.current.playbackRate=1}},"1.0x")},{key:"2",label:Z.createElement("span",{onClick:()=>{ke(1.5),b.current.playbackRate=1.5}},"1.5x")},{key:"3",label:Z.createElement("span",{onClick:()=>{ke(2),b.current.playbackRate=2}},"2.0x")}]}},Z.createElement("div",{className:`${I.controlText} mr5`},"\u500D\u901F")),Z.createElement(B.CopyToClipboard,{text:_,onCopy:()=>ae.ZP.success("\u590D\u5236\u6210\u529F")},Z.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},Z.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),Z.createElement("div",{className:I["volume-controls"]},Z.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:I["volume-button"],id:"volume-button",onClick:ft},Z.createElement("i",{ref:$,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),Z.createElement("i",{ref:te,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),Z.createElement("i",{ref:le,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),Z.createElement("input",{className:I.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:_e,style:{display:"none"},onClick:ce})),Z.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:I["fullscreen-button"],onClick:()=>{(0,e.vp)()?(0,e.BU)():(0,e.Dj)(y.current)}},Z.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),Z.createElement("div",{className:I["video-progress"]},Z.createElement("progress",{ref:F,value:"0",min:"0"}),Z.createElement("input",{className:I.seek,ref:M,value:"0",min:"0",type:"range",step:"1"}),Z.createElement("div",{className:I["seek-tooltip"],ref:re,id:"seek-tooltip"},"00:00"))))),Z.createElement("svg",{style:{display:"none"}},Z.createElement("defs",null,Z.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),Z.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),Z.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),Z.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),Z.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),Z.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),Z.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),Z.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},Z.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},36295:function(Et,Fe,j){"use strict";j.d(Fe,{SV:function(){return _e},ZP:function(){return te}});var Z=j(67294),ae=j(91033);const Q={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"]},K={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"]},C={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},k={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(`
`)}]},O={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var B=j(84204),e=j.n(B),I=(fe,me,Ae)=>new Promise((Be,Le)=>{var Ie=Ce=>{try{Ke(Ae.next(Ce))}catch(ie){Le(ie)}},pe=Ce=>{try{Ke(Ae.throw(Ce))}catch(ie){Le(ie)}},Ke=Ce=>Ce.done?Be(Ce.value):Promise.resolve(Ce.value).then(Ie,pe);Ke((Ae=Ae.apply(fe,me)).next())});const w={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"]}},u=(fe,me,Ae,Be)=>{const Le=me.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:Ae.lineNumber,endColumn:Ae.column});return Array.from(new Set(Le.match(/\b\w{2,}\b/g)||[])).map(pe=>({label:pe,kind:fe.languages.CompletionItemKind.Text,insertText:pe,range:Be}))},p=(fe,me,Ae,Be)=>{fe.languages.registerCompletionItemProvider(me,{provideCompletionItems(Le,Ie){const pe=Le.getWordUntilPosition(Ie),Ke={startLineNumber:Ie.lineNumber,endLineNumber:Ie.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ce=Le.getLineContent(Ie.lineNumber).substring(pe.startColumn-2,pe.endColumn);return{suggestions:[...u(fe,Le,Ie,Ke),...Ae.map(X=>({label:X,kind:fe.languages.CompletionItemKind.Keyword,documentation:X,insertText:X,insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke})),...Be.map(X=>({label:X.label,kind:fe.languages.CompletionItemKind.Snippet,documentation:X.content,insertText:Ce.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}))]}}})};var c=fe=>{w.languages.forEach(me=>{fe.languages.registerDocumentFormattingEditProvider(me,{provideDocumentFormattingEdits(Ae){return I(this,null,function*(){const Be=e()(Ae.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});return[{range:Ae.getFullModelRange(),text:Be}]})}})}),p(fe,"java",K.keywords,K.quickKey),p(fe,"cpp",C.keywords,C.quickKey),p(fe,"c",Q.keywords,[]),p(fe,"python",k.keywords,k.quickKey),p(fe,"scala",O.keywords,O.quickKey)};const m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var l=Object.defineProperty,g=(fe,me,Ae)=>me in fe?l(fe,me,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):fe[me]=Ae,_=(fe,me,Ae)=>g(fe,typeof me!="symbol"?me+"":me,Ae);const o=class ca{constructor(me,Ae,Be){this.placeholder=me,this.editor=Ae,this.monaco=Be,Ae.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return ca.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};_(o,"ID","editor.widget.placeholderHint");var n=o,r=j(84144),v=j(2453),E=j(83062),f=j(96486),S=j(33054),L=j(74855),A=Object.defineProperty,D=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,b=(fe,me,Ae)=>me in fe?A(fe,me,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):fe[me]=Ae,T=(fe,me)=>{for(var Ae in me||(me={}))t.call(me,Ae)&&b(fe,Ae,me[Ae]);if(i)for(var Ae of i(me))h.call(me,Ae)&&b(fe,Ae,me[Ae]);return fe},y=(fe,me)=>D(fe,a(me)),d=(fe,me)=>{var Ae={};for(var Be in fe)t.call(fe,Be)&&me.indexOf(Be)<0&&(Ae[Be]=fe[Be]);if(fe!=null&&i)for(var Be of i(fe))me.indexOf(Be)<0&&h.call(fe,Be)&&(Ae[Be]=fe[Be]);return Ae},R=(fe,me,Ae)=>new Promise((Be,Le)=>{var Ie=Ce=>{try{Ke(Ae.next(Ce))}catch(ie){Le(ie)}},pe=Ce=>{try{Ke(Ae.throw(Ce))}catch(ie){Le(ie)}},Ke=Ce=>Ce.done?Be(Ce.value):Promise.resolve(Ce.value).then(Ie,pe);Ke((Ae=Ae.apply(fe,me)).next())});function M(fe){return/^\d+$/.test(fe)?`${fe}px`:fe}function F(){}let U=!1;const V={"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",Scala:"scale",solidity:"sol"};function re(fe=[]){let me=fe;if(Array.isArray(fe)){for(let Ae=0;Ae<fe.length;Ae++){let Be=V[fe[Ae]];if(Be)return Be}return me[0]}return V[me]||me}let $=null;const le=()=>R(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(fe){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",fe)}});var te=fe=>{var me=fe,{width:Ae="100%",height:Be="100%",value:Le,language:Ie="javascript",style:pe={},options:Ke={},overrideServices:Ce={},theme:ie="vs-dark",onEditBlur:X,isCopy:q=!1,onSave:ue,autoHeight:ee=!1,forbidCopy:z=!1,onChange:ne=F,editorDidMount:ce=F,onFocus:ge=F,onBreakPoint:ke=F,breakPointValue:$e=[],filename:ft="educoder.txt",errorLine:Ne,errorContent:Re="",highlightLine:xe,openBreakPoint:Ue=!1,placeholder:ye="",showMiniMap:it=!0}=me,rt=d(me,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const tt=(0,Z.useRef)(),We=(0,Z.useRef)({}),ot=(0,Z.useRef)(),_t=(0,Z.useRef)(),St=(0,Z.useRef)([]),gt=(0,Z.useRef)(!1),wt=(0,Z.useRef)(),mt=(0,Z.useRef)(),Ct=(0,Z.useRef)(!1),[Ge,he]=(0,Z.useState)(!1);function De(){let se;return tt.current&&(se=new ae.Z(Te=>{for(let we of Te)(we.target.offsetHeight>0||we.target.offsetWidth>0)&&We.current.instance.layout()}),se.observe(tt.current)),se}function be(){v.ZP.warning({content:decodeURIComponent(m),key:"monaco-editor-tip"})}const Ee=()=>{let se=We.current.instance;if(Le!=null&&se&&Ge){const Te=se.getModel();Te&&Le!==Te.getValue()&&(U=!0,Te.setValue(Le),se.layout(),U=!1)}};(0,Z.useEffect)(()=>{const se=S.Z.subscribe("formatDocument",Te=>{var we;let Ze=We.current.instance;(we=Ze==null?void 0:Ze.getAction)==null||we.call(Ze,"editor.action.formatDocument").run()});return window.updateMonacoValue=Te=>{ne(Te)},se},[]),(0,Z.useEffect)(()=>{var se;let Te=We.current.instance;_t.current&&clearTimeout(_t.current),_t.current=setTimeout(()=>{Ee()},500),Le&&(Le!=null&&Le.length)&&((se=Te==null?void 0:Te.updateOptions)==null||se.call(Te,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Le.split(/\r\n|\r|\n/g).length))+3,5)}))},[Le,Ge,We.current]),(0,Z.useEffect)(()=>{if(Ne&&We.current&&We.current.instance){let Te=We.current.instance;Te.changeViewZones(function(we){var Ze=document.createElement("div");Ze.style.padding="10px 20px",Ze.style.width="calc(100% - 20px)",Ze.className="my-error-line-wrp",Ze.innerHTML=Re,we.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:Ze})});var se={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}};Te.addOverlayWidget(se),Te.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,We.current,Ge]);const je=(se="",Te)=>{if(!se||se.trim()==="")return!0;const Ze=We.current.instance.getModel().getLineTokens(Te);let dt=!1;for(let Tt=0;Tt<2;Tt++)Ze.getStandardTokenType(Tt)===1&&(dt=!0);return dt};(0,Z.useEffect)(()=>{var se;const Te=(se=We.current)==null?void 0:se.instance;if(Te&&Ge&&z){const we=Te.onDidBlurEditorWidget(()=>{Ct.current=!1}),Ze=Te.onDidFocusEditorText(()=>{Ct.current=!0});return()=>{we.dispose(),Ze.dispose()}}},[We.current,Ge,z]),(0,Z.useEffect)(()=>{var se;if((se=We.current)!=null&&se.instance&&Ge&&Ue){let Te=We.current.instance,we=Te.getModel();if(!we)return;(()=>{var Nt;let It=[],ht=[];const Bt=we.getAllDecorations();for(let Kt of Bt)Kt.options.className==="highlighted-line"&&(It.push((Nt=Kt==null?void 0:Kt.range)==null?void 0:Nt.startLineNumber),ht.push(Kt==null?void 0:Kt.id));if(xe===It[0])return;we.deltaDecorations(ht,[]);const Pt=we.getLineCount();xe&&xe<=Pt&&(Te.deltaDecorations([],[{range:new $.Range(xe,1,xe,we.getLineMaxColumn(xe)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Te.revealLineInCenter(xe))})();const dt=(Nt=!1)=>{var It;let ht=[],Bt=[];const Pt=we.getAllDecorations();for(let Kt of Pt)Kt.options.linesDecorationsClassName==="breakpoints-select"&&(ht.push((It=Kt==null?void 0:Kt.range)==null?void 0:It.startLineNumber),Bt.push(Kt==null?void 0:Kt.id));if(Nt)return{lines:ht,ids:Bt};ke(ht)},Tt=Nt=>R(void 0,null,function*(){let It={range:new $.Range(Nt,1,Nt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield we.deltaDecorations([],[It]),dt()}),ct=Nt=>R(void 0,null,function*(){let It=[];const ht=Te.getLineDecorations(Nt);for(let Bt of ht)Bt.options.linesDecorationsClassName==="breakpoints-select"&&It.push(Bt.id);yield we.deltaDecorations(It,[]),dt()}),Rt=Nt=>{let It=Te.getLineDecorations(Nt);for(let ht of It)if(ht.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,f.isEqual)($e,dt(!0).lines)){we.deltaDecorations(dt(!0).ids,[]);const Nt=$e.map(It=>({range:new $.Range(It,1,It,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));we.deltaDecorations([],Nt)}const at=Te.onDidChangeModelContent(Nt=>{let It=Te.getPosition();if(It){let ht=It.lineNumber;clearTimeout(mt.current),mt.current=setTimeout(()=>{je(we.getLineContent(ht),ht)?ct(ht):Rt(ht)?(ct(ht),Tt(ht)):dt()},100)}}),ze=Te.onMouseDown(Nt=>{var It,ht,Bt;if(Nt.target.detail&&((Bt=(ht=(It=Nt.target)==null?void 0:It.element)==null?void 0:ht.className)!=null&&Bt.includes("line-numbers"))){let Pt=Nt.target.position.lineNumber;if(je(we.getLineContent(Pt),Pt))return;Rt(Pt)?ct(Pt):Tt(Pt)}}),st=Nt=>{let It={range:new $.Range(Nt,1,Nt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};St.current=Te.deltaDecorations(St.current,[It])},lt=()=>{St.current=Te.deltaDecorations(St.current,[])},bt=Te.onMouseMove(Nt=>{var It,ht,Bt;if(lt(),Nt.target.detail&&((Bt=(ht=(It=Nt.target)==null?void 0:It.element)==null?void 0:ht.className)!=null&&Bt.includes("line-numbers"))){let Pt=Nt.target.position.lineNumber;if(je(we.getLineContent(Pt),Pt))return;st(Pt)}}),Ot=Te.onMouseLeave(()=>{lt()});return()=>{at.dispose(),ze.dispose(),bt.dispose(),Ot.dispose()}}},[We.current,Ge,$e,xe,Ue,Ie]),(0,Z.useEffect)(()=>{var se;(se=We.current)!=null&&se.instance&&Ue&&We.current.instance.setPosition({lineNumber:0,column:0})},[xe]);function Je(){let se=We.current.instance;if(se){const Te=se.getSelection(),we=We.current.pastePos||{},Ze=new $.Range(we.startLineNumber||Te.endLineNumber,we.startColumn||Te.endColumn,we.endLineNumber||Te.endLineNumber,we.endColumn||Te.endColumn);setTimeout(()=>{se.executeEdits("",[{range:Ze,text:""}])},300)}}function Qe(se){(window.navigator.platform.match("Mac")?se.metaKey:se.ctrlKey)&&se.keyCode==83&&(se.preventDefault(),ue())}const Xe=()=>{if(ee&&We.current.instance){const se=We.current.instance.getContentHeight();H(se<Be?Be:se)}else H(Be)};function He(se){var Te=document.createEvent("MouseEvents");Te.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),se.dispatchEvent(Te)}const Se=se=>{if(!Ct.current)return;const{keyCode:Te,ctrlKey:we,metaKey:Ze,target:dt,type:Tt}=se;return(Tt==="paste"||(Te===67||Te===86)&&(Ze||we))&&dt.nodeName==="TEXTAREA"&&(be(),se.preventDefault()),!1};function x(se,Te){var we=window.URL||window.webkitURL||window,Ze=new Blob([Te]),dt=document.createElementNS("http://www.w3.org/1999/xhtml","a");dt.href=we.createObjectURL(Ze),dt.download=se,He(dt)}(0,Z.useEffect)(()=>{Xe()},[Xe]),(0,Z.useEffect)(()=>{tt.current&&!Ge&&Promise.all([j.e(5552),j.e(9651)]).then(j.bind(j,55826)).then(se=>{try{$=se,We.current.instance=$.editor.create(tt.current,{value:Le,language:re(Ie),theme:ie,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:it||!1}},Ce);const Te=We.current.instance;let dt=[...r.BH._menuItems].find(at=>at[0]._debugName=="EditorContext")[1],Tt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ct=(at,ze)=>{var st,lt;let bt=at._first;do ze.includes((lt=(st=bt.element)==null?void 0:st.command)==null?void 0:lt.id)&&at._remove(bt);while(bt=bt.next)};if(ce(Te,$),setTimeout(()=>{Xe(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{x(ft||"educoder.txt",Te.getValue())}})},500),We.current.subscription=Te.onDidChangeModelContent(at=>{gt.current?clearTimeout(wt.current):(Xe(),ne(Te.getValue(),at)),wt.current=setTimeout(()=>{gt.current=!1},500)}),window.Monaco||c($,re(Ie)),z&&(ct(dt,Tt),tt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Se),window.removeEventListener("paste",Se),window.addEventListener("keydown",Se),window.addEventListener("paste",Se)),window.Monaco=$,X&&Te.onDidBlurEditorWidget(()=>{X(Te.getValue())}),ge&&Te.onDidFocusEditorText(()=>{z&&le(),ge(Te.getValue())}),z){le();try{Te.onDidPaste(at=>{const ze=Te.getSelection(),st=We.current.pastePos||{},lt=new $.Range(st.startLineNumber||ze.endLineNumber,st.startColumn||ze.endColumn,st.endLineNumber||ze.endLineNumber,st.endColumn||ze.endColumn);Te.executeEdits("",[{range:at.range,text:""}])})}catch(at){}}let Rt=De();return ye&&typeof ye=="string"&&new n(ye,Te,$),he(!0),()=>{const at=We.current.instance;at.dispose();const ze=at.getModel();ze&&ze.dispose(),We.current.subscription&&We.current.subscription.dispose(),Rt.unobserve(tt.current)}}catch(Te){}})},[]),(0,Z.useEffect)(()=>{if(We.current.instance&&Ge)return document.addEventListener("keydown",Qe,!1),()=>{document.removeEventListener("keydown",Qe)}},[ue,Ge]),(0,Z.useEffect)(()=>{let se=We.current.instance;if(se&&Ge){let Te=re(Ie);$.editor.setModelLanguage(se.getModel(),Te)}},[Ie,Ge]),(0,Z.useEffect)(()=>{We.current.instance&&Ge&&$.editor.setTheme(ie)},[ie,Ge]),(0,Z.useEffect)(()=>{let se=We.current.instance;ot.current=Ke,se&&Ge&&(se.updateOptions(T({},Ke)),setTimeout(()=>{se.getModel().updateOptions(T({},Ke))},200))},[JSON.stringify(Ke),Ge]),(0,Z.useEffect)(()=>{let se=We.current.instance;se&&Ge&&se.layout()},[Ae,Be,Ge]);const[P,N]=(0,Z.useState)(M(Ae)),[W,H]=(0,Z.useState)(M(Be)),oe=y(T({},pe),{width:P,height:W,position:"relative"});return Z.createElement("div",{className:"my-monaco-editor",ref:tt,style:oe},q&&Z.createElement(L.CopyToClipboard,{text:Le,onCopy:()=>v.ZP.success("\u590D\u5236\u6210\u529F")},Z.createElement(E.Z,{title:"\u590D\u5236\u4EE3\u7801"},Z.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},Z.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function _e({width:fe="100%",height:me="100%",original:Ae,modified:Be,language:Le,options:Ie={}}){const pe=(0,Z.useRef)(),[Ke,Ce]=(0,Z.useState)(null);function ie(ee){let z;return pe.current&&(z=new ae.Z(ne=>{for(let ce of ne)(ce.target.offsetHeight>0||ce.target.offsetWidth>0)&&ee.layout()}),z.observe(pe.current)),z}(0,Z.useEffect)(()=>(pe.current&&Promise.all([j.e(5552),j.e(9404)]).then(j.bind(j,50048)).then(ee=>{$=ee;const z=$.editor.createDiffEditor(pe.current,y(T({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ie),{wordWrap:!0}));Ce(z);let ne=ie(z);return()=>{z.dispose();const ce=z.getModel();ce&&ce.dispose(),ne.unobserve(pe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,Z.useEffect)(()=>{Ke&&Ke.setModel({original:$.editor.createModel(Ae,Le),modified:$.editor.createModel(Be,Le)})},[Ae,Be,Le,Ke]);const X=M(fe),q=M(me),ue={width:X,height:q};return Z.createElement("div",{className:"my-diff-editor",ref:pe,style:ue})}},99914:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return ae}});var Z=j(67294);function ae(Q,K){const C=(0,Z.useRef)();(0,Z.useEffect)(()=>{C.current=Q}),(0,Z.useEffect)(()=>{function k(){C.current()}if(K!==null){let O=setInterval(k,K);return()=>clearInterval(O)}},[K])}},28805:function(Et,Fe,j){"use strict";j.r(Fe),j.d(Fe,{default:function(){return z},formatQuery:function(){return ue}});var Z=j(67294),ae=j(35973),Q=j(74330),K={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},C=j(19575),k=j(6104),O=j(62844),B=j(57097),e=j(59637),I=j(32983),w={contentWrap:"contentWrap___xMJQi",title:"title___z4t4P",footer:"footer___CLzrT",footer_left:"footer_left___N2sZZ",footer_bfcs:"footer_bfcs___UmvUE",footer_bfcs_value:"footer_bfcs_value___yiYga",pingfen:"pingfen___aEEMe",fenshu:"fenshu___I6HCo",radioGroup:"radioGroup___RT1dL",wrap:"wrap___QZGSJ",introName:"introName___m17tA",rating:"rating___MXLBr",modalRating:"modalRating___aluwj",zdbf:"zdbf___9PNEF"},u=j(99914),p=j(56188),c=j(28706),m=j(67294),l=Object.defineProperty,g=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(ne,ce,ge)=>ce in ne?l(ne,ce,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ne[ce]=ge,n=(ne,ce)=>{for(var ge in ce||(ce={}))_.call(ce,ge)&&s(ne,ge,ce[ge]);if(g)for(var ge of g(ce))o.call(ce,ge)&&s(ne,ge,ce[ge]);return ne},r=(ne,ce)=>{var ge={};for(var ke in ne)_.call(ne,ke)&&ce.indexOf(ke)<0&&(ge[ke]=ne[ke]);if(ne!=null&&g)for(var ke of g(ne))ce.indexOf(ke)<0&&o.call(ne,ke)&&(ge[ke]=ne[ke]);return ge},v=(ne,ce,ge)=>new Promise((ke,$e)=>{var ft=xe=>{try{Re(ge.next(xe))}catch(Ue){$e(Ue)}},Ne=xe=>{try{Re(ge.throw(xe))}catch(Ue){$e(Ue)}},Re=xe=>xe.done?ke(xe.value):Promise.resolve(xe.value).then(ft,Ne);Re((ge=ge.apply(ne,ce)).next())});const E=ne=>{var ce=ne,{videoDetail:ge,globalSetting:ke,loading:$e,dispatch:ft}=ce,Ne=r(ce,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Re,selectParams:xe,videoList:Ue}=ge,{subject_id:ye,videoId:it}=Re,{checkBoxValue:rt,radioValue:tt}=xe,We={videoId:it},ot={query:Re},_t=(0,Z.useRef)(),St=(0,Z.useRef)(),gt=(0,Z.useRef)(),wt=(0,Z.useRef)(5),{video_item:mt}=ge.detail||{};(0,u.Z)(()=>v(void 0,null,function*(){St.current&&(console.log("videoRef lastUpdatedTime: ",_t.current.getLastUpdatedTime()),console.log(_t.current),yield Ct())}),wt.current*1e3);const Ct=(Qe=!1)=>{const Xe=Qe?{is_f:1}:{};return(0,p.DH)(n(n({},Xe),{id:We.videoId,point:_t.current.getLastUpdatedTime(),total:_t.current.getDuration()}))},Ge=Qe=>(Qe.ed==="1"&&(St.current=!1,Ct(!0)),!St.current&&!Qe.ed&&(St.current=!0,wt.current=_t.current.getDuration()<=5?1:5,Ct()),ft({type:"userDetail/logWatchHistory",payload:Qe})),he=()=>{St.current=!1},De=()=>{St.current=!0},be=()=>{gt.current=5,O.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:m.createElement("div",{className:"tc font14"},m.createElement(B.Z,{defaultValue:gt.current,onChange:Qe=>gt.current=Qe,className:w.modalRating})),onOk:()=>v(void 0,null,function*(){if((yield(0,p.jK)({id:We.videoId,star:gt.current})).status===0){const{course_id:Xe}=(0,c.oP)();ft({type:"videoDetail/getVideoDetail",payload:{id:We.videoId,videoId:We.videoId,course_id:Xe,subject_id:ye}})}})})},Ee=Qe=>{const Xe=window.filterVideoSign,He=Xe.findIndex(H=>H.id===it);if(He===Xe.length-1)return;const x=Xe[He+1].id,P=Xe[He+1].can_view,N=Xe[He+1].link,W=Xe[He+1].is_public;if(window.checkBoxValue){if(N){window.open(N);return}if(!P){O.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:m.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!W){O.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:m.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}ft({type:"videoDetail/handleListItemClick",payload:{videoId:x}}),window.videoTimer=setTimeout(()=>{Qe.current.play()},2e3)}},je=(Qe,Xe)=>{if(Qe==="checkBox"){const He=Xe;window.checkBoxValue=He,ft({type:"videoDetail/setSelectValue",payload:{radioValue:tt,checkBoxValue:He}});return}ft({type:"videoDetail/setSelectValue",payload:{checkBoxValue:rt,radioValue:Xe.target.value}})},Je=()=>Ue.findIndex(He=>He.id===it)===Ue.length-1?m.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):m.createElement("div",null,m.createElement(e.Z,{onChange:He=>{je("checkBox",He)},defaultChecked:rt,size:"small"}),m.createElement("span",{className:w.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return m.createElement("aside",{className:w.contentWrap},m.createElement("aside",{className:w.wrap},m.createElement("header",null),m.createElement("div",{className:w.title},mt==null?void 0:mt.name),!(mt!=null&&mt.can_edit)&&!(mt!=null&&mt.is_public)?m.createElement(I.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):m.createElement(k.Z,{ref:_t,startTime:mt==null?void 0:mt.last_point,src:mt!=null&&mt.is_link?mt==null?void 0:mt.link:(mt==null?void 0:mt.play_url)&&C.Base64.decode(mt==null?void 0:mt.play_url),videoId:mt==null?void 0:mt.video_id,logWatchHistory:Ge,handlePause:he,handlePlay:De,allow_skip:mt==null?void 0:mt.allow_skip,handlePlayEnded:Ee,toLog:()=>{}}),m.createElement("div",{className:w.footer},m.createElement("div",{className:w.footer_left},m.createElement("div",{className:w.pingfen},"\u8BC4\u5206"),m.createElement(B.Z,{value:mt==null?void 0:mt.star,disabled:!0,className:w.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),m.createElement("div",{className:w.fenshu},(mt==null?void 0:mt.star)||0,"\u5206")),!(mt!=null&&mt.can_edit)&&!(mt!=null&&mt.is_public)?null:m.createElement("div",null,m.createElement("div",{className:w.checkBox},Je()))),m.createElement("div",{className:"mt10"},(mt==null?void 0:mt.description)&&m.createElement("span",{className:w.introName},"\u7B80\u4ECB\uFF1A",mt.description))))};var f=(0,ae.connect)(({videoDetail:ne,loading:ce,globalSetting:ge})=>({videoDetail:ne,globalSetting:ge,loading:ce}))(E),S=j(2453),L=j(51380),A={flex_box_center:"flex_box_center___yWqSL",flex_space_between:"flex_space_between___LgFmv",flex_box_vertical_center:"flex_box_vertical_center____lt6U",flex_box_center_end:"flex_box_center_end___UqkaD",flex_box_column:"flex_box_column___V8XLF",list:"list___8tjfT",tree_style:"tree_style___ZzDvO",title:"title___IVfkQ",gray:"gray___RnyYk",brght:"brght___EWRNa",s1:"s1___dPBQg",s3:"s3___SRBBG",active:"active___hsNCX",tree_line:"tree_line___EGn30",tabs_style:"tabs_style___Nwkiq",tabs_item:"tabs_item___Vzu_U",tabs_item_active:"tabs_item_active___BcIwZ"},D=j(15835),a=j(93686),i=j(11320),t=j(67294),h=Object.defineProperty,b=Object.defineProperties,T=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,M=(ne,ce,ge)=>ce in ne?h(ne,ce,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ne[ce]=ge,F=(ne,ce)=>{for(var ge in ce||(ce={}))d.call(ce,ge)&&M(ne,ge,ce[ge]);if(y)for(var ge of y(ce))R.call(ce,ge)&&M(ne,ge,ce[ge]);return ne},U=(ne,ce)=>b(ne,T(ce)),V=(ne,ce)=>{var ge={};for(var ke in ne)d.call(ne,ke)&&ce.indexOf(ke)<0&&(ge[ke]=ne[ke]);if(ne!=null&&y)for(var ke of y(ne))ce.indexOf(ke)<0&&R.call(ne,ke)&&(ge[ke]=ne[ke]);return ge},re=(ne,ce,ge)=>new Promise((ke,$e)=>{var ft=xe=>{try{Re(ge.next(xe))}catch(Ue){$e(Ue)}},Ne=xe=>{try{Re(ge.throw(xe))}catch(Ue){$e(Ue)}},Re=xe=>xe.done?ke(xe.value):Promise.resolve(xe.value).then(ft,Ne);Re((ge=ge.apply(ne,ce)).next())});const $=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:t.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:t.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:A.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:t.createElement("i",{className:"iconfont icon-shipin font20"}),bq:t.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:A.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:t.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:t.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:A.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:t.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:t.createElement("span",null)}],le=ne=>{var ce=ne,{dispatch:ge,pathsDetail:ke,videoDetail:$e,user:ft}=ce,Ne=V(ce,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Re,stages:xe,cust_seq:Ue,active:ye}=$e,{subject_id:it,course_id:rt}=Re,tt=(0,ae.useParams)(),[We]=(0,ae.useSearchParams)(),[ot,_t]=(0,Z.useState)([]),[St,gt]=(0,Z.useState)([(ye==null?void 0:ye.id)||Number(tt.videoId)]),[wt,mt]=(0,Z.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),Ct=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,Z.useEffect)(()=>{ge(it?{type:"videoDetail/getStageData",payload:{subject_id:it,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:rt}})},[]),(0,Z.useEffect)(()=>{Ge()},[$e==null?void 0:$e.stages]);const Ge=()=>{let He=ot;xe.forEach((Se,x)=>{He.push({title:t.createElement("div",{title:Se.stage_name,className:A.title},Se.stage_name),value:Se==null?void 0:Se.stage_id,key:Se==null?void 0:Se.stage_id,icon:t.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:he(Se.items||[])})}),_t(He)},he=He=>{function Se(x){var P;const N=x.children,W=Array.isArray(N)&&N.length>0,H=x==null?void 0:x.id,{name:oe,item_type:se,id:Te}=x,we=(P=$.find(Tt=>Tt.type===se))==null?void 0:P.bq,Ze=A.brght,dt=ye.id===Te?`${Ze} ${A.active}`:Ze;return{title:t.createElement("div",{onClick:()=>je(x),className:Ze,title:oe},we,t.createElement("div",{className:A.s3},oe)),value:H,key:H,icon:t.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:W?N==null?void 0:N.map(Tt=>Se(Tt)):[]}}return He==null?void 0:He.map(x=>Se(x))},De=(He,Se)=>re(void 0,null,function*(){ge({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u7A0D\u540E..."}});const x=Se?yield(0,a.BK)({id:He}):yield(0,a.Ir)({id:He});if(ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),x!=null&&x.game_identifier||x!=null&&x.identifier){(0,c.xg)(Se?`/tasks/${x==null?void 0:x.identifier}/jupyter`:`/tasks/${x.game_identifier}`);return}(x==null?void 0:x.status)===2?Ee(x==null?void 0:x.message):(x==null?void 0:x.status)===3&&be(x==null?void 0:x.message)}),be=He=>{O.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",He,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Ee=He=>{He=He!=null&&He.includes(".json")?He:`${He}.json`,O.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>re(void 0,null,function*(){const Se=yield(0,D.L8)({url:He});if(!Se)return;S.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const x=yield(0,a.Ir)({id:Se.shixun_identifier});if(x!=null&&x.game_identifier){(0,c.xg)(`/tasks/${x.game_identifier}`);return}(x==null?void 0:x.status)===2?Ee(x==null?void 0:x.message):(x==null?void 0:x.status)===3&&be(x==null?void 0:x.message)})})},je=He=>{var Se,x,P,N,W;if((He==null?void 0:He.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:H,item_type:oe,identifier:se,is_jupyter:Te,url:we,link:Ze}=He;if(oe==="VideoItem"&&!Ze){if(!((Se=ft.userInfo)!=null&&Se.admin)&&!((x=ft.userInfo)!=null&&x.business)&&!He.can_view){O.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:t.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}ge({type:"videoDetail/handleListItemClick",payload:{videoId:H}}),ge({type:"videoDetail/getVideoDetail",payload:U(F({id:H},Re),{videoId:H}),callback:dt=>{if(dt&&dt.video_item&&!dt.video_item.can_edit&&!He.is_public){O.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:t.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(oe==="VideoItem"&&Ze){He.link&&(0,p.DH)({is_f:1,id:He.id,point:0,total:0}),window.open(Ze);return}if(oe==="Shixun"){De(se,Te);return}if(oe==="Attachment"){if(Ze){(0,c.xg)(Ze);return}let dt=(N=He==null?void 0:He.name)==null?void 0:N.substr((P=He==null?void 0:He.name)==null?void 0:P.lastIndexOf("."));if(Ct.includes(dt.toUpperCase())){ge({type:"videoDetail/handleListItemClick",payload:{attachmentId:H}});return}else{if(!((W=ke.detail)!=null&&W.allow_download)){S.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,c.FH)(He.name,i.Z.API_SERVER+He.url);return}}window.open(i.Z.IMG_SERVER+we)},Je=He=>{let Se=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],x=["","\u5341","\u767E","\u5343","\u4E07"];He=parseInt(He);let P=H=>{let oe=H.toString().split("").reverse(),se="";for(var Te=0;Te<oe.length;Te++)se=(Te==0&&oe[Te]==0||Te>0&&oe[Te]==0&&oe[Te-1]==0?"":Se[oe[Te]]+(oe[Te]==0?x[0]:x[Te]))+se;return se},N=Math.floor(He/1e4),W=He%1e4;return W.toString().length<4&&(W="0"+W),N?P(N)+"\u4E07"+P(W):P(He)},Qe=(He,Se,x,P)=>{var N;const{name:W,item_type:H,id:oe}=He,se=`${Se+1}-${x+1}-${P+1}`,Te=(N=$.find(dt=>dt.type===H))==null?void 0:N.icon,we=A.brght,Ze=ye.id===oe?`${we} ${A.active}`:we;return t.createElement("div",{key:se,onClick:()=>je(He),className:Ze,style:{paddingLeft:52}},t.createElement("span",{className:A.s1},Te),!!Ue&&t.createElement("span",{className:A.s2},se),t.createElement("span",{className:A.s3},"\u203B ",W))},Xe=(He,Se,x)=>{var P;const{name:N,item_type:W,id:H,children:oe}=He,se=`${Se+1}-${x+1}`,Te=(P=$.find(dt=>dt.type===W))==null?void 0:P.icon,we=A.brght,Ze=ye.id===H?`${we} ${A.active}`:we;return t.createElement(Z.Fragment,{key:se},t.createElement("div",{onClick:()=>je(He),className:Ze},t.createElement("span",{className:A.s1},Te),!!Ue&&t.createElement("span",{className:A.s2},se),t.createElement("span",{className:A.s3},"\u203B ",N)),!!oe.length&&oe.map((dt,Tt)=>Qe(dt,Se,x,Tt)))};return t.createElement("aside",{className:A.list},t.createElement("div",{className:A.tabs_style},t.createElement("div",{className:A.tabs_item,onClick:()=>{mt("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",wt=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&t.createElement("div",{className:A.tabs_item_active}))),t.createElement("div",{className:A.tree_style},(ot==null?void 0:ot.length)>0&&t.createElement(L.default,{selectedKeys:St,onSelect:(He,Se)=>{gt([...He])},blockNode:!0,treeData:ot,defaultExpandAll:!0,className:A.tree_line})))};var te=(0,ae.connect)(({user:ne,videoDetail:ce,loading:ge,globalSetting:ke,pathsDetail:$e})=>({user:ne,videoDetail:ce,globalSetting:ke,loading:ge,pathsDetail:$e}))(le),_e=j(20819),fe=j(67294),me=Object.defineProperty,Ae=Object.defineProperties,Be=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,Ke=(ne,ce,ge)=>ce in ne?me(ne,ce,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ne[ce]=ge,Ce=(ne,ce)=>{for(var ge in ce||(ce={}))Ie.call(ce,ge)&&Ke(ne,ge,ce[ge]);if(Le)for(var ge of Le(ce))pe.call(ce,ge)&&Ke(ne,ge,ce[ge]);return ne},ie=(ne,ce)=>Ae(ne,Be(ce)),X=(ne,ce)=>{var ge={};for(var ke in ne)Ie.call(ne,ke)&&ce.indexOf(ke)<0&&(ge[ke]=ne[ke]);if(ne!=null&&Le)for(var ke of Le(ne))ce.indexOf(ke)<0&&pe.call(ne,ke)&&(ge[ke]=ne[ke]);return ge},q=(ne,ce,ge)=>new Promise((ke,$e)=>{var ft=xe=>{try{Re(ge.next(xe))}catch(Ue){$e(Ue)}},Ne=xe=>{try{Re(ge.throw(xe))}catch(Ue){$e(Ue)}},Re=xe=>xe.done?ke(xe.value):Promise.resolve(xe.value).then(ft,Ne);Re((ge=ge.apply(ne,ce)).next())});const ue=ne=>{const{subject_id:ce}=ne;return{subject_id:ce,course_id:ce}},ee=ne=>{var ce=ne,{videoDetail:ge,globalSetting:ke,loading:$e,pathsDetail:ft,dispatch:Ne}=ce,Re=X(ce,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),xe,Ue;const{queryParams:ye,videoList:it,attachmentList:rt,active:tt}=ge,{subject_id:We,videoId:ot}=ye,_t={videoId:ot};(0,Z.useEffect)(()=>{if(tt){const{item_type:wt,id:mt}=tt;wt==="VideoItem"&&Ne({type:"videoDetail/getVideoDetail",payload:ie(Ce({},ye),{id:mt})})}},[tt.id]),console.log("---",tt),(0,Z.useEffect)(()=>{We&&St()},[]);function St(){return q(this,null,function*(){const wt=yield Ne({type:"pathsDetail/getPathsDetail",payload:{id:We}})})}(0,Z.useEffect)(()=>{var wt,mt;(0,c.Dk)((mt=(wt=ge.detail)==null?void 0:wt.video_item)==null?void 0:mt.name)},[ge]);let gt={width:1200};return tt&&tt.item_type==="Attachment"&&tt.content_type==="application/pdf"&&(gt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),fe.createElement(Q.Z,{spinning:!1},fe.createElement("section",{className:K.bg},fe.createElement("div",{className:K.container,style:gt},fe.createElement(te,null),tt&&tt.item_type==="VideoItem"&&fe.createElement(f,null),tt&&tt.item_type==="Attachment"&&tt.content_type==="application/pdf"&&tt.url&&fe.createElement("div",{className:K.widthle},fe.createElement(_e.Z,{disabledDownload:!((xe=ft.detail)!=null&&xe.allow_download),type:"pdf",filename:tt.name,data:i.Z.API_SERVER+tt.url,style:{position:"absolute",zIndex:1}})),tt&&tt.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(tt.content_type)&&tt.url&&fe.createElement("div",{className:K.widthle},fe.createElement(_e.Z,{disabledDownload:!((Ue=ft.detail)!=null&&Ue.allow_download),type:"office",data:i.Z.API_SERVER+tt.url,style:{position:"absolute",zIndex:1}})))))};var z=(0,ae.connect)(({videoDetail:ne,loading:ce,globalSetting:ge,pathsDetail:ke})=>({videoDetail:ne,globalSetting:ge,loading:ce,pathsDetail:ke}))(ee)},51959:function(Et,Fe,j){"use strict";j.d(Fe,{BU:function(){return ae},Dj:function(){return Z},gH:function(){return Q},vp:function(){return K}});function Z(C){try{C.mozRequestFullScreen?C.mozRequestFullScreen():C.webkitRequestFullScreen&&C.webkitRequestFullScreen()}catch(k){console.log(k,":e")}}function ae(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const Q=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function K(){var C=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,k=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",C),window.isFullScreen?window.isFullScreen:C!=null}},24577:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return He}});class Z{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(x,P){return x.__proto__=P,x},Object.assign=Object.assign||function(x){if(x==null)throw new TypeError("Cannot convert undefined or null to object");let P=Object(x);for(let N=1;N<arguments.length;N++){let W=arguments[N];if(W!=null)for(let H in W)W.hasOwnProperty(H)&&(P[H]=W[H])}return P},typeof self.Promise!="function"&&j(82702).polyfill()}}Z.install();var ae=Z,Q=j(17187),K=j.n(Q);class C{static e(x,P){(!x||C.FORCE_GLOBAL_TAG)&&(x=C.GLOBAL_TAG);let N=`[${x}] > ${P}`;C.ENABLE_CALLBACK&&C.emitter.emit("log","error",N),C.ENABLE_ERROR&&(console.error?console.error(N):console.warn?console.warn(N):console.log(N))}static i(x,P){(!x||C.FORCE_GLOBAL_TAG)&&(x=C.GLOBAL_TAG);let N=`[${x}] > ${P}`;C.ENABLE_CALLBACK&&C.emitter.emit("log","info",N),C.ENABLE_INFO&&(console.info?console.info(N):console.log(N))}static w(x,P){(!x||C.FORCE_GLOBAL_TAG)&&(x=C.GLOBAL_TAG);let N=`[${x}] > ${P}`;C.ENABLE_CALLBACK&&C.emitter.emit("log","warn",N),C.ENABLE_WARN&&(console.warn?console.warn(N):console.log(N))}static d(x,P){(!x||C.FORCE_GLOBAL_TAG)&&(x=C.GLOBAL_TAG);let N=`[${x}] > ${P}`;C.ENABLE_CALLBACK&&C.emitter.emit("log","debug",N),C.ENABLE_DEBUG&&(console.debug?console.debug(N):console.log(N))}static v(x,P){(!x||C.FORCE_GLOBAL_TAG)&&(x=C.GLOBAL_TAG);let N=`[${x}] > ${P}`;C.ENABLE_CALLBACK&&C.emitter.emit("log","verbose",N),C.ENABLE_VERBOSE&&console.log(N)}}C.GLOBAL_TAG="flv.js",C.FORCE_GLOBAL_TAG=!1,C.ENABLE_ERROR=!0,C.ENABLE_INFO=!0,C.ENABLE_WARN=!0,C.ENABLE_DEBUG=!0,C.ENABLE_VERBOSE=!0,C.ENABLE_CALLBACK=!1,C.emitter=new(K());var k=C;class O{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(x){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=x,this._totalBytes+=x):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=x,this._totalBytes+=x):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=x,this._totalBytes+=x,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let x=(this._now()-this._lastCheckpoint)/1e3;return x==0&&(x=1),this._intervalBytes/x/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let x=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/x/1024}}var B=O;class e{constructor(x){this._message=x}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class I extends e{constructor(x){super(x)}get name(){return"IllegalStateException"}}class w extends e{constructor(x){super(x)}get name(){return"InvalidArgumentException"}}class u extends e{constructor(x){super(x)}get name(){return"NotImplementedException"}}const p={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},c={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class m{constructor(x){this._type=x||"undefined",this._status=p.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=p.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===p.kConnecting||this._status===p.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(x){this._onContentLengthKnown=x}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(x){this._onURLRedirect=x}get onDataArrival(){return this._onDataArrival}set onDataArrival(x){this._onDataArrival=x}get onError(){return this._onError}set onError(x){this._onError=x}get onComplete(){return this._onComplete}set onComplete(x){this._onComplete=x}open(x,P){throw new u("Unimplemented abstract function!")}abort(){throw new u("Unimplemented abstract function!")}}let l={};function g(){let Se=self.navigator.userAgent.toLowerCase(),x=/(edge)\/([\w.]+)/.exec(Se)||/(opr)[\/]([\w.]+)/.exec(Se)||/(chrome)[ \/]([\w.]+)/.exec(Se)||/(iemobile)[\/]([\w.]+)/.exec(Se)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Se)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Se)||/(webkit)[ \/]([\w.]+)/.exec(Se)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Se)||/(msie) ([\w.]+)/.exec(Se)||Se.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Se)||Se.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Se)||[],P=/(ipad)/.exec(Se)||/(ipod)/.exec(Se)||/(windows phone)/.exec(Se)||/(iphone)/.exec(Se)||/(kindle)/.exec(Se)||/(android)/.exec(Se)||/(windows)/.exec(Se)||/(mac)/.exec(Se)||/(linux)/.exec(Se)||/(cros)/.exec(Se)||[],N={browser:x[5]||x[3]||x[1]||"",version:x[2]||x[4]||"0",majorVersion:x[4]||x[2]||"0",platform:P[0]||""},W={};if(N.browser){W[N.browser]=!0;let H=N.majorVersion.split(".");W.version={major:parseInt(N.majorVersion,10),string:N.version},H.length>1&&(W.version.minor=parseInt(H[1],10)),H.length>2&&(W.version.build=parseInt(H[2],10))}if(N.platform&&(W[N.platform]=!0),(W.chrome||W.opr||W.safari)&&(W.webkit=!0),W.rv||W.iemobile){W.rv&&delete W.rv;let H="msie";N.browser=H,W[H]=!0}if(W.edge){delete W.edge;let H="msedge";N.browser=H,W[H]=!0}if(W.opr){let H="opera";N.browser=H,W[H]=!0}if(W.safari&&W.android){let H="android";N.browser=H,W[H]=!0}W.name=N.browser,W.platform=N.platform;for(let H in l)l.hasOwnProperty(H)&&delete l[H];Object.assign(l,W)}g();var _=l;class o extends m{static isSupported(){try{let x=_.msedge&&_.version.minor>=15048,P=_.msedge?x:!0;return self.fetch&&self.ReadableStream&&P}catch(x){return!1}}constructor(x,P){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=x,this._config=P,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(x,P){this._dataSource=x,this._range=P;let N=x.url;this._config.reuseRedirectedURL&&x.redirectedURL!=null&&(N=x.redirectedURL);let W=this._seekHandler.getConfig(N,P),H=new self.Headers;if(typeof W.headers=="object"){let se=W.headers;for(let Te in se)se.hasOwnProperty(Te)&&H.append(Te,se[Te])}let oe={method:"GET",headers:H,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let se in this._config.headers)H.append(se,this._config.headers[se]);x.cors===!1&&(oe.mode="same-origin"),x.withCredentials&&(oe.credentials="include"),x.referrerPolicy&&(oe.referrerPolicy=x.referrerPolicy),this._status=p.kConnecting,self.fetch(W.url,oe).then(se=>{if(this._requestAbort){this._requestAbort=!1,this._status=p.kIdle;return}if(se.ok&&se.status>=200&&se.status<=299){if(se.url!==W.url&&this._onURLRedirect){let we=this._seekHandler.removeURLParameters(se.url);this._onURLRedirect(we)}let Te=se.headers.get("Content-Length");return Te!=null&&(this._contentLength=parseInt(Te),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,se.body.getReader())}else if(this._status=p.kError,this._onError)this._onError(c.HTTP_STATUS_CODE_INVALID,{code:se.status,msg:se.statusText});else throw new e("FetchStreamLoader: Http code invalid, "+se.status+" "+se.statusText)}).catch(se=>{if(this._status=p.kError,this._onError)this._onError(c.EXCEPTION,{code:-1,msg:se.message});else throw se})}abort(){this._requestAbort=!0}_pump(x){return x.read().then(P=>{if(P.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=p.kError;let N=c.EARLY_EOF,W={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(N,W);else throw new e(W.msg)}else this._status=p.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=p.kComplete,x.cancel();this._status=p.kBuffering;let N=P.value.buffer,W=this._range.from+this._receivedLength;this._receivedLength+=N.byteLength,this._onDataArrival&&this._onDataArrival(N,W,this._receivedLength),this._pump(x)}}).catch(P=>{if(P.code===11&&_.msedge)return;this._status=p.kError;let N=0,W=null;if((P.code===19||P.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(N=c.EARLY_EOF,W={code:P.code,msg:"Fetch stream meet Early-EOF"}):(N=c.EXCEPTION,W={code:P.code,msg:P.message}),this._onError)this._onError(N,W);else throw new e(W.msg)})}}var s=o;class n extends m{static isSupported(){try{let x=new XMLHttpRequest;return x.open("GET","https://example.com",!0),x.responseType="moz-chunked-arraybuffer",x.responseType==="moz-chunked-arraybuffer"}catch(x){return k.w("MozChunkedLoader",x.message),!1}}constructor(x,P){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=x,this._config=P,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(x,P){this._dataSource=x,this._range=P;let N=x.url;this._config.reuseRedirectedURL&&x.redirectedURL!=null&&(N=x.redirectedURL);let W=this._seekHandler.getConfig(N,P);this._requestURL=W.url;let H=this._xhr=new XMLHttpRequest;if(H.open("GET",W.url,!0),H.responseType="moz-chunked-arraybuffer",H.onreadystatechange=this._onReadyStateChange.bind(this),H.onprogress=this._onProgress.bind(this),H.onloadend=this._onLoadEnd.bind(this),H.onerror=this._onXhrError.bind(this),x.withCredentials&&(H.withCredentials=!0),typeof W.headers=="object"){let oe=W.headers;for(let se in oe)oe.hasOwnProperty(se)&&H.setRequestHeader(se,oe[se])}if(typeof this._config.headers=="object"){let oe=this._config.headers;for(let se in oe)oe.hasOwnProperty(se)&&H.setRequestHeader(se,oe[se])}this._status=p.kConnecting,H.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=p.kComplete}_onReadyStateChange(x){let P=x.target;if(P.readyState===2){if(P.responseURL!=null&&P.responseURL!==this._requestURL&&this._onURLRedirect){let N=this._seekHandler.removeURLParameters(P.responseURL);this._onURLRedirect(N)}if(P.status!==0&&(P.status<200||P.status>299))if(this._status=p.kError,this._onError)this._onError(c.HTTP_STATUS_CODE_INVALID,{code:P.status,msg:P.statusText});else throw new e("MozChunkedLoader: Http code invalid, "+P.status+" "+P.statusText);else this._status=p.kBuffering}}_onProgress(x){if(this._status===p.kError)return;this._contentLength===null&&x.total!==null&&x.total!==0&&(this._contentLength=x.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let P=x.target.response,N=this._range.from+this._receivedLength;this._receivedLength+=P.byteLength,this._onDataArrival&&this._onDataArrival(P,N,this._receivedLength)}_onLoadEnd(x){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===p.kError)return;this._status=p.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(x){this._status=p.kError;let P=0,N=null;if(this._contentLength&&x.loaded<this._contentLength?(P=c.EARLY_EOF,N={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(P=c.EXCEPTION,N={code:-1,msg:x.constructor.name+" "+x.type}),this._onError)this._onError(P,N);else throw new e(N.msg)}}var r=n;class v extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let x=new XMLHttpRequest;return x.open("GET","https://example.com",!0),x.responseType="ms-stream",x.responseType==="ms-stream"}catch(x){return Log.w("MSStreamLoader",x.message),!1}}constructor(x,P){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=x,this._config=P,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(x,P){this._internalOpen(x,P,!1)}_internalOpen(x,P,N){this._dataSource=x,N?this._currentRange=P:this._totalRange=P;let W=x.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?W=this._currentRedirectedURL:x.redirectedURL!=null&&(W=x.redirectedURL));let H=this._seekHandler.getConfig(W,P);this._currentRequestURL=H.url;let oe=this._reader=new self.MSStreamReader;oe.onprogress=this._msrOnProgress.bind(this),oe.onload=this._msrOnLoad.bind(this),oe.onerror=this._msrOnError.bind(this);let se=this._xhr=new XMLHttpRequest;if(se.open("GET",H.url,!0),se.responseType="ms-stream",se.onreadystatechange=this._xhrOnReadyStateChange.bind(this),se.onerror=this._xhrOnError.bind(this),x.withCredentials&&(se.withCredentials=!0),typeof H.headers=="object"){let Te=H.headers;for(let we in Te)Te.hasOwnProperty(we)&&se.setRequestHeader(we,Te[we])}if(typeof this._config.headers=="object"){let Te=this._config.headers;for(let we in Te)Te.hasOwnProperty(we)&&se.setRequestHeader(we,Te[we])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,se.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(x){let P=x.target;if(P.readyState===2)if(P.status>=200&&P.status<=299){if(this._status=LoaderStatus.kBuffering,P.responseURL!=null){let W=this._seekHandler.removeURLParameters(P.responseURL);P.responseURL!==this._currentRequestURL&&W!==this._currentRedirectedURL&&(this._currentRedirectedURL=W,this._onURLRedirect&&this._onURLRedirect(W))}let N=P.getResponseHeader("Content-Length");if(N!=null&&this._contentLength==null){let W=parseInt(N);W>0&&(this._contentLength=W,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:P.status,msg:P.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+P.status+" "+P.statusText);else if(P.readyState===3&&P.status>=200&&P.status<=299){this._status=LoaderStatus.kBuffering;let N=P.response;this._reader.readAsArrayBuffer(N)}}_xhrOnError(x){this._status=LoaderStatus.kError;let P=LoaderErrors.EXCEPTION,N={code:-1,msg:x.constructor.name+" "+x.type};if(this._onError)this._onError(P,N);else throw new RuntimeException(N.msg)}_msrOnProgress(x){let N=x.target.result;if(N==null){this._doReconnectIfNeeded();return}let W=N.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=N.byteLength;let H=this._totalRange.from+this._receivedLength;this._receivedLength+=W.byteLength,this._onDataArrival&&this._onDataArrival(W,H,this._receivedLength),N.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${H+W.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let x={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,x,!0)}}_msrOnLoad(x){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(x){this._status=LoaderStatus.kError;let P=0,N=null;if(this._contentLength&&this._receivedLength<this._contentLength?(P=LoaderErrors.EARLY_EOF,N={code:-1,msg:"MSStream meet Early-Eof"}):(P=LoaderErrors.EARLY_EOF,N={code:-1,msg:x.constructor.name+" "+x.type}),this._onError)this._onError(P,N);else throw new RuntimeException(N.msg)}}var E=null;class f extends m{static isSupported(){try{let x=new XMLHttpRequest;return x.open("GET","https://example.com",!0),x.responseType="arraybuffer",x.responseType==="arraybuffer"}catch(x){return k.w("RangeLoader",x.message),!1}}constructor(x,P){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=x,this._config=P,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new B,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(x,P){this._dataSource=x,this._range=P,this._status=p.kConnecting;let N=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(N=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!N?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let x=this._currentChunkSizeKB*1024,P=this._range.from+this._receivedLength,N=P+x;this._contentLength!=null&&N-this._range.from>=this._contentLength&&(N=this._range.from+this._contentLength-1),this._currentRequestRange={from:P,to:N},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(x,P){this._lastTimeLoaded=0;let N=x.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?N=this._currentRedirectedURL:x.redirectedURL!=null&&(N=x.redirectedURL));let W=this._seekHandler.getConfig(N,P);this._currentRequestURL=W.url;let H=this._xhr=new XMLHttpRequest;if(H.open("GET",W.url,!0),H.responseType="arraybuffer",H.onreadystatechange=this._onReadyStateChange.bind(this),H.onprogress=this._onProgress.bind(this),H.onload=this._onLoad.bind(this),H.onerror=this._onXhrError.bind(this),x.withCredentials&&(H.withCredentials=!0),typeof W.headers=="object"){let oe=W.headers;for(let se in oe)oe.hasOwnProperty(se)&&H.setRequestHeader(se,oe[se])}if(typeof this._config.headers=="object"){let oe=this._config.headers;for(let se in oe)oe.hasOwnProperty(se)&&H.setRequestHeader(se,oe[se])}H.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=p.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(x){let P=x.target;if(P.readyState===2){if(P.responseURL!=null){let N=this._seekHandler.removeURLParameters(P.responseURL);P.responseURL!==this._currentRequestURL&&N!==this._currentRedirectedURL&&(this._currentRedirectedURL=N,this._onURLRedirect&&this._onURLRedirect(N))}if(P.status>=200&&P.status<=299){if(this._waitForTotalLength)return;this._status=p.kBuffering}else if(this._status=p.kError,this._onError)this._onError(c.HTTP_STATUS_CODE_INVALID,{code:P.status,msg:P.statusText});else throw new e("RangeLoader: Http code invalid, "+P.status+" "+P.statusText)}}_onProgress(x){if(this._status===p.kError)return;if(this._contentLength===null){let N=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,N=!0;let W=x.total;this._internalAbort(),W!=null&W!==0&&(this._totalLength=W)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,N){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let P=x.loaded-this._lastTimeLoaded;this._lastTimeLoaded=x.loaded,this._speedSampler.addBytes(P)}_normalizeSpeed(x){let P=this._chunkSizeKBList,N=P.length-1,W=0,H=0,oe=N;if(x<P[0])return P[0];for(;H<=oe;){if(W=H+Math.floor((oe-H)/2),W===N||x>=P[W]&&x<P[W+1])return P[W];P[W]<x?H=W+1:oe=W-1}}_onLoad(x){if(this._status===p.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let P=this._speedSampler.lastSecondKBps;if(P===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(P=this._speedSampler.currentKBps)),P!==0){let oe=this._normalizeSpeed(P);this._currentSpeedNormalized!==oe&&(this._currentSpeedNormalized=oe,this._currentChunkSizeKB=oe)}let N=x.target.response,W=this._range.from+this._receivedLength;this._receivedLength+=N.byteLength;let H=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():H=!0,this._onDataArrival&&this._onDataArrival(N,W,this._receivedLength),H&&(this._status=p.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(x){this._status=p.kError;let P=0,N=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(P=c.EARLY_EOF,N={code:-1,msg:"RangeLoader meet Early-Eof"}):(P=c.EXCEPTION,N={code:-1,msg:x.constructor.name+" "+x.type}),this._onError)this._onError(P,N);else throw new e(N.msg)}}var S=f;class L extends m{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(x){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(x){try{let P=this._ws=new self.WebSocket(x.url);P.binaryType="arraybuffer",P.onopen=this._onWebSocketOpen.bind(this),P.onclose=this._onWebSocketClose.bind(this),P.onmessage=this._onWebSocketMessage.bind(this),P.onerror=this._onWebSocketError.bind(this),this._status=p.kConnecting}catch(P){this._status=p.kError;let N={code:P.code,msg:P.message};if(this._onError)this._onError(c.EXCEPTION,N);else throw new e(N.msg)}}abort(){let x=this._ws;x&&(x.readyState===0||x.readyState===1)&&(this._requestAbort=!0,x.close()),this._ws=null,this._status=p.kComplete}_onWebSocketOpen(x){this._status=p.kBuffering}_onWebSocketClose(x){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=p.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(x){if(x.data instanceof ArrayBuffer)this._dispatchArrayBuffer(x.data);else if(x.data instanceof Blob){let P=new FileReader;P.onload=()=>{this._dispatchArrayBuffer(P.result)},P.readAsArrayBuffer(x.data)}else{this._status=p.kError;let P={code:-1,msg:"Unsupported WebSocket message type: "+x.data.constructor.name};if(this._onError)this._onError(c.EXCEPTION,P);else throw new e(P.msg)}}_dispatchArrayBuffer(x){let P=x,N=this._receivedLength;this._receivedLength+=P.byteLength,this._onDataArrival&&this._onDataArrival(P,N,this._receivedLength)}_onWebSocketError(x){this._status=p.kError;let P={code:x.code,msg:x.message};if(this._onError)this._onError(c.EXCEPTION,P);else throw new e(P.msg)}}var A=L;class D{constructor(x){this._zeroStart=x||!1}getConfig(x,P){let N={};if(P.from!==0||P.to!==-1){let W;P.to!==-1?W=`bytes=${P.from.toString()}-${P.to.toString()}`:W=`bytes=${P.from.toString()}-`,N.Range=W}else this._zeroStart&&(N.Range="bytes=0-");return{url:x,headers:N}}removeURLParameters(x){return x}}var a=D;class i{constructor(x,P){this._startName=x,this._endName=P}getConfig(x,P){let N=x;if(P.from!==0||P.to!==-1){let W=!0;N.indexOf("?")===-1&&(N+="?",W=!1),W&&(N+="&"),N+=`${this._startName}=${P.from.toString()}`,P.to!==-1&&(N+=`&${this._endName}=${P.to.toString()}`)}return{url:N,headers:{}}}removeURLParameters(x){let P=x.split("?")[0],N,W=x.indexOf("?");W!==-1&&(N=x.substring(W+1));let H="";if(N!=null&&N.length>0){let oe=N.split("&");for(let se=0;se<oe.length;se++){let Te=oe[se].split("="),we=se>0;Te[0]!==this._startName&&Te[0]!==this._endName&&(we&&(H+="&"),H+=oe[se])}}return H.length===0?P:P+"?"+H}}var t=i;class h{constructor(x,P,N){this.TAG="IOController",this._config=P,this._extraData=N,this._stashInitialSize=1024*384,P.stashInitialSize!=null&&P.stashInitialSize>0&&(this._stashInitialSize=P.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,P.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=x,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(x.url),this._refTotalLength=x.filesize?x.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new B,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(x){this._extraData=x}get onDataArrival(){return this._onDataArrival}set onDataArrival(x){this._onDataArrival=x}get onSeeked(){return this._onSeeked}set onSeeked(x){this._onSeeked=x}get onError(){return this._onError}set onError(x){this._onError=x}get onComplete(){return this._onComplete}set onComplete(x){this._onComplete=x}get onRedirect(){return this._onRedirect}set onRedirect(x){this._onRedirect=x}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(x){this._onRecoveredEarlyEof=x}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===S?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let x=this._config;if(x.seekType==="range")this._seekHandler=new a(this._config.rangeLoadZeroStart);else if(x.seekType==="param"){let P=x.seekParamStart||"bstart",N=x.seekParamEnd||"bend";this._seekHandler=new t(P,N)}else if(x.seekType==="custom"){if(typeof x.customSeekHandler!="function")throw new w("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new x.customSeekHandler}else throw new w(`Invalid seekType in config: ${x.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=A;else if(s.isSupported())this._loaderClass=s;else if(r.isSupported())this._loaderClass=r;else if(S.isSupported())this._loaderClass=S;else throw new e("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(x){this._currentRange={from:0,to:-1},x&&(this._currentRange.from=x),this._speedSampler.reset(),x||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let x=this._resumeFrom;this._resumeFrom=0,this._internalSeek(x,!0)}}seek(x){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(x,!0)}_internalSeek(x,P){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(P),this._loader.destroy(),this._loader=null;let N={from:x,to:-1};this._currentRange={from:N.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,N),this._onSeeked&&this._onSeeked()}updateUrl(x){if(!x||typeof x!="string"||x.length===0)throw new w("Url must be a non-empty string!");this._dataSource.url=x}_expandBuffer(x){let P=this._stashSize;for(;P+1024*1024*1<x;)P*=2;if(P+=1024*1024*1,P===this._bufferSize)return;let N=new ArrayBuffer(P);if(this._stashUsed>0){let W=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(N,0,P).set(W,0)}this._stashBuffer=N,this._bufferSize=P}_normalizeSpeed(x){let P=this._speedNormalizeList,N=P.length-1,W=0,H=0,oe=N;if(x<P[0])return P[0];for(;H<=oe;){if(W=H+Math.floor((oe-H)/2),W===N||x>=P[W]&&x<P[W+1])return P[W];P[W]<x?H=W+1:oe=W-1}}_adjustStashSize(x){let P=0;this._config.isLive||x<512?P=x:x>=512&&x<=1024?P=Math.floor(x*1.5):P=x*2,P>8192&&(P=8192);let N=P*1024+1024*1024*1;this._bufferSize<N&&this._expandBuffer(N),this._stashSize=P*1024}_dispatchChunks(x,P){return this._currentRange.to=P+x.byteLength-1,this._onDataArrival(x,P)}_onURLRedirect(x){this._redirectedURL=x,this._onRedirect&&this._onRedirect(x)}_onContentLengthKnown(x){x&&this._fullRequestFlag&&(this._totalLength=x,this._fullRequestFlag=!1)}_onLoaderChunkArrival(x,P,N){if(!this._onDataArrival)throw new I("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(x.byteLength);let W=this._speedSampler.lastSecondKBps;if(W!==0){let H=this._normalizeSpeed(W);this._speedNormalized!==H&&(this._speedNormalized=H,this._adjustStashSize(H))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=P),this._stashUsed+x.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(x),this._stashUsed),this._stashUsed+=x.byteLength;else{let H=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let oe=this._stashBuffer.slice(0,this._stashUsed),se=this._dispatchChunks(oe,this._stashByteStart);if(se<oe.byteLength){if(se>0){let Te=new Uint8Array(oe,se);H.set(Te,0),this._stashUsed=Te.byteLength,this._stashByteStart+=se}}else this._stashUsed=0,this._stashByteStart+=se;this._stashUsed+x.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+x.byteLength),H=new Uint8Array(this._stashBuffer,0,this._bufferSize)),H.set(new Uint8Array(x),this._stashUsed),this._stashUsed+=x.byteLength}else{let oe=this._dispatchChunks(x,P);if(oe<x.byteLength){let se=x.byteLength-oe;se>this._bufferSize&&(this._expandBuffer(se),H=new Uint8Array(this._stashBuffer,0,this._bufferSize)),H.set(new Uint8Array(x,oe),0),this._stashUsed+=se,this._stashByteStart=P+oe}}}else if(this._stashUsed===0){let H=this._dispatchChunks(x,P);if(H<x.byteLength){let oe=x.byteLength-H;oe>this._bufferSize&&this._expandBuffer(oe),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(x,H),0),this._stashUsed+=oe,this._stashByteStart=P+H}}else{this._stashUsed+x.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+x.byteLength);let H=new Uint8Array(this._stashBuffer,0,this._bufferSize);H.set(new Uint8Array(x),this._stashUsed),this._stashUsed+=x.byteLength;let oe=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(oe<this._stashUsed&&oe>0){let se=new Uint8Array(this._stashBuffer,oe);H.set(se,0)}this._stashUsed-=oe,this._stashByteStart+=oe}}_flushStashBuffer(x){if(this._stashUsed>0){let P=this._stashBuffer.slice(0,this._stashUsed),N=this._dispatchChunks(P,this._stashByteStart),W=P.byteLength-N;if(N<P.byteLength)if(x)k.w(this.TAG,`${W} bytes unconsumed data remain when flush buffer, dropped`);else{if(N>0){let H=new Uint8Array(this._stashBuffer,0,this._bufferSize),oe=new Uint8Array(P,N);H.set(oe,0),this._stashUsed=oe.byteLength,this._stashByteStart+=N}return 0}return this._stashUsed=0,this._stashByteStart=0,W}return 0}_onLoaderComplete(x,P){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(x,P){switch(k.e(this.TAG,`Loader error, code = ${P.code}, msg = ${P.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,x=c.UNRECOVERABLE_EARLY_EOF),x){case c.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let N=this._currentRange.to+1;N<this._totalLength&&(k.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(N,!1));return}x=c.UNRECOVERABLE_EARLY_EOF;break}case c.UNRECOVERABLE_EARLY_EOF:case c.CONNECTING_TIMEOUT:case c.HTTP_STATUS_CODE_INVALID:case c.EXCEPTION:break}if(this._onError)this._onError(x,P);else throw new e("IOException: "+P.msg)}}var b=h;const T={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function y(){return Object.assign({},T)}class d{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let x=new b({},y()),P=x.loaderType;return x.destroy(),P=="fetch-stream-loader"||P=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let x=new b({},y()),P=x.loaderType;return x.destroy(),P}static supportNativeMediaPlayback(x){d.videoElement==null&&(d.videoElement=window.document.createElement("video"));let P=d.videoElement.canPlayType(x);return P==="probably"||P=="maybe"}static getFeatureList(){let x={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return x.mseFlvPlayback=d.supportMSEH264Playback(),x.networkStreamIO=d.supportNetworkStreamIO(),x.networkLoaderName=d.getNetworkLoaderTypeName(),x.mseLiveFlvPlayback=x.mseFlvPlayback&&x.networkStreamIO,x.nativeMP4H264Playback=d.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),x.nativeWebmVP8Playback=d.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),x.nativeWebmVP9Playback=d.supportNativeMediaPlayback('video/webm; codecs="vp9"'),x}}var R=d,F={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class U{static get forceGlobalTag(){return k.FORCE_GLOBAL_TAG}static set forceGlobalTag(x){k.FORCE_GLOBAL_TAG=x,U._notifyChange()}static get globalTag(){return k.GLOBAL_TAG}static set globalTag(x){k.GLOBAL_TAG=x,U._notifyChange()}static get enableAll(){return k.ENABLE_VERBOSE&&k.ENABLE_DEBUG&&k.ENABLE_INFO&&k.ENABLE_WARN&&k.ENABLE_ERROR}static set enableAll(x){k.ENABLE_VERBOSE=x,k.ENABLE_DEBUG=x,k.ENABLE_INFO=x,k.ENABLE_WARN=x,k.ENABLE_ERROR=x,U._notifyChange()}static get enableDebug(){return k.ENABLE_DEBUG}static set enableDebug(x){k.ENABLE_DEBUG=x,U._notifyChange()}static get enableVerbose(){return k.ENABLE_VERBOSE}static set enableVerbose(x){k.ENABLE_VERBOSE=x,U._notifyChange()}static get enableInfo(){return k.ENABLE_INFO}static set enableInfo(x){k.ENABLE_INFO=x,U._notifyChange()}static get enableWarn(){return k.ENABLE_WARN}static set enableWarn(x){k.ENABLE_WARN=x,U._notifyChange()}static get enableError(){return k.ENABLE_ERROR}static set enableError(x){k.ENABLE_ERROR=x,U._notifyChange()}static getConfig(){return{globalTag:k.GLOBAL_TAG,forceGlobalTag:k.FORCE_GLOBAL_TAG,enableVerbose:k.ENABLE_VERBOSE,enableDebug:k.ENABLE_DEBUG,enableInfo:k.ENABLE_INFO,enableWarn:k.ENABLE_WARN,enableError:k.ENABLE_ERROR,enableCallback:k.ENABLE_CALLBACK}}static applyConfig(x){k.GLOBAL_TAG=x.globalTag,k.FORCE_GLOBAL_TAG=x.forceGlobalTag,k.ENABLE_VERBOSE=x.enableVerbose,k.ENABLE_DEBUG=x.enableDebug,k.ENABLE_INFO=x.enableInfo,k.ENABLE_WARN=x.enableWarn,k.ENABLE_ERROR=x.enableError,k.ENABLE_CALLBACK=x.enableCallback}static _notifyChange(){let x=U.emitter;if(x.listenerCount("change")>0){let P=U.getConfig();x.emit("change",P)}}static registerListener(x){U.emitter.addListener("change",x)}static removeListener(x){U.emitter.removeListener("change",x)}static addLogListener(x){k.emitter.addListener("log",x),k.emitter.listenerCount("log")>0&&(k.ENABLE_CALLBACK=!0,U._notifyChange())}static removeLogListener(x){k.emitter.removeListener("log",x),k.emitter.listenerCount("log")===0&&(k.ENABLE_CALLBACK=!1,U._notifyChange())}}U.emitter=new(K());var V=U;class re{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let x=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,P=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&x&&P}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(x){if(this.keyframesIndex==null)return null;let P=this.keyframesIndex,N=this._search(P.times,x);return{index:N,milliseconds:P.times[N],fileposition:P.filepositions[N]}}_search(x,P){let N=0,W=x.length-1,H=0,oe=0,se=W;for(P<x[0]&&(N=0,oe=se+1);oe<=se;)if(H=oe+Math.floor((se-oe)/2),H===W||P>=x[H]&&P<x[H+1]){N=H;break}else x[H]<P?oe=H+1:se=H-1;return N}}var $=re;function le(Se,x,P){let N=Se;if(x+P<N.length){for(;P--;)if((N[++x]&192)!==128)return!1;return!0}else return!1}function te(Se){let x=[],P=Se,N=0,W=Se.length;for(;N<W;){if(P[N]<128){x.push(String.fromCharCode(P[N])),++N;continue}else if(!(P[N]<192)){if(P[N]<224){if(le(P,N,1)){let H=(P[N]&31)<<6|P[N+1]&63;if(H>=128){x.push(String.fromCharCode(H&65535)),N+=2;continue}}}else if(P[N]<240){if(le(P,N,2)){let H=(P[N]&15)<<12|(P[N+1]&63)<<6|P[N+2]&63;if(H>=2048&&(H&63488)!==55296){x.push(String.fromCharCode(H&65535)),N+=3;continue}}}else if(P[N]<248&&le(P,N,3)){let H=(P[N]&7)<<18|(P[N+1]&63)<<12|(P[N+2]&63)<<6|P[N+3]&63;if(H>65536&&H<1114112){H-=65536,x.push(String.fromCharCode(H>>>10|55296)),x.push(String.fromCharCode(H&1023|56320)),N+=4;continue}}}x.push("\uFFFD"),++N}return x.join("")}var _e=te;let fe=function(){let Se=new ArrayBuffer(2);return new DataView(Se).setInt16(0,256,!0),new Int16Array(Se)[0]===256}();class me{static parseScriptData(x,P,N){let W={};try{let H=me.parseValue(x,P,N),oe=me.parseValue(x,P+H.size,N-H.size);W[H.data]=oe.data}catch(H){k.e("AMF",H.toString())}return W}static parseObject(x,P,N){if(N<3)throw new I("Data not enough when parse ScriptDataObject");let W=me.parseString(x,P,N),H=me.parseValue(x,P+W.size,N-W.size),oe=H.objectEnd;return{data:{name:W.data,value:H.data},size:W.size+H.size,objectEnd:oe}}static parseVariable(x,P,N){return me.parseObject(x,P,N)}static parseString(x,P,N){if(N<2)throw new I("Data not enough when parse String");let H=new DataView(x,P,N).getUint16(0,!fe),oe;return H>0?oe=_e(new Uint8Array(x,P+2,H)):oe="",{data:oe,size:2+H}}static parseLongString(x,P,N){if(N<4)throw new I("Data not enough when parse LongString");let H=new DataView(x,P,N).getUint32(0,!fe),oe;return H>0?oe=_e(new Uint8Array(x,P+4,H)):oe="",{data:oe,size:4+H}}static parseDate(x,P,N){if(N<10)throw new I("Data size invalid when parse Date");let W=new DataView(x,P,N),H=W.getFloat64(0,!fe),oe=W.getInt16(8,!fe);return H+=oe*60*1e3,{data:new Date(H),size:10}}static parseValue(x,P,N){if(N<1)throw new I("Data not enough when parse Value");let W=new DataView(x,P,N),H=1,oe=W.getUint8(0),se,Te=!1;try{switch(oe){case 0:se=W.getFloat64(1,!fe),H+=8;break;case 1:{se=!!W.getUint8(1),H+=1;break}case 2:{let we=me.parseString(x,P+1,N-1);se=we.data,H+=we.size;break}case 3:{se={};let we=0;for((W.getUint32(N-4,!fe)&16777215)===9&&(we=3);H<N-4;){let Ze=me.parseObject(x,P+H,N-H-we);if(Ze.objectEnd)break;se[Ze.data.name]=Ze.data.value,H+=Ze.size}H<=N-3&&(W.getUint32(H-1,!fe)&16777215)===9&&(H+=3);break}case 8:{se={},H+=4;let we=0;for((W.getUint32(N-4,!fe)&16777215)===9&&(we=3);H<N-8;){let Ze=me.parseVariable(x,P+H,N-H-we);if(Ze.objectEnd)break;se[Ze.data.name]=Ze.data.value,H+=Ze.size}H<=N-3&&(W.getUint32(H-1,!fe)&16777215)===9&&(H+=3);break}case 9:se=void 0,H=1,Te=!0;break;case 10:{se=[];let we=W.getUint32(1,!fe);H+=4;for(let Ze=0;Ze<we;Ze++){let dt=me.parseValue(x,P+H,N-H);se.push(dt.data),H+=dt.size}break}case 11:{let we=me.parseDate(x,P+1,N-1);se=we.data,H+=we.size;break}case 12:{let we=me.parseString(x,P+1,N-1);se=we.data,H+=we.size;break}default:H=N,k.w("AMF","Unsupported AMF value type "+oe)}}catch(we){k.e("AMF",we.toString())}return{data:se,size:H,objectEnd:Te}}}var Ae=me;class Be{constructor(x){this.TAG="ExpGolomb",this._buffer=x,this._buffer_index=0,this._total_bytes=x.byteLength,this._total_bits=x.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let x=this._total_bytes-this._buffer_index;if(x<=0)throw new I("ExpGolomb: _fillCurrentWord() but no bytes available");let P=Math.min(4,x),N=new Uint8Array(4);N.set(this._buffer.subarray(this._buffer_index,this._buffer_index+P)),this._current_word=new DataView(N.buffer).getUint32(0,!1),this._buffer_index+=P,this._current_word_bits_left=P*8}readBits(x){if(x>32)throw new w("ExpGolomb: readBits() bits exceeded max 32bits!");if(x<=this._current_word_bits_left){let oe=this._current_word>>>32-x;return this._current_word<<=x,this._current_word_bits_left-=x,oe}let P=this._current_word_bits_left?this._current_word:0;P=P>>>32-this._current_word_bits_left;let N=x-this._current_word_bits_left;this._fillCurrentWord();let W=Math.min(N,this._current_word_bits_left),H=this._current_word>>>32-W;return this._current_word<<=W,this._current_word_bits_left-=W,P=P<<W|H,P}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let x;for(x=0;x<this._current_word_bits_left;x++)if(this._current_word&2147483648>>>x)return this._current_word<<=x,this._current_word_bits_left-=x,x;return this._fillCurrentWord(),x+this._skipLeadingZero()}readUEG(){let x=this._skipLeadingZero();return this.readBits(x+1)-1}readSEG(){let x=this.readUEG();return x&1?x+1>>>1:-1*(x>>>1)}}var Le=Be;class Ie{static _ebsp2rbsp(x){let P=x,N=P.byteLength,W=new Uint8Array(N),H=0;for(let oe=0;oe<N;oe++)oe>=2&&P[oe]===3&&P[oe-1]===0&&P[oe-2]===0||(W[H]=P[oe],H++);return new Uint8Array(W.buffer,0,H)}static parseSPS(x){let P=Ie._ebsp2rbsp(x),N=new Le(P);N.readByte();let W=N.readByte();N.readByte();let H=N.readByte();N.readUEG();let oe=Ie.getProfileString(W),se=Ie.getLevelString(H),Te=1,we=420,Ze=[0,420,422,444],dt=8;if((W===100||W===110||W===122||W===244||W===44||W===83||W===86||W===118||W===128||W===138||W===144)&&(Te=N.readUEG(),Te===3&&N.readBits(1),Te<=3&&(we=Ze[Te]),dt=N.readUEG()+8,N.readUEG(),N.readBits(1),N.readBool())){let Rr=Te!==3?8:12;for(let gr=0;gr<Rr;gr++)N.readBool()&&(gr<6?Ie._skipScalingList(N,16):Ie._skipScalingList(N,64))}N.readUEG();let Tt=N.readUEG();if(Tt===0)N.readUEG();else if(Tt===1){N.readBits(1),N.readSEG(),N.readSEG();let Rr=N.readUEG();for(let gr=0;gr<Rr;gr++)N.readSEG()}let ct=N.readUEG();N.readBits(1);let Rt=N.readUEG(),at=N.readUEG(),ze=N.readBits(1);ze===0&&N.readBits(1),N.readBits(1);let st=0,lt=0,bt=0,Ot=0;N.readBool()&&(st=N.readUEG(),lt=N.readUEG(),bt=N.readUEG(),Ot=N.readUEG());let It=1,ht=1,Bt=0,Pt=!0,Kt=0,Wt=0;if(N.readBool()){if(N.readBool()){let Rr=N.readByte(),gr=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],yr=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Rr>0&&Rr<16?(It=gr[Rr-1],ht=yr[Rr-1]):Rr===255&&(It=N.readByte()<<8|N.readByte(),ht=N.readByte()<<8|N.readByte())}if(N.readBool()&&N.readBool(),N.readBool()&&(N.readBits(4),N.readBool()&&N.readBits(24)),N.readBool()&&(N.readUEG(),N.readUEG()),N.readBool()){let Rr=N.readBits(32),gr=N.readBits(32);Pt=N.readBool(),Kt=gr,Wt=Rr*2,Bt=Kt/Wt}}let ir=1;(It!==1||ht!==1)&&(ir=It/ht);let ar=0,hn=0;if(Te===0)ar=1,hn=2-ze;else{let Rr=Te===3?1:2,gr=Te===1?2:1;ar=Rr,hn=gr*(2-ze)}let dn=(Rt+1)*16,vr=(2-ze)*((at+1)*16);dn-=(st+lt)*ar,vr-=(bt+Ot)*hn;let gn=Math.ceil(dn*ir);return N.destroy(),N=null,{profile_string:oe,level_string:se,bit_depth:dt,ref_frames:ct,chroma_format:we,chroma_format_string:Ie.getChromaFormatString(we),frame_rate:{fixed:Pt,fps:Bt,fps_den:Wt,fps_num:Kt},sar_ratio:{width:It,height:ht},codec_size:{width:dn,height:vr},present_size:{width:gn,height:vr}}}static _skipScalingList(x,P){let N=8,W=8,H=0;for(let oe=0;oe<P;oe++)W!==0&&(H=x.readSEG(),W=(N+H+256)%256),N=W===0?N:W}static getProfileString(x){switch(x){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(x){return(x/10).toFixed(1)}static getChromaFormatString(x){switch(x){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var pe=Ie,Ce={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function ie(Se){return Se>>>8&255|(Se&255)<<8}function X(Se){return(Se&4278190080)>>>24|(Se&16711680)>>>8|(Se&65280)<<8|(Se&255)<<24}function q(Se,x){return Se[x]<<24|Se[x+1]<<16|Se[x+2]<<8|Se[x+3]}class ue{constructor(x,P){this.TAG="FLVDemuxer",this._config=P,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=x.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=x.hasAudioTrack,this._hasVideo=x.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new $,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let N=new ArrayBuffer(2);return new DataView(N).setInt16(0,256,!0),new Int16Array(N)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(x){let P=new Uint8Array(x),N={match:!1};if(P[0]!==70||P[1]!==76||P[2]!==86||P[3]!==1)return N;let W=(P[4]&4)>>>2!==0,H=(P[4]&1)!==0,oe=q(P,5);return oe<9?N:{match:!0,consumed:oe,dataOffset:oe,hasAudioTrack:W,hasVideoTrack:H}}bindDataSource(x){return x.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(x){this._onTrackMetadata=x}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(x){this._onMediaInfo=x}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(x){this._onMetaDataArrived=x}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(x){this._onScriptDataArrived=x}get onError(){return this._onError}set onError(x){this._onError=x}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(x){this._onDataAvailable=x}get timestampBase(){return this._timestampBase}set timestampBase(x){this._timestampBase=x}get overridedDuration(){return this._duration}set overridedDuration(x){this._durationOverrided=!0,this._duration=x,this._mediaInfo.duration=x}set overridedHasAudio(x){this._hasAudioFlagOverrided=!0,this._hasAudio=x,this._mediaInfo.hasAudio=x}set overridedHasVideo(x){this._hasVideoFlagOverrided=!0,this._hasVideo=x,this._mediaInfo.hasVideo=x}resetMediaInfo(){this._mediaInfo=new $}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(x,P){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new I("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let N=0,W=this._littleEndian;if(P===0)if(x.byteLength>13)N=ue.probe(x).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,P+N!==this._dataOffset&&k.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(x,N).getUint32(0,!W)!==0&&k.w(this.TAG,"PrevTagSize0 !== 0 !!!"),N+=4);N<x.byteLength;){this._dispatch=!0;let H=new DataView(x,N);if(N+11+4>x.byteLength)break;let oe=H.getUint8(0),se=H.getUint32(0,!W)&16777215;if(N+11+se+4>x.byteLength)break;if(oe!==8&&oe!==9&&oe!==18){k.w(this.TAG,`Unsupported tag type ${oe}, skipped`),N+=11+se+4;continue}let Te=H.getUint8(4),we=H.getUint8(5),Ze=H.getUint8(6),dt=H.getUint8(7),Tt=Ze|we<<8|Te<<16|dt<<24;(H.getUint32(7,!W)&16777215)!==0&&k.w(this.TAG,"Meet tag which has StreamID != 0!");let Rt=N+11;switch(oe){case 8:this._parseAudioData(x,Rt,se,Tt);break;case 9:this._parseVideoData(x,Rt,se,Tt,P+N);break;case 18:this._parseScriptData(x,Rt,se);break}let at=H.getUint32(11+se,!W);at!==11+se&&k.w(this.TAG,`Invalid PrevTagSize ${at}`),N+=11+se+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),N}_parseScriptData(x,P,N){let W=Ae.parseScriptData(x,P,N);if(W.hasOwnProperty("onMetaData")){if(W.onMetaData==null||typeof W.onMetaData!="object"){k.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&k.w(this.TAG,"Found another onMetaData tag!"),this._metadata=W;let H=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},H)),typeof H.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=H.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof H.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=H.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof H.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=H.audiodatarate),typeof H.videodatarate=="number"&&(this._mediaInfo.videoDataRate=H.videodatarate),typeof H.width=="number"&&(this._mediaInfo.width=H.width),typeof H.height=="number"&&(this._mediaInfo.height=H.height),typeof H.duration=="number"){if(!this._durationOverrided){let oe=Math.floor(H.duration*this._timescale);this._duration=oe,this._mediaInfo.duration=oe}}else this._mediaInfo.duration=0;if(typeof H.framerate=="number"){let oe=Math.floor(H.framerate*1e3);if(oe>0){let se=oe/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=se,this._referenceFrameRate.fps_num=oe,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=se}}if(typeof H.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let oe=H.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(oe),H.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=H,k.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(W).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},W))}_parseKeyframesIndex(x){let P=[],N=[];for(let W=1;W<x.times.length;W++){let H=this._timestampBase+Math.floor(x.times[W]*1e3);P.push(H),N.push(x.filepositions[W])}return{times:P,filepositions:N}}_parseAudioData(x,P,N,W){if(N<=1){k.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let H=this._littleEndian,se=new DataView(x,P,N).getUint8(0),Te=se>>>4;if(Te!==2&&Te!==10){this._onError(Ce.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Te);return}let we=0,Ze=(se&12)>>>2;if(Ze>=0&&Ze<=4)we=this._flvSoundRateTable[Ze];else{this._onError(Ce.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Ze);return}let dt=(se&2)>>>1,Tt=se&1,ct=this._audioMetadata,Rt=this._audioTrack;if(ct||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),ct=this._audioMetadata={},ct.type="audio",ct.id=Rt.id,ct.timescale=this._timescale,ct.duration=this._duration,ct.audioSampleRate=we,ct.channelCount=Tt===0?1:2),Te===10){let at=this._parseAACAudioData(x,P+1,N-1);if(at==null)return;if(at.packetType===0){ct.config&&k.w(this.TAG,"Found another AudioSpecificConfig!");let ze=at.data;ct.audioSampleRate=ze.samplingRate,ct.channelCount=ze.channelCount,ct.codec=ze.codec,ct.originalCodec=ze.originalCodec,ct.config=ze.config,ct.refSampleDuration=1024/ct.audioSampleRate*ct.timescale,k.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",ct);let st=this._mediaInfo;st.audioCodec=ct.originalCodec,st.audioSampleRate=ct.audioSampleRate,st.audioChannelCount=ct.channelCount,st.hasVideo?st.videoCodec!=null&&(st.mimeType='video/x-flv; codecs="'+st.videoCodec+","+st.audioCodec+'"'):st.mimeType='video/x-flv; codecs="'+st.audioCodec+'"',st.isComplete()&&this._onMediaInfo(st)}else if(at.packetType===1){let ze=this._timestampBase+W,st={unit:at.data,length:at.data.byteLength,dts:ze,pts:ze};Rt.samples.push(st),Rt.length+=at.data.length}else k.e(this.TAG,`Flv: Unsupported AAC data type ${at.packetType}`)}else if(Te===2){if(!ct.codec){let lt=this._parseMP3AudioData(x,P+1,N-1,!0);if(lt==null)return;ct.audioSampleRate=lt.samplingRate,ct.channelCount=lt.channelCount,ct.codec=lt.codec,ct.originalCodec=lt.originalCodec,ct.refSampleDuration=1152/ct.audioSampleRate*ct.timescale,k.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",ct);let bt=this._mediaInfo;bt.audioCodec=ct.codec,bt.audioSampleRate=ct.audioSampleRate,bt.audioChannelCount=ct.channelCount,bt.audioDataRate=lt.bitRate,bt.hasVideo?bt.videoCodec!=null&&(bt.mimeType='video/x-flv; codecs="'+bt.videoCodec+","+bt.audioCodec+'"'):bt.mimeType='video/x-flv; codecs="'+bt.audioCodec+'"',bt.isComplete()&&this._onMediaInfo(bt)}let at=this._parseMP3AudioData(x,P+1,N-1,!1);if(at==null)return;let ze=this._timestampBase+W,st={unit:at,length:at.byteLength,dts:ze,pts:ze};Rt.samples.push(st),Rt.length+=at.length}}_parseAACAudioData(x,P,N){if(N<=1){k.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let W={},H=new Uint8Array(x,P,N);return W.packetType=H[0],H[0]===0?W.data=this._parseAACAudioSpecificConfig(x,P+1,N-1):W.data=H.subarray(1),W}_parseAACAudioSpecificConfig(x,P,N){let W=new Uint8Array(x,P,N),H=null,oe=0,se=0,Te=null,we=0,Ze=null;if(oe=se=W[0]>>>3,we=(W[0]&7)<<1|W[1]>>>7,we<0||we>=this._mpegSamplingRates.length){this._onError(Ce.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let dt=this._mpegSamplingRates[we],Tt=(W[1]&120)>>>3;if(Tt<0||Tt>=8){this._onError(Ce.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}oe===5&&(Ze=(W[1]&7)<<1|W[2]>>>7,Te=(W[2]&124)>>>2);let ct=self.navigator.userAgent.toLowerCase();return ct.indexOf("firefox")!==-1?we>=6?(oe=5,H=new Array(4),Ze=we-3):(oe=2,H=new Array(2),Ze=we):ct.indexOf("android")!==-1?(oe=2,H=new Array(2),Ze=we):(oe=5,Ze=we,H=new Array(4),we>=6?Ze=we-3:Tt===1&&(oe=2,H=new Array(2),Ze=we)),H[0]=oe<<3,H[0]|=(we&15)>>>1,H[1]=(we&15)<<7,H[1]|=(Tt&15)<<3,oe===5&&(H[1]|=(Ze&15)>>>1,H[2]=(Ze&1)<<7,H[2]|=8,H[3]=0),{config:H,samplingRate:dt,channelCount:Tt,codec:"mp4a.40."+oe,originalCodec:"mp4a.40."+se}}_parseMP3AudioData(x,P,N,W){if(N<4){k.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let H=this._littleEndian,oe=new Uint8Array(x,P,N),se=null;if(W){if(oe[0]!==255)return;let Te=oe[1]>>>3&3,we=(oe[1]&6)>>1,Ze=(oe[2]&240)>>>4,dt=(oe[2]&12)>>>2,ct=(oe[3]>>>6&3)!==3?2:1,Rt=0,at=0,ze=34,st="mp3";switch(Te){case 0:Rt=this._mpegAudioV25SampleRateTable[dt];break;case 2:Rt=this._mpegAudioV20SampleRateTable[dt];break;case 3:Rt=this._mpegAudioV10SampleRateTable[dt];break}switch(we){case 1:ze=34,Ze<this._mpegAudioL3BitRateTable.length&&(at=this._mpegAudioL3BitRateTable[Ze]);break;case 2:ze=33,Ze<this._mpegAudioL2BitRateTable.length&&(at=this._mpegAudioL2BitRateTable[Ze]);break;case 3:ze=32,Ze<this._mpegAudioL1BitRateTable.length&&(at=this._mpegAudioL1BitRateTable[Ze]);break}se={bitRate:at,samplingRate:Rt,channelCount:ct,codec:st,originalCodec:st}}else se=oe;return se}_parseVideoData(x,P,N,W,H){if(N<=1){k.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let oe=new Uint8Array(x,P,N)[0],se=(oe&240)>>>4,Te=oe&15;if(Te!==7){this._onError(Ce.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${Te}`);return}this._parseAVCVideoPacket(x,P+1,N-1,W,H,se)}_parseAVCVideoPacket(x,P,N,W,H,oe){if(N<4){k.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let se=this._littleEndian,Te=new DataView(x,P,N),we=Te.getUint8(0),dt=(Te.getUint32(0,!se)&16777215)<<8>>8;if(we===0)this._parseAVCDecoderConfigurationRecord(x,P+4,N-4);else if(we===1)this._parseAVCVideoData(x,P+4,N-4,W,H,oe,dt);else if(we!==2){this._onError(Ce.FORMAT_ERROR,`Flv: Invalid video packet type ${we}`);return}}_parseAVCDecoderConfigurationRecord(x,P,N){if(N<7){k.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let W=this._videoMetadata,H=this._videoTrack,oe=this._littleEndian,se=new DataView(x,P,N);W?typeof W.avcc!="undefined"&&k.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),W=this._videoMetadata={},W.type="video",W.id=H.id,W.timescale=this._timescale,W.duration=this._duration);let Te=se.getUint8(0),we=se.getUint8(1),Ze=se.getUint8(2),dt=se.getUint8(3);if(Te!==1||we===0){this._onError(Ce.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(se.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Ce.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Tt=se.getUint8(5)&31;if(Tt===0){this._onError(Ce.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Tt>1&&k.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Tt}`);let ct=6;for(let at=0;at<Tt;at++){let ze=se.getUint16(ct,!oe);if(ct+=2,ze===0)continue;let st=new Uint8Array(x,P+ct,ze);ct+=ze;let lt=pe.parseSPS(st);if(at!==0)continue;W.codecWidth=lt.codec_size.width,W.codecHeight=lt.codec_size.height,W.presentWidth=lt.present_size.width,W.presentHeight=lt.present_size.height,W.profile=lt.profile_string,W.level=lt.level_string,W.bitDepth=lt.bit_depth,W.chromaFormat=lt.chroma_format,W.sarRatio=lt.sar_ratio,W.frameRate=lt.frame_rate,(lt.frame_rate.fixed===!1||lt.frame_rate.fps_num===0||lt.frame_rate.fps_den===0)&&(W.frameRate=this._referenceFrameRate);let bt=W.frameRate.fps_den,Ot=W.frameRate.fps_num;W.refSampleDuration=W.timescale*(bt/Ot);let Nt=st.subarray(1,4),It="avc1.";for(let Bt=0;Bt<3;Bt++){let Pt=Nt[Bt].toString(16);Pt.length<2&&(Pt="0"+Pt),It+=Pt}W.codec=It;let ht=this._mediaInfo;ht.width=W.codecWidth,ht.height=W.codecHeight,ht.fps=W.frameRate.fps,ht.profile=W.profile,ht.level=W.level,ht.refFrames=lt.ref_frames,ht.chromaFormat=lt.chroma_format_string,ht.sarNum=W.sarRatio.width,ht.sarDen=W.sarRatio.height,ht.videoCodec=It,ht.hasAudio?ht.audioCodec!=null&&(ht.mimeType='video/x-flv; codecs="'+ht.videoCodec+","+ht.audioCodec+'"'):ht.mimeType='video/x-flv; codecs="'+ht.videoCodec+'"',ht.isComplete()&&this._onMediaInfo(ht)}let Rt=se.getUint8(ct);if(Rt===0){this._onError(Ce.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Rt>1&&k.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${Rt}`);ct++;for(let at=0;at<Rt;at++){let ze=se.getUint16(ct,!oe);ct+=2,ze!==0&&(ct+=ze)}W.avcc=new Uint8Array(N),W.avcc.set(new Uint8Array(x,P,N),0),k.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",W)}_parseAVCVideoData(x,P,N,W,H,oe,se){let Te=this._littleEndian,we=new DataView(x,P,N),Ze=[],dt=0,Tt=0;const ct=this._naluLengthSize;let Rt=this._timestampBase+W,at=oe===1;for(;Tt<N;){if(Tt+4>=N){k.w(this.TAG,`Malformed Nalu near timestamp ${Rt}, offset = ${Tt}, dataSize = ${N}`);break}let ze=we.getUint32(Tt,!Te);if(ct===3&&(ze>>>=8),ze>N-ct){k.w(this.TAG,`Malformed Nalus near timestamp ${Rt}, NaluSize > DataSize!`);return}let st=we.getUint8(Tt+ct)&31;st===5&&(at=!0);let lt=new Uint8Array(x,P+Tt,ct+ze),bt={type:st,data:lt};Ze.push(bt),dt+=lt.byteLength,Tt+=ct+ze}if(Ze.length){let ze=this._videoTrack,st={units:Ze,length:dt,isKeyframe:at,dts:Rt,cts:se,pts:Rt+se};at&&(st.fileposition=H),ze.samples.push(st),ze.length+=dt}}}var ee=ue;class z{static init(){z.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let P in z.types)z.types.hasOwnProperty(P)&&(z.types[P]=[P.charCodeAt(0),P.charCodeAt(1),P.charCodeAt(2),P.charCodeAt(3)]);let x=z.constants={};x.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),x.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),x.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),x.STSC=x.STCO=x.STTS,x.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),x.HDLR_VIDEO=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.HDLR_AUDIO=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]),x.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),x.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(x){let P=8,N=null,W=Array.prototype.slice.call(arguments,1),H=W.length;for(let se=0;se<H;se++)P+=W[se].byteLength;N=new Uint8Array(P),N[0]=P>>>24&255,N[1]=P>>>16&255,N[2]=P>>>8&255,N[3]=P&255,N.set(x,4);let oe=8;for(let se=0;se<H;se++)N.set(W[se],oe),oe+=W[se].byteLength;return N}static generateInitSegment(x){let P=z.box(z.types.ftyp,z.constants.FTYP),N=z.moov(x),W=new Uint8Array(P.byteLength+N.byteLength);return W.set(P,0),W.set(N,P.byteLength),W}static moov(x){let P=z.mvhd(x.timescale,x.duration),N=z.trak(x),W=z.mvex(x);return z.box(z.types.moov,P,N,W)}static mvhd(x,P){return z.box(z.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}static trak(x){return z.box(z.types.trak,z.tkhd(x),z.mdia(x))}static tkhd(x){let P=x.id,N=x.duration,W=x.presentWidth,H=x.presentHeight;return z.box(z.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255,0,0,0,0,N>>>24&255,N>>>16&255,N>>>8&255,N&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,W>>>8&255,W&255,0,0,H>>>8&255,H&255,0,0]))}static mdia(x){return z.box(z.types.mdia,z.mdhd(x),z.hdlr(x),z.minf(x))}static mdhd(x){let P=x.timescale,N=x.duration;return z.box(z.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255,N>>>24&255,N>>>16&255,N>>>8&255,N&255,85,196,0,0]))}static hdlr(x){let P=null;return x.type==="audio"?P=z.constants.HDLR_AUDIO:P=z.constants.HDLR_VIDEO,z.box(z.types.hdlr,P)}static minf(x){let P=null;return x.type==="audio"?P=z.box(z.types.smhd,z.constants.SMHD):P=z.box(z.types.vmhd,z.constants.VMHD),z.box(z.types.minf,P,z.dinf(),z.stbl(x))}static dinf(){return z.box(z.types.dinf,z.box(z.types.dref,z.constants.DREF))}static stbl(x){return z.box(z.types.stbl,z.stsd(x),z.box(z.types.stts,z.constants.STTS),z.box(z.types.stsc,z.constants.STSC),z.box(z.types.stsz,z.constants.STSZ),z.box(z.types.stco,z.constants.STCO))}static stsd(x){return x.type==="audio"?x.codec==="mp3"?z.box(z.types.stsd,z.constants.STSD_PREFIX,z.mp3(x)):z.box(z.types.stsd,z.constants.STSD_PREFIX,z.mp4a(x)):z.box(z.types.stsd,z.constants.STSD_PREFIX,z.avc1(x))}static mp3(x){let P=x.channelCount,N=x.audioSampleRate,W=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P,0,16,0,0,0,0,N>>>8&255,N&255,0,0]);return z.box(z.types[".mp3"],W)}static mp4a(x){let P=x.channelCount,N=x.audioSampleRate,W=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P,0,16,0,0,0,0,N>>>8&255,N&255,0,0]);return z.box(z.types.mp4a,W,z.esds(x))}static esds(x){let P=x.config||[],N=P.length,W=new Uint8Array([0,0,0,0,3,23+N,0,1,0,4,15+N,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([N]).concat(P).concat([6,1,2]));return z.box(z.types.esds,W)}static avc1(x){let P=x.avcc,N=x.codecWidth,W=x.codecHeight,H=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,W>>>8&255,W&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return z.box(z.types.avc1,H,z.box(z.types.avcC,P))}static mvex(x){return z.box(z.types.mvex,z.trex(x))}static trex(x){let P=x.id,N=new Uint8Array([0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return z.box(z.types.trex,N)}static moof(x,P){return z.box(z.types.moof,z.mfhd(x.sequenceNumber),z.traf(x,P))}static mfhd(x){let P=new Uint8Array([0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255]);return z.box(z.types.mfhd,P)}static traf(x,P){let N=x.id,W=z.box(z.types.tfhd,new Uint8Array([0,0,0,0,N>>>24&255,N>>>16&255,N>>>8&255,N&255])),H=z.box(z.types.tfdt,new Uint8Array([0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255])),oe=z.sdtp(x),se=z.trun(x,oe.byteLength+16+16+8+16+8+8);return z.box(z.types.traf,W,H,se,oe)}static sdtp(x){let P=x.samples||[],N=P.length,W=new Uint8Array(4+N);for(let H=0;H<N;H++){let oe=P[H].flags;W[H+4]=oe.isLeading<<6|oe.dependsOn<<4|oe.isDependedOn<<2|oe.hasRedundancy}return z.box(z.types.sdtp,W)}static trun(x,P){let N=x.samples||[],W=N.length,H=12+16*W,oe=new Uint8Array(H);P+=8+H,oe.set([0,0,15,1,W>>>24&255,W>>>16&255,W>>>8&255,W&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0);for(let se=0;se<W;se++){let Te=N[se].duration,we=N[se].size,Ze=N[se].flags,dt=N[se].cts;oe.set([Te>>>24&255,Te>>>16&255,Te>>>8&255,Te&255,we>>>24&255,we>>>16&255,we>>>8&255,we&255,Ze.isLeading<<2|Ze.dependsOn,Ze.isDependedOn<<6|Ze.hasRedundancy<<4|Ze.isNonSync,0,0,dt>>>24&255,dt>>>16&255,dt>>>8&255,dt&255],12+16*se)}return z.box(z.types.trun,oe)}static mdat(x){return z.box(z.types.mdat,x)}}z.init();var ne=z;class ce{static getSilentFrame(x,P){if(x==="mp4a.40.2"){if(P===1)return new Uint8Array([0,200,0,128,35,128]);if(P===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(P===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(P===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(P===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(P===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])}else{if(P===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(P===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(P===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])}return null}}var ge=ce;class ke{constructor(x,P,N,W,H){this.dts=x,this.pts=P,this.duration=N,this.originalDts=W,this.isSyncPoint=H,this.fileposition=null}}class $e{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(x){x.isSyncPoint=!0,this.syncPoints.push(x)}}class ft{constructor(){this._list=[]}clear(){this._list=[]}appendArray(x){let P=this._list;x.length!==0&&(P.length>0&&x[0].originalDts<P[P.length-1].originalDts&&this.clear(),Array.prototype.push.apply(P,x))}getLastSyncPointBeforeDts(x){if(this._list.length==0)return null;let P=this._list,N=0,W=P.length-1,H=0,oe=0,se=W;for(x<P[0].dts&&(N=0,oe=se+1);oe<=se;)if(H=oe+Math.floor((se-oe)/2),H===W||x>=P[H].dts&&x<P[H+1].dts){N=H;break}else P[H].dts<x?oe=H+1:se=H-1;return this._list[N]}}class Ne{constructor(x){this._type=x,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(x){let P=this._list;if(P.length===0)return-2;let N=P.length-1,W=0,H=0,oe=N,se=0;if(x<P[0].originalBeginDts)return se=-1,se;for(;H<=oe;)if(W=H+Math.floor((oe-H)/2),W===N||x>P[W].lastSample.originalDts&&x<P[W+1].originalBeginDts){se=W;break}else P[W].originalBeginDts<x?H=W+1:oe=W-1;return se}_searchNearestSegmentAfter(x){return this._searchNearestSegmentBefore(x)+1}append(x){let P=this._list,N=x,W=this._lastAppendLocation,H=0;W!==-1&&W<P.length&&N.originalBeginDts>=P[W].lastSample.originalDts&&(W===P.length-1||W<P.length-1&&N.originalBeginDts<P[W+1].originalBeginDts)?H=W+1:P.length>0&&(H=this._searchNearestSegmentBefore(N.originalBeginDts)+1),this._lastAppendLocation=H,this._list.splice(H,0,N)}getLastSegmentBefore(x){let P=this._searchNearestSegmentBefore(x);return P>=0?this._list[P]:null}getLastSampleBefore(x){let P=this.getLastSegmentBefore(x);return P!=null?P.lastSample:null}getLastSyncPointBefore(x){let P=this._searchNearestSegmentBefore(x),N=this._list[P].syncPoints;for(;N.length===0&&P>0;)P--,N=this._list[P].syncPoints;return N.length>0?N[N.length-1]:null}}class Re{constructor(x){this.TAG="MP4Remuxer",this._config=x,this._isLive=x.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ne("audio"),this._videoSegmentInfoList=new Ne("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(_.chrome&&(_.version.major<50||_.version.major===50&&_.version.build<2661)),this._fillSilentAfterSeek=_.msedge||_.msie,this._mp3UseMpegAudio=!_.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(x){return x.onDataAvailable=this.remux.bind(this),x.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(x){this._onInitSegment=x}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(x){this._onMediaSegment=x}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(x){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(x,P){if(!this._onMediaSegment)throw new I("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(x,P),this._remuxVideo(P),this._remuxAudio(x)}_onTrackMetadataReceived(x,P){let N=null,W="mp4",H=P.codec;if(x==="audio")this._audioMeta=P,P.codec==="mp3"&&this._mp3UseMpegAudio?(W="mpeg",H="",N=new Uint8Array):N=ne.generateInitSegment(P);else if(x==="video")this._videoMeta=P,N=ne.generateInitSegment(P);else return;if(!this._onInitSegment)throw new I("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(x,{type:x,data:N.buffer,codec:H,container:`${x}/${W}`,mediaDuration:P.duration})}_calculateDtsBase(x,P){this._dtsBaseInited||(x.samples&&x.samples.length&&(this._audioDtsBase=x.samples[0].dts),P.samples&&P.samples.length&&(this._videoDtsBase=P.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let x=this._videoStashedLastSample,P=this._audioStashedLastSample,N={type:"video",id:1,sequenceNumber:0,samples:[],length:0};x!=null&&(N.samples.push(x),N.length=x.length);let W={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};P!=null&&(W.samples.push(P),W.length=P.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(N,!0),this._remuxAudio(W,!0)}_remuxAudio(x,P){if(this._audioMeta==null)return;let N=x,W=N.samples,H,oe=-1,se=-1,Te=-1,we=this._audioMeta.refSampleDuration,Ze=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,dt=this._dtsBaseInited&&this._audioNextDts===void 0,Tt=!1;if(!W||W.length===0||W.length===1&&!P)return;let ct=0,Rt=null,at=0;Ze?(ct=0,at=N.length):(ct=8,at=8+N.length);let ze=null;if(W.length>1&&(ze=W.pop(),at-=ze.length),this._audioStashedLastSample!=null){let ht=this._audioStashedLastSample;this._audioStashedLastSample=null,W.unshift(ht),at+=ht.length}ze!=null&&(this._audioStashedLastSample=ze);let st=W[0].dts-this._dtsBase;if(this._audioNextDts)H=st-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())H=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Tt=!0);else{let ht=this._audioSegmentInfoList.getLastSampleBefore(st);if(ht!=null){let Bt=st-(ht.originalDts+ht.duration);Bt<=3&&(Bt=0);let Pt=ht.dts+ht.duration+Bt;H=st-Pt}else H=0}if(Tt){let ht=st-H,Bt=this._videoSegmentInfoList.getLastSegmentBefore(st);if(Bt!=null&&Bt.beginDts<ht){let Pt=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Pt){let Kt=Bt.beginDts,Wt=ht-Bt.beginDts;k.v(this.TAG,`InsertPrefixSilentAudio: dts: ${Kt}, duration: ${Wt}`),W.unshift({unit:Pt,dts:Kt,pts:Kt}),at+=Pt.byteLength}}else Tt=!1}let lt=[];for(let ht=0;ht<W.length;ht++){let Bt=W[ht],Pt=Bt.unit,Kt=Bt.dts-this._dtsBase,Wt=Kt-H;oe===-1&&(oe=Wt);let $t=0;ht!==W.length-1?$t=W[ht+1].dts-this._dtsBase-H-Wt:ze!=null?$t=ze.dts-this._dtsBase-H-Wt:lt.length>=1?$t=lt[lt.length-1].duration:$t=Math.floor(we);let ir=!1,ar=null;if($t>we*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!_.safari){ir=!0;let hn=Math.abs($t-we),dn=Math.ceil(hn/we),vr=Wt+we;k.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
dts: ${Wt+$t} ms, expected: ${Wt+Math.round(we)} ms, delta: ${Math.round(hn)} ms, generate: ${dn} frames`);let gn=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);gn==null&&(k.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),gn=Pt),ar=[];for(let gr=0;gr<dn;gr++){let yr=Math.round(vr);if(ar.length>0){let Kr=ar[ar.length-1];Kr.duration=yr-Kr.dts}let vn={dts:yr,pts:yr,cts:0,unit:gn,size:gn.byteLength,duration:0,originalDts:Kt,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};ar.push(vn),at+=vn.size,vr+=we}let Rr=ar[ar.length-1];Rr.duration=Wt+$t-Rr.dts,$t=Math.round(we)}lt.push({dts:Wt,pts:Wt,cts:0,unit:Bt.unit,size:Bt.unit.byteLength,duration:$t,originalDts:Kt,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ir&&lt.push.apply(lt,ar)}Ze?Rt=new Uint8Array(at):(Rt=new Uint8Array(at),Rt[0]=at>>>24&255,Rt[1]=at>>>16&255,Rt[2]=at>>>8&255,Rt[3]=at&255,Rt.set(ne.types.mdat,4));for(let ht=0;ht<lt.length;ht++){let Bt=lt[ht].unit;Rt.set(Bt,ct),ct+=Bt.byteLength}let bt=lt[lt.length-1];se=bt.dts+bt.duration,this._audioNextDts=se;let Ot=new $e;Ot.beginDts=oe,Ot.endDts=se,Ot.beginPts=oe,Ot.endPts=se,Ot.originalBeginDts=lt[0].originalDts,Ot.originalEndDts=bt.originalDts+bt.duration,Ot.firstSample=new ke(lt[0].dts,lt[0].pts,lt[0].duration,lt[0].originalDts,!1),Ot.lastSample=new ke(bt.dts,bt.pts,bt.duration,bt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Ot),N.samples=lt,N.sequenceNumber++;let Nt=null;Ze?Nt=new Uint8Array:Nt=ne.moof(N,oe),N.samples=[],N.length=0;let It={type:"audio",data:this._mergeBoxes(Nt,Rt).buffer,sampleCount:lt.length,info:Ot};Ze&&dt&&(It.timestampOffset=oe),this._onMediaSegment("audio",It)}_remuxVideo(x,P){if(this._videoMeta==null)return;let N=x,W=N.samples,H,oe=-1,se=-1,Te=-1,we=-1;if(!W||W.length===0||W.length===1&&!P)return;let Ze=8,dt=null,Tt=8+x.length,ct=null;if(W.length>1&&(ct=W.pop(),Tt-=ct.length),this._videoStashedLastSample!=null){let bt=this._videoStashedLastSample;this._videoStashedLastSample=null,W.unshift(bt),Tt+=bt.length}ct!=null&&(this._videoStashedLastSample=ct);let Rt=W[0].dts-this._dtsBase;if(this._videoNextDts)H=Rt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())H=0;else{let bt=this._videoSegmentInfoList.getLastSampleBefore(Rt);if(bt!=null){let Ot=Rt-(bt.originalDts+bt.duration);Ot<=3&&(Ot=0);let Nt=bt.dts+bt.duration+Ot;H=Rt-Nt}else H=0}let at=new $e,ze=[];for(let bt=0;bt<W.length;bt++){let Ot=W[bt],Nt=Ot.dts-this._dtsBase,It=Ot.isKeyframe,ht=Nt-H,Bt=Ot.cts,Pt=ht+Bt;oe===-1&&(oe=ht,Te=Pt);let Kt=0;if(bt!==W.length-1?Kt=W[bt+1].dts-this._dtsBase-H-ht:ct!=null?Kt=ct.dts-this._dtsBase-H-ht:ze.length>=1?Kt=ze[ze.length-1].duration:Kt=Math.floor(this._videoMeta.refSampleDuration),It){let Wt=new ke(ht,Pt,Kt,Ot.dts,!0);Wt.fileposition=Ot.fileposition,at.appendSyncPoint(Wt)}ze.push({dts:ht,pts:Pt,cts:Bt,units:Ot.units,size:Ot.length,isKeyframe:It,duration:Kt,originalDts:Nt,flags:{isLeading:0,dependsOn:It?2:1,isDependedOn:It?1:0,hasRedundancy:0,isNonSync:It?0:1}})}dt=new Uint8Array(Tt),dt[0]=Tt>>>24&255,dt[1]=Tt>>>16&255,dt[2]=Tt>>>8&255,dt[3]=Tt&255,dt.set(ne.types.mdat,4);for(let bt=0;bt<ze.length;bt++){let Ot=ze[bt].units;for(;Ot.length;){let It=Ot.shift().data;dt.set(It,Ze),Ze+=It.byteLength}}let st=ze[ze.length-1];if(se=st.dts+st.duration,we=st.pts+st.duration,this._videoNextDts=se,at.beginDts=oe,at.endDts=se,at.beginPts=Te,at.endPts=we,at.originalBeginDts=ze[0].originalDts,at.originalEndDts=st.originalDts+st.duration,at.firstSample=new ke(ze[0].dts,ze[0].pts,ze[0].duration,ze[0].originalDts,ze[0].isKeyframe),at.lastSample=new ke(st.dts,st.pts,st.duration,st.originalDts,st.isKeyframe),this._isLive||this._videoSegmentInfoList.append(at),N.samples=ze,N.sequenceNumber++,this._forceFirstIDR){let bt=ze[0].flags;bt.dependsOn=2,bt.isNonSync=0}let lt=ne.moof(N,oe);N.samples=[],N.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(lt,dt).buffer,sampleCount:ze.length,info:at})}_mergeBoxes(x,P){let N=new Uint8Array(x.byteLength+P.byteLength);return N.set(x,0),N.set(P,x.byteLength),N}}var xe=Re,ye={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};class it{constructor(x,P){this.TAG="TransmuxingController",this._emitter=new(K()),this._config=P,x.segments||(x.segments=[{duration:x.duration,filesize:x.filesize,url:x.url}]),typeof x.cors!="boolean"&&(x.cors=!0),typeof x.withCredentials!="boolean"&&(x.withCredentials=!1),this._mediaDataSource=x,this._currentSegmentIndex=0;let N=0;this._mediaDataSource.segments.forEach(W=>{W.timestampBase=N,N+=W.duration,W.cors=x.cors,W.withCredentials=x.withCredentials,P.referrerPolicy&&(W.referrerPolicy=P.referrerPolicy)}),!isNaN(N)&&this._mediaDataSource.duration!==N&&(this._mediaDataSource.duration=N),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(x,P){this._emitter.addListener(x,P)}off(x,P){this._emitter.removeListener(x,P)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(x,P){this._currentSegmentIndex=x;let N=this._mediaDataSource.segments[x],W=this._ioctl=new b(N,this._config,x);W.onError=this._onIOException.bind(this),W.onSeeked=this._onIOSeeked.bind(this),W.onComplete=this._onIOComplete.bind(this),W.onRedirect=this._onIORedirect.bind(this),W.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),P?this._demuxer.bindDataSource(this._ioctl):W.onDataArrival=this._onInitChunkArrival.bind(this),W.open(P)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(x){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let P=this._searchSegmentIndexContains(x);if(P===this._currentSegmentIndex){let N=this._mediaInfo.segments[P];if(N==null)this._pendingSeekTime=x;else{let W=N.getNearestKeyframe(x);this._remuxer.seek(W.milliseconds),this._ioctl.seek(W.fileposition),this._pendingResolveSeekPoint=W.milliseconds}}else{let N=this._mediaInfo.segments[P];if(N==null)this._pendingSeekTime=x,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(P);else{let W=N.getNearestKeyframe(x);this._internalAbort(),this._remuxer.seek(x),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[P].timestampBase,this._loadSegment(P,W.fileposition),this._pendingResolveSeekPoint=W.milliseconds,this._reportSegmentMediaInfo(P)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(x){let P=this._mediaDataSource.segments,N=P.length-1;for(let W=0;W<P.length;W++)if(x<P[W].timestampBase){N=W-1;break}return N}_onInitChunkArrival(x,P){let N=null,W=0;if(P>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,W=this._demuxer.parseChunks(x,P);else if((N=ee.probe(x)).match){this._demuxer=new ee(N,this._config),this._remuxer||(this._remuxer=new xe(this._config));let H=this._mediaDataSource;H.duration!=null&&!isNaN(H.duration)&&(this._demuxer.overridedDuration=H.duration),typeof H.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=H.hasAudio),typeof H.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=H.hasVideo),this._demuxer.timestampBase=H.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),W=this._demuxer.parseChunks(x,P)}else N=null,k.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(ye.DEMUX_ERROR,Ce.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),W=0;return W}_onMediaInfo(x){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},x),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,$.prototype));let P=Object.assign({},x);Object.setPrototypeOf(P,$.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=P,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let N=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(N)})}_onMetaDataArrived(x){this._emitter.emit(ye.METADATA_ARRIVED,x)}_onScriptDataArrived(x){this._emitter.emit(ye.SCRIPTDATA_ARRIVED,x)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(x){let N=x+1;N<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(N)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ye.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(x){let P=this._ioctl.extraData;this._mediaDataSource.segments[P].redirectedURL=x}_onIORecoveredEarlyEof(){this._emitter.emit(ye.RECOVERED_EARLY_EOF)}_onIOException(x,P){k.e(this.TAG,`IOException: type = ${x}, code = ${P.code}, msg = ${P.msg}`),this._emitter.emit(ye.IO_ERROR,x,P),this._disableStatisticsReporter()}_onDemuxException(x,P){k.e(this.TAG,`DemuxException: type = ${x}, info = ${P}`),this._emitter.emit(ye.DEMUX_ERROR,x,P)}_onRemuxerInitSegmentArrival(x,P){this._emitter.emit(ye.INIT_SEGMENT,x,P)}_onRemuxerMediaSegmentArrival(x,P){if(this._pendingSeekTime==null&&(this._emitter.emit(ye.MEDIA_SEGMENT,x,P),this._pendingResolveSeekPoint!=null&&x==="video")){let N=P.info.syncPoints,W=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,_.safari&&N.length>0&&N[0].originalDts===W&&(W=N[0].pts),this._emitter.emit(ye.RECOMMEND_SEEKPOINT,W)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(x){let P=this._mediaInfo.segments[x],N=Object.assign({},P);N.duration=this._mediaInfo.duration,N.segmentCount=this._mediaInfo.segmentCount,delete N.segments,delete N.keyframesIndex,this._emitter.emit(ye.MEDIA_INFO,N)}_reportStatisticsInfo(){let x={};x.url=this._ioctl.currentURL,x.hasRedirect=this._ioctl.hasRedirect,x.hasRedirect&&(x.redirectedURL=this._ioctl.currentRedirectedURL),x.speed=this._ioctl.currentSpeed,x.loaderType=this._ioctl.loaderType,x.currentSegmentIndex=this._currentSegmentIndex,x.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ye.STATISTICS_INFO,x)}}var rt=it,We=function(Se){let x="TransmuxingWorker",P=null,N=at.bind(this);ae.install(),Se.addEventListener("message",function(ze){switch(ze.data.cmd){case"init":P=new rt(ze.data.param[0],ze.data.param[1]),P.on(ye.IO_ERROR,Tt.bind(this)),P.on(ye.DEMUX_ERROR,ct.bind(this)),P.on(ye.INIT_SEGMENT,W.bind(this)),P.on(ye.MEDIA_SEGMENT,H.bind(this)),P.on(ye.LOADING_COMPLETE,oe.bind(this)),P.on(ye.RECOVERED_EARLY_EOF,se.bind(this)),P.on(ye.MEDIA_INFO,Te.bind(this)),P.on(ye.METADATA_ARRIVED,we.bind(this)),P.on(ye.SCRIPTDATA_ARRIVED,Ze.bind(this)),P.on(ye.STATISTICS_INFO,dt.bind(this)),P.on(ye.RECOMMEND_SEEKPOINT,Rt.bind(this));break;case"destroy":P&&(P.destroy(),P=null),Se.postMessage({msg:"destroyed"});break;case"start":P.start();break;case"stop":P.stop();break;case"seek":P.seek(ze.data.param);break;case"pause":P.pause();break;case"resume":P.resume();break;case"logging_config":{let st=ze.data.param;V.applyConfig(st),st.enableCallback===!0?V.addLogListener(N):V.removeLogListener(N);break}}});function W(ze,st){let lt={msg:ye.INIT_SEGMENT,data:{type:ze,data:st}};Se.postMessage(lt,[st.data])}function H(ze,st){let lt={msg:ye.MEDIA_SEGMENT,data:{type:ze,data:st}};Se.postMessage(lt,[st.data])}function oe(){let ze={msg:ye.LOADING_COMPLETE};Se.postMessage(ze)}function se(){let ze={msg:ye.RECOVERED_EARLY_EOF};Se.postMessage(ze)}function Te(ze){let st={msg:ye.MEDIA_INFO,data:ze};Se.postMessage(st)}function we(ze){let st={msg:ye.METADATA_ARRIVED,data:ze};Se.postMessage(st)}function Ze(ze){let st={msg:ye.SCRIPTDATA_ARRIVED,data:ze};Se.postMessage(st)}function dt(ze){let st={msg:ye.STATISTICS_INFO,data:ze};Se.postMessage(st)}function Tt(ze,st){Se.postMessage({msg:ye.IO_ERROR,data:{type:ze,info:st}})}function ct(ze,st){Se.postMessage({msg:ye.DEMUX_ERROR,data:{type:ze,info:st}})}function Rt(ze){Se.postMessage({msg:ye.RECOMMEND_SEEKPOINT,data:ze})}function at(ze,st){Se.postMessage({msg:"logcat_callback",data:{type:ze,logcat:st}})}};class ot{constructor(x,P){if(this.TAG="Transmuxer",this._emitter=new(K()),P.enableWorker&&typeof Worker!="undefined")try{let N=j(18034);this._worker=N(We),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[x,P]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},V.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:V.getConfig()})}catch(N){k.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new rt(x,P)}else this._controller=new rt(x,P);if(this._controller){let N=this._controller;N.on(ye.IO_ERROR,this._onIOError.bind(this)),N.on(ye.DEMUX_ERROR,this._onDemuxError.bind(this)),N.on(ye.INIT_SEGMENT,this._onInitSegment.bind(this)),N.on(ye.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),N.on(ye.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),N.on(ye.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),N.on(ye.MEDIA_INFO,this._onMediaInfo.bind(this)),N.on(ye.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),N.on(ye.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),N.on(ye.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),N.on(ye.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),V.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(x,P){this._emitter.addListener(x,P)}off(x,P){this._emitter.removeListener(x,P)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(x){this._worker?this._worker.postMessage({cmd:"seek",param:x}):this._controller.seek(x)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(x,P){Promise.resolve().then(()=>{this._emitter.emit(ye.INIT_SEGMENT,x,P)})}_onMediaSegment(x,P){Promise.resolve().then(()=>{this._emitter.emit(ye.MEDIA_SEGMENT,x,P)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(ye.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(ye.RECOVERED_EARLY_EOF)})}_onMediaInfo(x){Promise.resolve().then(()=>{this._emitter.emit(ye.MEDIA_INFO,x)})}_onMetaDataArrived(x){Promise.resolve().then(()=>{this._emitter.emit(ye.METADATA_ARRIVED,x)})}_onScriptDataArrived(x){Promise.resolve().then(()=>{this._emitter.emit(ye.SCRIPTDATA_ARRIVED,x)})}_onStatisticsInfo(x){Promise.resolve().then(()=>{this._emitter.emit(ye.STATISTICS_INFO,x)})}_onIOError(x,P){Promise.resolve().then(()=>{this._emitter.emit(ye.IO_ERROR,x,P)})}_onDemuxError(x,P){Promise.resolve().then(()=>{this._emitter.emit(ye.DEMUX_ERROR,x,P)})}_onRecommendSeekpoint(x){Promise.resolve().then(()=>{this._emitter.emit(ye.RECOMMEND_SEEKPOINT,x)})}_onLoggingConfigChanged(x){this._worker&&this._worker.postMessage({cmd:"logging_config",param:x})}_onWorkerMessage(x){let P=x.data,N=P.data;if(P.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(P.msg){case ye.INIT_SEGMENT:case ye.MEDIA_SEGMENT:this._emitter.emit(P.msg,N.type,N.data);break;case ye.LOADING_COMPLETE:case ye.RECOVERED_EARLY_EOF:this._emitter.emit(P.msg);break;case ye.MEDIA_INFO:Object.setPrototypeOf(N,$.prototype),this._emitter.emit(P.msg,N);break;case ye.METADATA_ARRIVED:case ye.SCRIPTDATA_ARRIVED:case ye.STATISTICS_INFO:this._emitter.emit(P.msg,N);break;case ye.IO_ERROR:case ye.DEMUX_ERROR:this._emitter.emit(P.msg,N.type,N.info);break;case ye.RECOMMEND_SEEKPOINT:this._emitter.emit(P.msg,N);break;case"logcat_callback":k.emitter.emit("log",N.type,N.logcat);break;default:break}}}var _t=ot,gt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class wt{constructor(x){this.TAG="MSEController",this._config=x,this._emitter=new(K()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new ft}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(x,P){this._emitter.addListener(x,P)}off(x,P){this._emitter.removeListener(x,P)}attachMediaElement(x){if(this._mediaSource)throw new I("MediaSource has been attached to an HTMLMediaElement!");let P=this._mediaSource=new window.MediaSource;P.addEventListener("sourceopen",this.e.onSourceOpen),P.addEventListener("sourceended",this.e.onSourceEnded),P.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=x,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),x.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let x=this._mediaSource;for(let P in this._sourceBuffers){let N=this._pendingSegments[P];N.splice(0,N.length),this._pendingSegments[P]=null,this._pendingRemoveRanges[P]=null,this._lastInitSegments[P]=null;let W=this._sourceBuffers[P];if(W){if(x.readyState!=="closed"){try{x.removeSourceBuffer(W)}catch(H){k.e(this.TAG,H.message)}W.removeEventListener("error",this.e.onSourceBufferError),W.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[P]=null,this._sourceBuffers[P]=null}}if(x.readyState==="open")try{x.endOfStream()}catch(P){k.e(this.TAG,P.message)}x.removeEventListener("sourceopen",this.e.onSourceOpen),x.removeEventListener("sourceended",this.e.onSourceEnded),x.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(x,P){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(x),this._pendingSegments[x.type].push(x);return}let N=x,W=`${N.container}`;N.codec&&N.codec.length>0&&(W+=`;codecs=${N.codec}`);let H=!1;if(k.v(this.TAG,"Received Initialization Segment, mimeType: "+W),this._lastInitSegments[N.type]=N,W!==this._mimeTypes[N.type]){if(this._mimeTypes[N.type])k.v(this.TAG,`Notice: ${N.type} mimeType changed, origin: ${this._mimeTypes[N.type]}, target: ${W}`);else{H=!0;try{let oe=this._sourceBuffers[N.type]=this._mediaSource.addSourceBuffer(W);oe.addEventListener("error",this.e.onSourceBufferError),oe.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(oe){k.e(this.TAG,oe.message),this._emitter.emit(gt.ERROR,{code:oe.code,msg:oe.message});return}}this._mimeTypes[N.type]=W}P||this._pendingSegments[N.type].push(N),H||this._sourceBuffers[N.type]&&!this._sourceBuffers[N.type].updating&&this._doAppendSegments(),_.safari&&N.container==="audio/mpeg"&&N.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=N.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(x){let P=x;this._pendingSegments[P.type].push(P),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let N=this._sourceBuffers[P.type];N&&!N.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(x){for(let P in this._sourceBuffers){if(!this._sourceBuffers[P])continue;let N=this._sourceBuffers[P];if(this._mediaSource.readyState==="open")try{N.abort()}catch(H){k.e(this.TAG,H.message)}this._idrList.clear();let W=this._pendingSegments[P];if(W.splice(0,W.length),this._mediaSource.readyState!=="closed"){for(let H=0;H<N.buffered.length;H++){let oe=N.buffered.start(H),se=N.buffered.end(H);this._pendingRemoveRanges[P].push({start:oe,end:se})}if(N.updating||this._doRemoveRanges(),_.safari){let H=this._lastInitSegments[P];H&&(this._pendingSegments[P].push(H),N.updating||this._doAppendSegments())}}}}endOfStream(){let x=this._mediaSource,P=this._sourceBuffers;if(!x||x.readyState!=="open"){x&&x.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}P.video&&P.video.updating||P.audio&&P.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,x.endOfStream())}getNearestKeyframe(x){return this._idrList.getLastSyncPointBeforeDts(x)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let x=this._mediaElement.currentTime;for(let P in this._sourceBuffers){let N=this._sourceBuffers[P];if(N){let W=N.buffered;if(W.length>=1&&x-W.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let x=this._mediaElement.currentTime;for(let P in this._sourceBuffers){let N=this._sourceBuffers[P];if(N){let W=N.buffered,H=!1;for(let oe=0;oe<W.length;oe++){let se=W.start(oe),Te=W.end(oe);if(se<=x&&x<Te+3){if(x-se>=this._config.autoCleanupMaxBackwardDuration){H=!0;let we=x-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[P].push({start:se,end:we})}}else Te<x&&(H=!0,this._pendingRemoveRanges[P].push({start:se,end:Te}))}H&&!N.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let x=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||x.video&&x.video.updating||x.audio&&x.audio.updating)return;let P=this._mediaSource.duration,N=this._pendingMediaDuration;N>0&&(isNaN(P)||N>P)&&(k.v(this.TAG,`Update MediaSource duration from ${P} to ${N}`),this._mediaSource.duration=N),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let x in this._pendingRemoveRanges){if(!this._sourceBuffers[x]||this._sourceBuffers[x].updating)continue;let P=this._sourceBuffers[x],N=this._pendingRemoveRanges[x];for(;N.length&&!P.updating;){let W=N.shift();P.remove(W.start,W.end)}}}_doAppendSegments(){let x=this._pendingSegments;for(let P in x)if(!(!this._sourceBuffers[P]||this._sourceBuffers[P].updating)&&x[P].length>0){let N=x[P].shift();if(N.timestampOffset){let W=this._sourceBuffers[P].timestampOffset,H=N.timestampOffset/1e3;Math.abs(W-H)>.1&&(k.v(this.TAG,`Update MPEG audio timestampOffset from ${W} to ${H}`),this._sourceBuffers[P].timestampOffset=H),delete N.timestampOffset}if(!N.data||N.data.byteLength===0)continue;try{this._sourceBuffers[P].appendBuffer(N.data),this._isBufferFull=!1,P==="video"&&N.hasOwnProperty("info")&&this._idrList.appendArray(N.info.syncPoints)}catch(W){this._pendingSegments[P].unshift(N),W.code===22?(this._isBufferFull||this._emitter.emit(gt.BUFFER_FULL),this._isBufferFull=!0):(k.e(this.TAG,W.message),this._emitter.emit(gt.ERROR,{code:W.code,msg:W.message}))}}}_onSourceOpen(){if(k.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let x=this._pendingSourceBufferInit;for(;x.length;){let P=x.shift();this.appendInitSegment(P,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(gt.SOURCE_OPEN)}_onSourceEnded(){k.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){k.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let x=this._pendingSegments;return x.video.length>0||x.audio.length>0}_hasPendingRemoveRanges(){let x=this._pendingRemoveRanges;return x.video.length>0||x.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(gt.UPDATE_END)}_onSourceBufferError(x){k.e(this.TAG,`SourceBuffer Error: ${x}`)}}var mt=wt;const Ct={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ge={NETWORK_EXCEPTION:c.EXCEPTION,NETWORK_STATUS_CODE_INVALID:c.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:c.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:c.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Ce.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Ce.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Ce.CODEC_UNSUPPORTED};class he{constructor(x,P){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(K()),this._config=y(),typeof P=="object"&&Object.assign(this._config,P),x.type.toLowerCase()!=="flv")throw new w("FlvPlayer requires an flv MediaDataSource input!");x.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=x,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let N=_.chrome&&(_.version.major<50||_.version.major===50&&_.version.build<2661);this._alwaysSeekKeyframe=!!(N||_.msedge||_.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(x,P){x===F.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(F.MEDIA_INFO,this.mediaInfo)}):x===F.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(F.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(x,P)}off(x,P){this._emitter.removeListener(x,P)}attachMediaElement(x){if(this._mediaElement=x,x.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),x.addEventListener("seeking",this.e.onvSeeking),x.addEventListener("canplay",this.e.onvCanPlay),x.addEventListener("stalled",this.e.onvStalled),x.addEventListener("progress",this.e.onvProgress),this._msectl=new mt(this._config),this._msectl.on(gt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(gt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(gt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(gt.ERROR,P=>{this._emitter.emit(F.ERROR,Ct.MEDIA_ERROR,Ge.MEDIA_MSE_ERROR,P)}),this._msectl.attachMediaElement(x),this._pendingSeekTime!=null)try{x.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(P){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new I("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new I("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new _t(this._mediaDataSource,this._config),this._transmuxer.on(ye.INIT_SEGMENT,(x,P)=>{this._msectl.appendInitSegment(P)}),this._transmuxer.on(ye.MEDIA_SEGMENT,(x,P)=>{if(this._msectl.appendMediaSegment(P),this._config.lazyLoad&&!this._config.isLive){let N=this._mediaElement.currentTime;P.info.endDts>=(N+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(k.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(ye.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(F.LOADING_COMPLETE)}),this._transmuxer.on(ye.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(F.RECOVERED_EARLY_EOF)}),this._transmuxer.on(ye.IO_ERROR,(x,P)=>{this._emitter.emit(F.ERROR,Ct.NETWORK_ERROR,x,P)}),this._transmuxer.on(ye.DEMUX_ERROR,(x,P)=>{this._emitter.emit(F.ERROR,Ct.MEDIA_ERROR,x,{code:-1,msg:P})}),this._transmuxer.on(ye.MEDIA_INFO,x=>{this._mediaInfo=x,this._emitter.emit(F.MEDIA_INFO,Object.assign({},x))}),this._transmuxer.on(ye.METADATA_ARRIVED,x=>{this._emitter.emit(F.METADATA_ARRIVED,x)}),this._transmuxer.on(ye.SCRIPTDATA_ARRIVED,x=>{this._emitter.emit(F.SCRIPTDATA_ARRIVED,x)}),this._transmuxer.on(ye.STATISTICS_INFO,x=>{this._statisticsInfo=this._fillStatisticsInfo(x),this._emitter.emit(F.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(ye.RECOMMEND_SEEKPOINT,x=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=x/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(x){this._mediaElement.volume=x}get muted(){return this._mediaElement.muted}set muted(x){this._mediaElement.muted=x}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(x){this._mediaElement?this._internalSeek(x):this._pendingSeekTime=x}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(x){if(x.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return x;let P=!0,N=0,W=0;if(this._mediaElement.getVideoPlaybackQuality){let H=this._mediaElement.getVideoPlaybackQuality();N=H.totalVideoFrames,W=H.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(N=this._mediaElement.webkitDecodedFrameCount,W=this._mediaElement.webkitDroppedFrameCount):P=!1;return P&&(x.decodedFrames=N,x.droppedFrames=W),x}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let x=this._mediaElement.buffered,P=this._mediaElement.currentTime,N=0,W=0;for(let H=0;H<x.length;H++){let oe=x.start(H),se=x.end(H);if(oe<=P&&P<se){N=oe,W=se;break}}W>=P+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(k.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){k.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let x=this._mediaElement.currentTime,P=this._mediaElement.buffered,N=!1;for(let W=0;W<P.length;W++){let H=P.start(W),oe=P.end(W);if(x>=H&&x<oe){x>=oe-this._config.lazyLoadRecoverDuration&&(N=!0);break}}N&&(window.clearInterval(this._progressChecker),this._progressChecker=null,N&&(k.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(x){let P=this._mediaElement.buffered;for(let N=0;N<P.length;N++){let W=P.start(N),H=P.end(N);if(x>=W&&x<H)return!0}return!1}_internalSeek(x){let P=this._isTimepointBuffered(x),N=!1,W=0;if(x<1&&this._mediaElement.buffered.length>0){let H=this._mediaElement.buffered.start(0);(H<1&&x<H||_.safari)&&(N=!0,W=_.safari?.1:H)}if(N)this._requestSetTime=!0,this._mediaElement.currentTime=W;else if(P){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=x;else{let H=this._msectl.getNearestKeyframe(Math.floor(x*1e3));this._requestSetTime=!0,H!=null?this._mediaElement.currentTime=H.dts/1e3:this._mediaElement.currentTime=x}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(x),this._transmuxer.seek(Math.floor(x*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=x)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let x=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(x)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(x),this._transmuxer.seek(Math.floor(x*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=x))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(x){let P=this._mediaElement;if(x||!this._receivedCanPlay||P.readyState<2){let N=P.buffered;N.length>0&&P.currentTime<N.start(0)&&(k.w(this.TAG,`Playback seems stuck at ${P.currentTime}, seek to ${N.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=N.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(x){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(x){let P=this._mediaElement.currentTime,N=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(P<1&&N.length>0){let W=N.start(0);if(W<1&&P<W||_.safari){this._requestSetTime=!0,this._mediaElement.currentTime=_.safari?.1:W;return}}if(this._isTimepointBuffered(P)){if(this._alwaysSeekKeyframe){let W=this._msectl.getNearestKeyframe(Math.floor(P*1e3));W!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=W.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:P,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(x){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(x){this._checkAndResumeStuckPlayback(!0)}_onvProgress(x){this._checkAndResumeStuckPlayback()}}var De=he;class be{constructor(x,P){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(K()),this._config=y(),typeof P=="object"&&Object.assign(this._config,P),x.type.toLowerCase()==="flv")throw new w("NativePlayer does't support flv MediaDataSource input!");if(x.hasOwnProperty("segments"))throw new w(`NativePlayer(${x.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=x,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(x,P){x===F.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(F.MEDIA_INFO,this.mediaInfo)}):x===F.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(F.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(x,P)}off(x,P){this._emitter.removeListener(x,P)}attachMediaElement(x){if(this._mediaElement=x,x.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{x.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(P){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new I("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(x){this._mediaElement.volume=x}get muted(){return this._mediaElement.muted}set muted(x){this._mediaElement.muted=x}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(x){this._mediaElement?this._mediaElement.currentTime=x:this._pendingSeekTime=x}get mediaInfo(){let P={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(P.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(P.width=this._mediaElement.videoWidth,P.height=this._mediaElement.videoHeight)),P}get statisticsInfo(){let x={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return x;let P=!0,N=0,W=0;if(this._mediaElement.getVideoPlaybackQuality){let H=this._mediaElement.getVideoPlaybackQuality();N=H.totalVideoFrames,W=H.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(N=this._mediaElement.webkitDecodedFrameCount,W=this._mediaElement.webkitDroppedFrameCount):P=!1;return P&&(x.decodedFrames=N,x.droppedFrames=W),x}_onvLoadedMetadata(x){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(F.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(F.STATISTICS_INFO,this.statisticsInfo)}}var Ee=be;ae.install();function je(Se,x){let P=Se;if(P==null||typeof P!="object")throw new w("MediaDataSource must be an javascript object!");if(!P.hasOwnProperty("type"))throw new w("MediaDataSource must has type field to indicate video file type!");switch(P.type){case"flv":return new De(P,x);default:return new Ee(P,x)}}function Je(){return R.supportMSEH264Playback()}function Qe(){return R.getFeatureList()}let Xe={};Xe.createPlayer=je,Xe.isSupported=Je,Xe.getFeatureList=Qe,Xe.BaseLoader=m,Xe.LoaderStatus=p,Xe.LoaderErrors=c,Xe.Events=F,Xe.ErrorTypes=Ct,Xe.ErrorDetails=Ge,Xe.FlvPlayer=De,Xe.NativePlayer=Ee,Xe.LoggingControl=V,Object.defineProperty(Xe,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var He=Xe},20640:function(Et,Fe,j){"use strict";var Z=j(11742),ae={"text/plain":"Text","text/html":"Url",default:"Text"},Q="Copy to clipboard: #{key}, Enter";function K(k){var O=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return k.replace(/#{\s*key\s*}/g,O)}function C(k,O){var B,e,I,w,u,p,c=!1;O||(O={}),B=O.debug||!1;try{I=Z(),w=document.createRange(),u=document.getSelection(),p=document.createElement("span"),p.textContent=k,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(l){if(l.stopPropagation(),O.format)if(l.preventDefault(),typeof l.clipboardData=="undefined"){B&&console.warn("unable to use e.clipboardData"),B&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var g=ae[O.format]||ae.default;window.clipboardData.setData(g,k)}else l.clipboardData.clearData(),l.clipboardData.setData(O.format,k);O.onCopy&&(l.preventDefault(),O.onCopy(l.clipboardData))}),document.body.appendChild(p),w.selectNodeContents(p),u.addRange(w);var m=document.execCommand("copy");if(!m)throw new Error("copy command was unsuccessful");c=!0}catch(l){B&&console.error("unable to copy using execCommand: ",l),B&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(O.format||"text",k),O.onCopy&&O.onCopy(window.clipboardData),c=!0}catch(g){B&&console.error("unable to copy using clipboardData: ",g),B&&console.error("falling back to prompt"),e=K("message"in O?O.message:Q),window.prompt(e,k)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(w):u.removeAllRanges()),p&&document.body.removeChild(p),I()}return c}Et.exports=C},82702:function(Et,Fe,j){var Z=j(34155);(function(ae,Q){Et.exports=Q()})(this,function(){"use strict";function ae(q){var ue=typeof q;return q!==null&&(ue==="object"||ue==="function")}function Q(q){return typeof q=="function"}var K=void 0;Array.isArray?K=Array.isArray:K=function(q){return Object.prototype.toString.call(q)==="[object Array]"};var C=K,k=0,O=void 0,B=void 0,e=function(ue,ee){r[k]=ue,r[k+1]=ee,k+=2,k===2&&(B?B(v):f())};function I(q){B=q}function w(q){e=q}var u=typeof window!="undefined"?window:void 0,p=u||{},c=p.MutationObserver||p.WebKitMutationObserver,m=typeof self=="undefined"&&typeof Z!="undefined"&&{}.toString.call(Z)==="[object process]",l=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function g(){return function(){return Z.nextTick(v)}}function _(){return typeof O!="undefined"?function(){O(v)}:n()}function o(){var q=0,ue=new c(v),ee=document.createTextNode("");return ue.observe(ee,{characterData:!0}),function(){ee.data=q=++q%2}}function s(){var q=new MessageChannel;return q.port1.onmessage=v,function(){return q.port2.postMessage(0)}}function n(){var q=setTimeout;return function(){return q(v,1)}}var r=new Array(1e3);function v(){for(var q=0;q<k;q+=2){var ue=r[q],ee=r[q+1];ue(ee),r[q]=void 0,r[q+1]=void 0}k=0}function E(){try{var q=Function("return this")().require("vertx");return O=q.runOnLoop||q.runOnContext,_()}catch(ue){return n()}}var f=void 0;m?f=g():c?f=o():l?f=s():u===void 0?f=E():f=n();function S(q,ue){var ee=this,z=new this.constructor(D);z[A]===void 0&&me(z);var ne=ee._state;if(ne){var ce=arguments[ne-1];e(function(){return le(ne,z,ce,ee._result)})}else re(ee,z,q,ue);return z}function L(q){var ue=this;if(q&&typeof q=="object"&&q.constructor===ue)return q;var ee=new ue(D);return M(ee,q),ee}var A=Math.random().toString(36).substring(2);function D(){}var a=void 0,i=1,t=2;function h(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function T(q,ue,ee,z){try{q.call(ue,ee,z)}catch(ne){return ne}}function y(q,ue,ee){e(function(z){var ne=!1,ce=T(ee,ue,function(ge){ne||(ne=!0,ue!==ge?M(z,ge):U(z,ge))},function(ge){ne||(ne=!0,V(z,ge))},"Settle: "+(z._label||" unknown promise"));!ne&&ce&&(ne=!0,V(z,ce))},q)}function d(q,ue){ue._state===i?U(q,ue._result):ue._state===t?V(q,ue._result):re(ue,void 0,function(ee){return M(q,ee)},function(ee){return V(q,ee)})}function R(q,ue,ee){ue.constructor===q.constructor&&ee===S&&ue.constructor.resolve===L?d(q,ue):ee===void 0?U(q,ue):Q(ee)?y(q,ue,ee):U(q,ue)}function M(q,ue){if(q===ue)V(q,h());else if(ae(ue)){var ee=void 0;try{ee=ue.then}catch(z){V(q,z);return}R(q,ue,ee)}else U(q,ue)}function F(q){q._onerror&&q._onerror(q._result),$(q)}function U(q,ue){q._state===a&&(q._result=ue,q._state=i,q._subscribers.length!==0&&e($,q))}function V(q,ue){q._state===a&&(q._state=t,q._result=ue,e(F,q))}function re(q,ue,ee,z){var ne=q._subscribers,ce=ne.length;q._onerror=null,ne[ce]=ue,ne[ce+i]=ee,ne[ce+t]=z,ce===0&&q._state&&e($,q)}function $(q){var ue=q._subscribers,ee=q._state;if(ue.length!==0){for(var z=void 0,ne=void 0,ce=q._result,ge=0;ge<ue.length;ge+=3)z=ue[ge],ne=ue[ge+ee],z?le(ee,z,ne,ce):ne(ce);q._subscribers.length=0}}function le(q,ue,ee,z){var ne=Q(ee),ce=void 0,ge=void 0,ke=!0;if(ne){try{ce=ee(z)}catch($e){ke=!1,ge=$e}if(ue===ce){V(ue,b());return}}else ce=z;ue._state!==a||(ne&&ke?M(ue,ce):ke===!1?V(ue,ge):q===i?U(ue,ce):q===t&&V(ue,ce))}function te(q,ue){try{ue(function(z){M(q,z)},function(z){V(q,z)})}catch(ee){V(q,ee)}}var _e=0;function fe(){return _e++}function me(q){q[A]=_e++,q._state=void 0,q._result=void 0,q._subscribers=[]}function Ae(){return new Error("Array Methods must be provided an Array")}var Be=function(){function q(ue,ee){this._instanceConstructor=ue,this.promise=new ue(D),this.promise[A]||me(this.promise),C(ee)?(this.length=ee.length,this._remaining=ee.length,this._result=new Array(this.length),this.length===0?U(this.promise,this._result):(this.length=this.length||0,this._enumerate(ee),this._remaining===0&&U(this.promise,this._result))):V(this.promise,Ae())}return q.prototype._enumerate=function(ee){for(var z=0;this._state===a&&z<ee.length;z++)this._eachEntry(ee[z],z)},q.prototype._eachEntry=function(ee,z){var ne=this._instanceConstructor,ce=ne.resolve;if(ce===L){var ge=void 0,ke=void 0,$e=!1;try{ge=ee.then}catch(Ne){$e=!0,ke=Ne}if(ge===S&&ee._state!==a)this._settledAt(ee._state,z,ee._result);else if(typeof ge!="function")this._remaining--,this._result[z]=ee;else if(ne===ie){var ft=new ne(D);$e?V(ft,ke):R(ft,ee,ge),this._willSettleAt(ft,z)}else this._willSettleAt(new ne(function(Ne){return Ne(ee)}),z)}else this._willSettleAt(ce(ee),z)},q.prototype._settledAt=function(ee,z,ne){var ce=this.promise;ce._state===a&&(this._remaining--,ee===t?V(ce,ne):this._result[z]=ne),this._remaining===0&&U(ce,this._result)},q.prototype._willSettleAt=function(ee,z){var ne=this;re(ee,void 0,function(ce){return ne._settledAt(i,z,ce)},function(ce){return ne._settledAt(t,z,ce)})},q}();function Le(q){return new Be(this,q).promise}function Ie(q){var ue=this;return C(q)?new ue(function(ee,z){for(var ne=q.length,ce=0;ce<ne;ce++)ue.resolve(q[ce]).then(ee,z)}):new ue(function(ee,z){return z(new TypeError("You must pass an array to race."))})}function pe(q){var ue=this,ee=new ue(D);return V(ee,q),ee}function Ke(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ce(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var ie=function(){function q(ue){this[A]=fe(),this._result=this._state=void 0,this._subscribers=[],D!==ue&&(typeof ue!="function"&&Ke(),this instanceof q?te(this,ue):Ce())}return q.prototype.catch=function(ee){return this.then(null,ee)},q.prototype.finally=function(ee){var z=this,ne=z.constructor;return Q(ee)?z.then(function(ce){return ne.resolve(ee()).then(function(){return ce})},function(ce){return ne.resolve(ee()).then(function(){throw ce})}):z.then(ee,ee)},q}();ie.prototype.then=S,ie.all=Le,ie.race=Ie,ie.resolve=L,ie.reject=pe,ie._setScheduler=I,ie._setAsap=w,ie._asap=e;function X(){var q=void 0;if(typeof j.g!="undefined")q=j.g;else if(typeof self!="undefined")q=self;else try{q=Function("return this")()}catch(z){throw new Error("polyfill failed because global object is unavailable in this environment")}var ue=q.Promise;if(ue){var ee=null;try{ee=Object.prototype.toString.call(ue.resolve())}catch(z){}if(ee==="[object Promise]"&&!ue.cast)return}q.Promise=ie}return ie.polyfill=X,ie.Promise=ie,ie})},17187:function(Et){"use strict";var Fe=typeof Reflect=="object"?Reflect:null,j=Fe&&typeof Fe.apply=="function"?Fe.apply:function(s,n,r){return Function.prototype.apply.call(s,n,r)},Z;Fe&&typeof Fe.ownKeys=="function"?Z=Fe.ownKeys:Object.getOwnPropertySymbols?Z=function(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:Z=function(s){return Object.getOwnPropertyNames(s)};function ae(o){console&&console.warn&&console.warn(o)}var Q=Number.isNaN||function(s){return s!==s};function K(){K.init.call(this)}Et.exports=K,Et.exports.once=l,K.EventEmitter=K,K.prototype._events=void 0,K.prototype._eventsCount=0,K.prototype._maxListeners=void 0;var C=10;function k(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(K,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(o){if(typeof o!="number"||o<0||Q(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");C=o}}),K.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},K.prototype.setMaxListeners=function(s){if(typeof s!="number"||s<0||Q(s))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+s+".");return this._maxListeners=s,this};function O(o){return o._maxListeners===void 0?K.defaultMaxListeners:o._maxListeners}K.prototype.getMaxListeners=function(){return O(this)},K.prototype.emit=function(s){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var v=s==="error",E=this._events;if(E!==void 0)v=v&&E.error===void 0;else if(!v)return!1;if(v){var f;if(n.length>0&&(f=n[0]),f instanceof Error)throw f;var S=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw S.context=f,S}var L=E[s];if(L===void 0)return!1;if(typeof L=="function")j(L,this,n);else for(var A=L.length,D=p(L,A),r=0;r<A;++r)j(D[r],this,n);return!0};function B(o,s,n,r){var v,E,f;if(k(n),E=o._events,E===void 0?(E=o._events=Object.create(null),o._eventsCount=0):(E.newListener!==void 0&&(o.emit("newListener",s,n.listener?n.listener:n),E=o._events),f=E[s]),f===void 0)f=E[s]=n,++o._eventsCount;else if(typeof f=="function"?f=E[s]=r?[n,f]:[f,n]:r?f.unshift(n):f.push(n),v=O(o),v>0&&f.length>v&&!f.warned){f.warned=!0;var S=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(s)+" listeners added. Use emitter.setMaxListeners() to increase limit");S.name="MaxListenersExceededWarning",S.emitter=o,S.type=s,S.count=f.length,ae(S)}return o}K.prototype.addListener=function(s,n){return B(this,s,n,!1)},K.prototype.on=K.prototype.addListener,K.prototype.prependListener=function(s,n){return B(this,s,n,!0)};function e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I(o,s,n){var r={fired:!1,wrapFn:void 0,target:o,type:s,listener:n},v=e.bind(r);return v.listener=n,r.wrapFn=v,v}K.prototype.once=function(s,n){return k(n),this.on(s,I(this,s,n)),this},K.prototype.prependOnceListener=function(s,n){return k(n),this.prependListener(s,I(this,s,n)),this},K.prototype.removeListener=function(s,n){var r,v,E,f,S;if(k(n),v=this._events,v===void 0)return this;if(r=v[s],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete v[s],v.removeListener&&this.emit("removeListener",s,r.listener||n));else if(typeof r!="function"){for(E=-1,f=r.length-1;f>=0;f--)if(r[f]===n||r[f].listener===n){S=r[f].listener,E=f;break}if(E<0)return this;E===0?r.shift():c(r,E),r.length===1&&(v[s]=r[0]),v.removeListener!==void 0&&this.emit("removeListener",s,S||n)}return this},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(s){var n,r,v;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[s]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[s]),this;if(arguments.length===0){var E=Object.keys(r),f;for(v=0;v<E.length;++v)f=E[v],f!=="removeListener"&&this.removeAllListeners(f);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[s],typeof n=="function")this.removeListener(s,n);else if(n!==void 0)for(v=n.length-1;v>=0;v--)this.removeListener(s,n[v]);return this};function w(o,s,n){var r=o._events;if(r===void 0)return[];var v=r[s];return v===void 0?[]:typeof v=="function"?n?[v.listener||v]:[v]:n?m(v):p(v,v.length)}K.prototype.listeners=function(s){return w(this,s,!0)},K.prototype.rawListeners=function(s){return w(this,s,!1)},K.listenerCount=function(o,s){return typeof o.listenerCount=="function"?o.listenerCount(s):u.call(o,s)},K.prototype.listenerCount=u;function u(o){var s=this._events;if(s!==void 0){var n=s[o];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}K.prototype.eventNames=function(){return this._eventsCount>0?Z(this._events):[]};function p(o,s){for(var n=new Array(s),r=0;r<s;++r)n[r]=o[r];return n}function c(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}function m(o){for(var s=new Array(o.length),n=0;n<s.length;++n)s[n]=o[n].listener||o[n];return s}function l(o,s){return new Promise(function(n,r){function v(f){o.removeListener(s,E),r(f)}function E(){typeof o.removeListener=="function"&&o.removeListener("error",v),n([].slice.call(arguments))}_(o,s,E,{once:!0}),s!=="error"&&g(o,v,{once:!0})})}function g(o,s,n){typeof o.on=="function"&&_(o,"error",s,n)}function _(o,s,n,r){if(typeof o.on=="function")r.once?o.once(s,n):o.on(s,n);else if(typeof o.addEventListener=="function")o.addEventListener(s,function v(E){r.once&&o.removeEventListener(s,v),n(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}},67631:function(Et){typeof window!="undefined"&&function(j,Z){Et.exports=Z()}(this,()=>(()=>{var Fe={"./src/config.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{enableStreamingMode:()=>i,hlsDefaultConfig:()=>A,mergeConfig:()=>a});var k=C("./src/controller/abr-controller.ts"),O=C("./src/controller/audio-stream-controller.ts"),B=C("./src/controller/audio-track-controller.ts"),e=C("./src/controller/subtitle-stream-controller.ts"),I=C("./src/controller/subtitle-track-controller.ts"),w=C("./src/controller/buffer-controller.ts"),u=C("./src/controller/timeline-controller.ts"),p=C("./src/controller/cap-level-controller.ts"),c=C("./src/controller/fps-controller.ts"),m=C("./src/controller/eme-controller.ts"),l=C("./src/controller/cmcd-controller.ts"),g=C("./src/utils/xhr-loader.ts"),_=C("./src/utils/fetch-loader.ts"),o=C("./src/utils/cues.ts"),s=C("./src/utils/mediakeys-helper.ts"),n=C("./src/utils/logger.ts");function r(){return r=Object.assign?Object.assign.bind():function(t){for(var h=1;h<arguments.length;h++){var b=arguments[h];for(var T in b)Object.prototype.hasOwnProperty.call(b,T)&&(t[T]=b[T])}return t},r.apply(this,arguments)}function v(t,h){var b=Object.keys(t);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(t);h&&(T=T.filter(function(y){return Object.getOwnPropertyDescriptor(t,y).enumerable})),b.push.apply(b,T)}return b}function E(t){for(var h=1;h<arguments.length;h++){var b=arguments[h]!=null?arguments[h]:{};h%2?v(Object(b),!0).forEach(function(T){f(t,T,b[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(b)):v(Object(b)).forEach(function(T){Object.defineProperty(t,T,Object.getOwnPropertyDescriptor(b,T))})}return t}function f(t,h,b){return h=S(h),h in t?Object.defineProperty(t,h,{value:b,enumerable:!0,configurable:!0,writable:!0}):t[h]=b,t}function S(t){var h=L(t,"string");return typeof h=="symbol"?h:String(h)}function L(t,h){if(typeof t!="object"||t===null)return t;var b=t[Symbol.toPrimitive];if(b!==void 0){var T=b.call(t,h||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(t)}var A=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,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:g.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:w.default,capLevelController:p.default,fpsController:c.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,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},D()),{},{subtitleStreamController:e.SubtitleStreamController,subtitleTrackController:I.default,timelineController:u.TimelineController,audioStreamController:O.default,audioTrackController:B.default,emeController:m.default,cmcdController:l.default});function D(){return{cueHandler:o.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function a(t,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return r({},t,h)}function i(t){var h=t.loader;if(h!==_.default&&h!==g.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{var b=(0,_.fetchSupported)();b&&(t.loader=_.default,t.progressive=!0,t.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>g});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/ewma-bandwidth-estimator.ts"),B=C("./src/events.ts"),e=C("./src/errors.ts"),I=C("./src/types/loader.ts"),w=C("./src/utils/logger.ts");function u(_,o){for(var s=0;s<o.length;s++){var n=o[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(_,c(n.key),n)}}function p(_,o,s){return o&&u(_.prototype,o),s&&u(_,s),Object.defineProperty(_,"prototype",{writable:!1}),_}function c(_){var o=m(_,"string");return typeof o=="symbol"?o:String(o)}function m(_,o){if(typeof _!="object"||_===null)return _;var s=_[Symbol.toPrimitive];if(s!==void 0){var n=s.call(_,o||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(_)}var l=function(){function _(s){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=s;var n=s.config;this.bwEstimator=new O.default(n.abrEwmaSlowVoD,n.abrEwmaFastVoD,n.abrEwmaDefaultEstimate),this.registerListeners()}var o=_.prototype;return o.registerListeners=function(){var n=this.hls;n.on(B.Events.FRAG_LOADING,this.onFragLoading,this),n.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.on(B.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var n=this.hls;n.off(B.Events.FRAG_LOADING,this.onFragLoading,this),n.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.off(B.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(n,r){var v=r.frag;if(v.type===I.PlaylistLevelType.MAIN&&!this.timer){var E;this.fragCurrent=v,this.partCurrent=(E=r.part)!=null?E:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(n,r){var v=this.hls.config;r.details.live?this.bwEstimator.update(v.abrEwmaSlowLive,v.abrEwmaFastLive):this.bwEstimator.update(v.abrEwmaSlowVoD,v.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var n=this.fragCurrent,r=this.partCurrent,v=this.hls,E=v.autoLevelEnabled,f=v.media;if(!(!n||!f)){var S=r?r.stats:n.stats,L=r?r.duration:n.duration;if(S.aborted||S.loaded&&S.loaded===S.total||n.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!(!E||f.paused||!f.playbackRate||!f.readyState)){var A=v.mainForwardBufferInfo;if(A!==null){var D=performance.now()-S.loading.start,a=Math.abs(f.playbackRate);if(!(D<=500*L/a)){var i=S.loaded&&S.loading.first,t=this.bwEstimator.getEstimate(),h=v.levels,b=v.minAutoLevel,T=h[n.level],y=S.total||Math.max(S.loaded,Math.round(L*T.maxBitrate/8)),d=i?S.loaded*1e3/D:0,R=d?(y-S.loaded)/d:y*8/t,M=A.len/a;if(!(R<=M)){var F=Number.POSITIVE_INFINITY,U;for(U=n.level-1;U>b;U--){var V=h[U].maxBitrate;if(F=d?L*V/(8*.8*d):L*V/t,F<M)break}F>=R||(w.logger.warn("Fragment "+n.sn+(r?" part "+r.index:"")+" of level "+n.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+U+`
Current BW estimate: `+((0,k.isFiniteNumber)(t)?(t/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+R.toFixed(3)+` s
Estimated load time for the next fragment: `+F.toFixed(3)+` s
Time to underbuffer: `+M.toFixed(3)+" s"),v.nextLoadLevel=U,i&&this.bwEstimator.sample(D,S.loaded),this.clearTimer(),(n.loader||n.keyLoader)&&(this.fragCurrent=this.partCurrent=null,n.abortRequests()),v.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:r,stats:S}))}}}}}},o.onFragLoaded=function(n,r){var v=r.frag,E=r.part;if(v.type===I.PlaylistLevelType.MAIN&&(0,k.isFiniteNumber)(v.sn)){var f=E?E.stats:v.stats,S=E?E.duration:v.duration;if(this.clearTimer(),this.lastLoadedFragLevel=v.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var L=this.hls.levels[v.level],A=(L.loaded?L.loaded.bytes:0)+f.loaded,D=(L.loaded?L.loaded.duration:0)+S;L.loaded={bytes:A,duration:D},L.realBitrate=Math.round(8*A/D)}if(v.bitrateTest){var a={stats:f,frag:v,part:E,id:v.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,a)}}},o.onFragBuffered=function(n,r){var v=r.frag,E=r.part,f=E?E.stats:v.stats;if(!f.aborted&&!(v.type!==I.PlaylistLevelType.MAIN||v.sn==="initSegment")){var S=f.parsing.end-f.loading.start;this.bwEstimator.sample(S,f.loaded),f.bwEstimate=this.bwEstimator.getEstimate(),v.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0}},o.onError=function(n,r){var v;if(((v=r.frag)===null||v===void 0?void 0:v.type)===I.PlaylistLevelType.MAIN){if(r.type===e.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(r.details){case e.ErrorDetails.FRAG_LOAD_ERROR:case e.ErrorDetails.FRAG_LOAD_TIMEOUT:case e.ErrorDetails.KEY_LOAD_ERROR:case e.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var n=this.fragCurrent,r=this.partCurrent,v=this.hls,E=v.maxAutoLevel,f=v.config,S=v.minAutoLevel,L=v.media,A=r?r.duration:n?n.duration:0,D=L&&L.playbackRate!==0?Math.abs(L.playbackRate):1,a=this.bwEstimator?this.bwEstimator.getEstimate():f.abrEwmaDefaultEstimate,i=v.mainForwardBufferInfo,t=(i?i.len:0)/D,h=this.findBestLevel(a,S,E,t,f.abrBandWidthFactor,f.abrBandWidthUpFactor);if(h>=0)return h;w.logger.trace((t?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=A?Math.min(A,f.maxStarvationDelay):f.maxStarvationDelay,T=f.abrBandWidthFactor,y=f.abrBandWidthUpFactor;if(!t){var d=this.bitrateTestDelay;if(d){var R=A?Math.min(A,f.maxLoadingDelay):f.maxLoadingDelay;b=R-d,w.logger.trace("bitrate test took "+Math.round(1e3*d)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),T=y=1}}return h=this.findBestLevel(a,S,E,t+b,T,y),Math.max(h,0)},o.findBestLevel=function(n,r,v,E,f,S){for(var L,A=this.fragCurrent,D=this.partCurrent,a=this.lastLoadedFragLevel,i=this.hls.levels,t=i[a],h=!!(t!=null&&(L=t.details)!==null&&L!==void 0&&L.live),b=t==null?void 0:t.codecSet,T=D?D.duration:A?A.duration:0,y=v;y>=r;y--){var d=i[y];if(!(!d||b&&d.codecSet!==b)){var R=d.details,M=(D?R==null?void 0:R.partTarget:R==null?void 0:R.averagetargetduration)||T,F=void 0;y<=a?F=f*n:F=S*n;var U=i[y].maxBitrate,V=U*M/F;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(F)+"/"+U+"/"+M+"/"+E+"/"+V),F>U&&(V===0||!(0,k.isFiniteNumber)(V)||h&&!this.bitrateTestDelay||V<E))return y}}return-1},p(_,[{key:"nextAutoLevel",get:function(){var n=this._nextAutoLevel,r=this.bwEstimator;if(n!==-1&&!r.canEstimate())return n;var v=this.getNextABRAutoLevel();return n!==-1&&this.hls.levels[v].loadError?n:(n!==-1&&(v=Math.min(n,v)),v)},set:function(n){this._nextAutoLevel=n}}]),_}();const g=l},"./src/controller/audio-stream-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>f});var k=C("./src/polyfills/number.ts"),O=C("./src/controller/base-stream-controller.ts"),B=C("./src/events.ts"),e=C("./src/utils/buffer-helper.ts"),I=C("./src/controller/fragment-tracker.ts"),w=C("./src/types/level.ts"),u=C("./src/types/loader.ts"),p=C("./src/loader/fragment.ts"),c=C("./src/demux/chunk-cache.ts"),m=C("./src/demux/transmuxer-interface.ts"),l=C("./src/types/transmuxer.ts"),g=C("./src/controller/fragment-finders.ts"),_=C("./src/utils/discontinuities.ts"),o=C("./src/errors.ts");function s(){return s=Object.assign?Object.assign.bind():function(S){for(var L=1;L<arguments.length;L++){var A=arguments[L];for(var D in A)Object.prototype.hasOwnProperty.call(A,D)&&(S[D]=A[D])}return S},s.apply(this,arguments)}function n(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,r(S,L)}function r(S,L){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,a){return D.__proto__=a,D},r(S,L)}var v=100,E=function(S){n(L,S);function L(D,a,i){var t;return t=S.call(this,D,a,i,"[audio-stream-controller]")||this,t.videoBuffer=null,t.videoTrackCC=-1,t.waitingVideoCC=-1,t.audioSwitch=!1,t.trackId=-1,t.waitingData=null,t.mainDetails=null,t.bufferFlushed=!1,t.cachedTrackLoadedData=null,t._registerListeners(),t}var A=L.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var a=this.hls;a.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(B.Events.ERROR,this.onError,this),a.on(B.Events.BUFFER_RESET,this.onBufferReset,this),a.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var a=this.hls;a.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(B.Events.ERROR,this.onError,this),a.off(B.Events.BUFFER_RESET,this.onBufferReset,this),a.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(a,i){var t=i.frag,h=i.id,b=i.initPTS;if(h==="main"){var T=t.cc;this.initPTS[t.cc]=b,this.log("InitPTS for cc: "+T+" found from main: "+b),this.videoTrackCC=T,this.state===O.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(a){if(!this.levels){this.startPosition=a,this.state=O.State.STOPPED;return}var i=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,i>0&&a===-1?(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),a=i,this.state=O.State.IDLE):(this.loadedmetadata=!1,this.state=O.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()},A.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_TRACK:{var a,i=this.levels,t=this.trackId,h=i==null||(a=i[t])===null||a===void 0?void 0:a.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=O.State.WAITING_INIT_PTS}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var b,T=performance.now(),y=this.retryDate;(!y||T>=y||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=O.State.IDLE);break}case O.State.WAITING_INIT_PTS:{var d=this.waitingData;if(d){var R=d.frag,M=d.part,F=d.cache,U=d.complete;if(this.initPTS[R.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.FRAG_LOADING;var V=F.flush(),re={frag:R,part:M,payload:V,networkDetails:null};this._handleFragmentLoadProgress(re),U&&S.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+R.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var $=this.getLoadPosition(),le=e.BufferHelper.bufferInfo(this.mediaBuffer,$,this.config.maxBufferHole),te=(0,g.fragmentWithinToleranceTest)(le.end,this.config.maxFragLookUpTolerance,R);te<0&&(this.log("Waiting fragment cc ("+R.cc+") @ "+R.start+" cancelled because another fragment at "+le.end+" is needed"),this.clearWaitingFragment())}}else this.state=O.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var a=this.waitingData;a&&(this.fragmentTracker.removeFragment(a.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.IDLE)},A.resetLoadingState=function(){this.clearWaitingFragment(),S.prototype.resetLoadingState.call(this)},A.onTickEnd=function(){var a=this.media;!a||!a.readyState||(this.lastCurrentTime=a.currentTime)},A.doTickIdle=function(){var a=this.hls,i=this.levels,t=this.media,h=this.trackId,b=a.config;if(!(!i||!i[h])&&!(!t&&(this.startFragRequested||!b.startFragPrefetch))){var T=i[h],y=T.details;if(!y||y.live&&this.levelLastLoaded!==h||this.waitForCdnTuneIn(y)){this.state=O.State.WAITING_TRACK;return}var d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,p.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var R=this.getFwdBufferInfo(d,u.PlaylistLevelType.AUDIO);if(R!==null){var M=this.audioSwitch;if(!M&&this._streamEnded(R,y)){a.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=O.State.ENDED;return}var F=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN),U=R.len,V=this.getMaxBufferLength(F==null?void 0:F.len);if(!(U>=V&&!M)){var re=y.fragments,$=re[0].start,le=R.end;if(M&&t){var te=this.getLoadPosition();le=te,y.PTSKnown&&te<$&&(R.end>$||R.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),t.currentTime=$+.05)}if(!(F&&le>F.end+y.targetduration)&&!((!F||!F.len)&&R.len)){var _e=this.getNextFragment(le,y);if(!_e){this.bufferFlushed=!0;return}this.loadFragment(_e,y,le)}}}}},A.getMaxBufferLength=function(a){var i=S.prototype.getMaxBufferLength.call(this);return a?Math.max(i,a):i},A.onMediaDetaching=function(){this.videoBuffer=null,S.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(a,i){var t=i.audioTracks;this.resetTransmuxer(),this.levels=t.map(function(h){return new w.Level(h)})},A.onAudioTrackSwitching=function(a,i){var t=!!i.url;this.trackId=i.id;var h=this.fragCurrent;h&&h.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),t?this.setInterval(v):this.resetTransmuxer(),t?(this.audioSwitch=!0,this.state=O.State.IDLE):this.state=O.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(a,i){this.mainDetails=i.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},A.onAudioTrackLoaded=function(a,i){var t;if(this.mainDetails==null){this.cachedTrackLoadedData=i;return}var h=this.levels,b=i.details,T=i.id;if(!h){this.warn("Audio tracks were reset while loading level "+T);return}this.log("Track "+T+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var y=h[T],d=0;if(b.live||(t=y.details)!==null&&t!==void 0&&t.live){var R=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!R)return;!y.details&&b.hasProgramDateTime&&R.hasProgramDateTime?((0,_.alignMediaPlaylistByPDT)(b,R),d=b.fragments[0].start):d=this.alignPlaylists(b,y.details)}y.details=b,this.levelLastLoaded=T,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(y.details,d),this.state===O.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=O.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(a){var i,t=a.frag,h=a.part,b=a.payload,T=this.config,y=this.trackId,d=this.levels;if(!d){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+t.sn+" of level "+t.level+" will not be buffered");return}var R=d[y];console.assert(R,"Audio track is defined on fragment load progress");var M=R.details;console.assert(M,"Audio track details are defined on fragment load progress");var F=T.defaultAudioCodec||R.audioCodec||"mp4a.40.2",U=this.transmuxer;U||(U=this.transmuxer=new m.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[t.cc],re=(i=t.initSegment)===null||i===void 0?void 0:i.data;if(V!==void 0){var $=!1,le=h?h.index:-1,te=le!==-1,_e=new l.ChunkMetadata(t.level,t.sn,t.stats.chunkCount,b.byteLength,le,te);U.push(b,re,F,"",t,h,M.totalduration,$,_e,V)}else{this.log("Unknown video PTS for cc "+t.cc+", waiting for video PTS before demuxing audio frag "+t.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+y);var fe=this.waitingData=this.waitingData||{frag:t,part:h,cache:new c.default,complete:!1},me=fe.cache;me.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=O.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(a){if(this.waitingData){this.waitingData.complete=!0;return}S.prototype._handleFragmentLoadComplete.call(this,a)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(a,i){var t=i.tracks.audio;t&&(this.mediaBuffer=t.buffer||null),i.tracks.video&&(this.videoBuffer=i.tracks.video.buffer||null)},A.onFragBuffered=function(a,i){var t=i.frag,h=i.part;if(t.type!==u.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&t.type===u.PlaylistLevelType.MAIN){var b;(b=this.videoBuffer||this.media)!==null&&b!==void 0&&b.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(t)){this.warn("Fragment "+t.sn+(h?" p: "+h.index:"")+" of level "+t.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}t.sn!=="initSegment"&&(this.fragPrevious=t,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(t,h)},A.onError=function(a,i){if(i.type===o.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,i);return}switch(i.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.FRAG_PARSING_ERROR:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,i);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==O.State.ERROR&&this.state!==O.State.STOPPED&&(this.state=i.fatal?O.State.ERROR:O.State.IDLE,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="audio"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var t=!0,h=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);h&&h.len>.5&&(t=!this.reduceMaxBufferLength(h.len)),t&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(a,i){var t=i.type;t===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===O.State.ENDED&&(this.state=O.State.IDLE))},A._handleTransmuxComplete=function(a){var i,t="audio",h=this.hls,b=a.remuxResult,T=a.chunkMeta,y=this.getCurrentContext(T);if(!y){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(T.level);return}var d=y.frag,R=y.part,M=y.level.details,F=b.audio,U=b.text,V=b.id3,re=b.initSegment;if(!(this.fragContextChanged(d)||!M)){if(this.state=O.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),re!=null&&re.tracks&&(this._bufferInitSegment(re.tracks,d,T),h.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:d,id:t,tracks:re.tracks})),F){var $=F.startPTS,le=F.endPTS,te=F.startDTS,_e=F.endDTS;R&&(R.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:le,startDTS:te,endDTS:_e}),d.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,$,le,te,_e),this.bufferFragmentData(F,d,R,T)}if(V!=null&&(i=V.samples)!==null&&i!==void 0&&i.length){var fe=s({id:t,frag:d,details:M},V);h.trigger(B.Events.FRAG_PARSING_METADATA,fe)}if(U){var me=s({id:t,frag:d,details:M},U);h.trigger(B.Events.FRAG_PARSING_USERDATA,me)}}},A._bufferInitSegment=function(a,i,t){if(this.state===O.State.PARSING){a.video&&delete a.video;var h=a.audio;if(h){h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,a);var b=h.initSegment;if(b!=null&&b.byteLength){var T={type:"audio",frag:i,part:null,chunkMeta:t,parent:i.type,data:b};this.hls.trigger(B.Events.BUFFER_APPENDING,T)}this.tick()}}},A.loadFragment=function(a,i,t){var h=this.fragmentTracker.getState(a);this.fragCurrent=a,(this.audioSwitch||h===I.FragmentState.NOT_LOADED||h===I.FragmentState.PARTIAL)&&(a.sn==="initSegment"?this._loadInitSegment(a,i):i.live&&!(0,k.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=O.State.WAITING_INIT_PTS):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,a,i,t)))},A.completeAudioSwitch=function(){var a=this.hls,i=this.media,t=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,a.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:t})},L}(O.default);const f=E},"./src/controller/audio-track-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>g});var k=C("./src/events.ts"),O=C("./src/errors.ts"),B=C("./src/controller/base-playlist-controller.ts"),e=C("./src/types/loader.ts");function I(_,o){for(var s=0;s<o.length;s++){var n=o[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(_,u(n.key),n)}}function w(_,o,s){return o&&I(_.prototype,o),s&&I(_,s),Object.defineProperty(_,"prototype",{writable:!1}),_}function u(_){var o=p(_,"string");return typeof o=="symbol"?o:String(o)}function p(_,o){if(typeof _!="object"||_===null)return _;var s=_[Symbol.toPrimitive];if(s!==void 0){var n=s.call(_,o||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(_)}function c(_,o){_.prototype=Object.create(o.prototype),_.prototype.constructor=_,m(_,o)}function m(_,o){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},m(_,o)}var l=function(_){c(o,_);function o(n){var r;return r=_.call(this,n,"[audio-track-controller]")||this,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}var s=o.prototype;return s.registerListeners=function(){var r=this.hls;r.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(k.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var r=this.hls;r.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(k.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,_.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(r,v){this.tracks=v.audioTracks||[]},s.onAudioTrackLoaded=function(r,v){var E=v.id,f=v.details,S=this.tracksInGroup[E];if(!S){this.warn("Invalid audio track id "+E);return}var L=S.details;S.details=v.details,this.log("audioTrack "+E+" loaded ["+f.startSN+"-"+f.endSN+"]"),E===this.trackId&&(this.retryCount=0,this.playlistLoaded(E,v,L))},s.onLevelLoading=function(r,v){this.switchLevel(v.level)},s.onLevelSwitching=function(r,v){this.switchLevel(v.level)},s.switchLevel=function(r){var v=this.hls.levels[r];if(v!=null&&v.audioGroupIds){var E=v.audioGroupIds[v.urlId];if(this.groupId!==E){this.groupId=E;var f=this.tracks.filter(function(L){return!E||L.groupId===E});this.selectDefaultTrack&&!f.some(function(L){return L.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var S={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+E+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}}},s.onError=function(r,v){_.prototype.onError.call(this,r,v),!(v.fatal||!v.context)&&v.context.type===e.PlaylistContextType.AUDIO_TRACK&&v.context.id===this.trackId&&v.context.groupId===this.groupId&&this.retryLoadingOrFail(v)},s.setAudioTrack=function(r){var v=this.tracksInGroup;if(r<0||r>=v.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var E=v[this.trackId];this.log("Now switching to audio-track index "+r);var f=v[r],S=f.id,L=f.groupId,A=L===void 0?"":L,D=f.name,a=f.type,i=f.url;if(this.trackId=r,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:A,name:D,type:a,url:i}),!(f.details&&!f.details.live)){var t=this.switchParams(f.url,E==null?void 0:E.details);this.loadPlaylist(t)}},s.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var v=this.trackName,E=this.findTrackId(v)||this.findTrackId();E!==-1?this.setAudioTrack(E):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(r){for(var v=this.tracksInGroup,E=0;E<v.length;E++){var f=v[E];if((!this.selectDefaultTrack||f.default)&&(!r||r===f.name))return f.id}return-1},s.loadPlaylist=function(r){_.prototype.loadPlaylist.call(this);var v=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(v)){var E=v.id,f=v.groupId,S=v.url;if(r)try{S=r.addDirectives(S)}catch(L){this.warn("Could not construct new URL with HLS Delivery Directives: "+L)}this.log("loading audio-track playlist for id: "+E),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:S,id:E,groupId:f,deliveryDirectives:r||null})}},w(o,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}}]),o}(B.default);const g=l},"./src/controller/base-playlist-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>I});var k=C("./src/types/level.ts"),O=C("./src/controller/level-helper.ts"),B=C("./src/utils/logger.ts"),e=C("./src/errors.ts"),I=function(){function w(p,c){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,c+":"),this.warn=B.logger.warn.bind(B.logger,c+":"),this.hls=p}var u=w.prototype;return u.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},u.onError=function(c,m){m.fatal&&(m.type===e.ErrorTypes.NETWORK_ERROR||m.type===e.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},u.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},u.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},u.stopLoad=function(){this.canLoad=!1,this.clearTimer()},u.switchParams=function(c,m){var l=m==null?void 0:m.renditionReports;if(l)for(var g=0;g<l.length;g++){var _=l[g],o=void 0;try{o=new self.URL(_.URI,m.url).href}catch(v){B.logger.warn("Could not construct new URL for Rendition Report: "+v),o=_.URI||""}if(o===c.slice(-o.length)){var s=parseInt(_["LAST-MSN"])||(m==null?void 0:m.lastPartSn),n=parseInt(_["LAST-PART"])||(m==null?void 0:m.lastPartIndex);if(this.hls.config.lowLatencyMode){var r=Math.min(m.age-m.partTarget,m.targetduration);n>=0&&r>m.partTarget&&(n+=1)}return new k.HlsUrlParameters(s,n>=0?n:void 0,k.HlsSkip.No)}}},u.loadPlaylist=function(c){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},u.shouldLoadTrack=function(c){return this.canLoad&&c&&!!c.url&&(!c.details||c.details.live)},u.playlistLoaded=function(c,m,l){var g=this,_=m.details,o=m.stats,s=self.performance.now(),n=o.loading.first?Math.max(0,s-o.loading.first):0;if(_.advancedDateTime=Date.now()-n,_.live||l!=null&&l.live){if(_.reloaded(l),l&&this.log("live playlist "+c+" "+(_.advanced?"REFRESHED "+_.lastPartSn+"-"+_.lastPartIndex:"MISSED")),l&&_.fragments.length>0&&(0,O.mergeDetails)(l,_),!this.canLoad||!_.live)return;var r,v=void 0,E=void 0;if(_.canBlockReload&&_.endSN&&_.advanced){var f=this.hls.config.lowLatencyMode,S=_.lastPartSn,L=_.endSN,A=_.lastPartIndex,D=A!==-1,a=S===L,i=f?0:A;D?(v=a?L+1:S,E=a?i:A+1):v=L+1;var t=_.age,h=t+_.ageHeader,b=Math.min(h-_.partTarget,_.targetduration*1.5);if(b>0){if(l&&b>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+b+" with playlist age: "+_.age),b=0;else{var T=Math.floor(b/_.targetduration);if(v+=T,E!==void 0){var y=Math.round(b%_.targetduration/_.partTarget);E+=y}this.log("CDN Tune-in age: "+_.ageHeader+"s last advanced "+t.toFixed(2)+"s goal: "+b+" skip sn "+T+" to part "+E)}_.tuneInGoal=b}if(r=this.getDeliveryDirectives(_,m.deliveryDirectives,v,E),f||!a){this.loadPlaylist(r);return}}else r=this.getDeliveryDirectives(_,m.deliveryDirectives,v,E);var d=this.hls.mainForwardBufferInfo,R=d?d.end-d.len:0,M=(_.edge-R)*1e3,F=(0,O.computeReloadInterval)(_,M);_.updated?s>this.requestScheduled+F&&(this.requestScheduled=o.loading.start):this.requestScheduled=-1,v!==void 0&&_.canBlockReload?this.requestScheduled=o.loading.first+F-(_.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?s:this.requestScheduled)+F;var U=this.requestScheduled-s;U=Math.max(0,U),this.log("reload live playlist "+c+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(r)},U)}else this.clearTimer()},u.getDeliveryDirectives=function(c,m,l,g){var _=(0,k.getSkipValue)(c,l);return m!=null&&m.skip&&c.deltaUpdateFailed&&(l=m.msn,g=m.part,_=k.HlsSkip.No),new k.HlsUrlParameters(l,g,_)},u.retryLoadingOrFail=function(c){var m=this,l=this.hls.config,g=this.retryCount<l.levelLoadingMaxRetry;if(g){var _;if(this.requestScheduled=-1,this.retryCount++,c.details.indexOf("LoadTimeOut")>-1&&(_=c.context)!==null&&_!==void 0&&_.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+c.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return m.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+c.details+'"')}}else this.warn('cannot recover from error "'+c.details+'"'),this.clearTimer(),c.fatal=!0;return g},w}()},"./src/controller/base-stream-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{State:()=>D,default:()=>a});var k=C("./src/polyfills/number.ts"),O=C("./src/task-loop.ts"),B=C("./src/controller/fragment-tracker.ts"),e=C("./src/utils/buffer-helper.ts"),I=C("./src/utils/logger.ts"),w=C("./src/events.ts"),u=C("./src/errors.ts"),p=C("./src/types/transmuxer.ts"),c=C("./src/utils/mp4-tools.ts"),m=C("./src/utils/discontinuities.ts"),l=C("./src/controller/fragment-finders.ts"),g=C("./src/controller/level-helper.ts"),_=C("./src/loader/fragment-loader.ts"),o=C("./src/crypt/decrypter.ts"),s=C("./src/utils/time-ranges.ts"),n=C("./src/types/loader.ts");function r(i,t){for(var h=0;h<t.length;h++){var b=t[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(i,E(b.key),b)}}function v(i,t,h){return t&&r(i.prototype,t),h&&r(i,h),Object.defineProperty(i,"prototype",{writable:!1}),i}function E(i){var t=f(i,"string");return typeof t=="symbol"?t:String(t)}function f(i,t){if(typeof i!="object"||i===null)return i;var h=i[Symbol.toPrimitive];if(h!==void 0){var b=h.call(i,t||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function S(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function L(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,A(i,t)}function A(i,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,T){return b.__proto__=T,b},A(i,t)}var D={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",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},a=function(i){L(t,i);function t(b,T,y,d){var R;return R=i.call(this)||this,R.hls=void 0,R.fragPrevious=null,R.fragCurrent=null,R.fragmentTracker=void 0,R.transmuxer=null,R._state=D.STOPPED,R.media=null,R.mediaBuffer=null,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.keyLoader=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=d,R.log=I.logger.log.bind(I.logger,d+":"),R.warn=I.logger.warn.bind(I.logger,d+":"),R.hls=b,R.fragmentLoader=new _.default(b.config),R.keyLoader=y,R.fragmentTracker=T,R.config=b.config,R.decrypter=new o.default(b.config),b.on(w.Events.LEVEL_SWITCHING,R.onLevelSwitching,S(R)),R}var h=t.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(T){},h.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var T=this.fragCurrent;T&&(T.abortRequests(),this.fragmentTracker.removeFragment(T)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=D.STOPPED},h._streamEnded=function(T,y){if(y.live||T.nextStart||!T.end||!this.media)return!1;var d=y.partList;if(d!=null&&d.length){var R=d[d.length-1],M=e.BufferHelper.isBuffered(this.media,R.start+R.duration/2);return M}var F=y.fragments[y.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(F)},h.getLevelDetails=function(){if(this.levels&&this.levelLastLoaded!==null){var T;return(T=this.levels[this.levelLastLoaded])===null||T===void 0?void 0:T.details}},h.onMediaAttached=function(T,y){var d=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),d.addEventListener("seeking",this.onvseeking),d.addEventListener("ended",this.onvended);var R=this.config;this.levels&&R.autoStartLoad&&this.state===D.STOPPED&&this.startLoad(R.startPosition)},h.onMediaDetaching=function(){var T=this.media;T!=null&&T.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),T&&this.onvseeking&&this.onvended&&(T.removeEventListener("seeking",this.onvseeking),T.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var T=this.config,y=this.fragCurrent,d=this.media,R=this.mediaBuffer,M=this.state,F=d?d.currentTime:0,U=e.BufferHelper.bufferInfo(R||d,F,T.maxBufferHole);if(this.log("media seeking to "+((0,k.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+M),this.state===D.ENDED)this.resetLoadingState();else if(y){var V=T.maxFragLookUpTolerance,re=y.start-V,$=y.start+y.duration+V;if(!U.len||$<U.start||re>U.end){var le=F>$;(F<re||le)&&(le&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.abortRequests()),this.resetLoadingState())}}d&&(this.lastCurrentTime=F),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onLevelSwitching=function(T,y){this.fragLoadError=0},h.onHandlerDestroying=function(){this.stopLoad(),i.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=D.STOPPED,this.hls.off(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,i.prototype.onHandlerDestroyed.call(this)},h.loadFragment=function(T,y,d){this._loadFragForPlayback(T,y,d)},h._loadFragForPlayback=function(T,y,d){var R=this,M=function(U){if(R.fragContextChanged(T)){R.warn("Fragment "+T.sn+(U.part?" p: "+U.part.index:"")+" of level "+T.level+" was dropped during download."),R.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,R._handleFragmentLoadProgress(U)};this._doFragLoad(T,y,d,M).then(function(F){if(F){R.fragLoadError=0;var U=R.state;if(R.fragContextChanged(T)){(U===D.FRAG_LOADING||!R.fragCurrent&&U===D.PARSING)&&(R.fragmentTracker.removeFragment(T),R.state=D.IDLE);return}"payload"in F&&(R.log("Loaded fragment "+T.sn+" of level "+T.level),R.hls.trigger(w.Events.FRAG_LOADED,F)),R._handleFragmentLoadComplete(F)}}).catch(function(F){R.state===D.STOPPED||R.state===D.ERROR||(R.warn(F),R.resetFragmentLoading(T))})},h.flushMainBuffer=function(T,y,d){if(d===void 0&&(d=null),!!(T-y)){var R={startOffset:T,endOffset:y,type:d};this.fragLoadError=0,this.hls.trigger(w.Events.BUFFER_FLUSHING,R)}},h._loadInitSegment=function(T,y){var d=this;this._doFragLoad(T,y).then(function(R){if(!R||d.fragContextChanged(T)||!d.levels)throw new Error("init load aborted");return R}).then(function(R){var M=d.hls,F=R.payload,U=T.decryptdata;if(F&&F.byteLength>0&&U&&U.key&&U.iv&&U.method==="AES-128"){var V=self.performance.now();return d.decrypter.decrypt(new Uint8Array(F),U.key.buffer,U.iv.buffer).then(function(re){var $=self.performance.now();return M.trigger(w.Events.FRAG_DECRYPTED,{frag:T,payload:re,stats:{tstart:V,tdecrypt:$}}),R.payload=re,R})}return R}).then(function(R){var M=d.fragCurrent,F=d.hls,U=d.levels;if(!U)throw new Error("init load aborted, missing levels");var V=U[T.level].details;console.assert(V,"Level details are defined when init segment is loaded");var re=T.stats;d.state=D.IDLE,d.fragLoadError=0,T.data=new Uint8Array(R.payload),re.parsing.start=re.buffering.start=self.performance.now(),re.parsing.end=re.buffering.end=self.performance.now(),R.frag===M&&F.trigger(w.Events.FRAG_BUFFERED,{stats:re,frag:M,part:null,id:T.type}),d.tick()}).catch(function(R){d.state===D.STOPPED||d.state===D.ERROR||(d.warn(R),d.resetFragmentLoading(T))})},h.fragContextChanged=function(T){var y=this.fragCurrent;return!T||!y||T.level!==y.level||T.sn!==y.sn||T.urlId!==y.urlId},h.fragBufferedComplete=function(T,y){var d,R,M,F,U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+T.type+" sn: "+T.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level+" (frag:["+((d=T.startPTS)!=null?d:NaN).toFixed(3)+"-"+((R=T.endPTS)!=null?R:NaN).toFixed(3)+"] > buffer:"+(U?s.default.toString(e.BufferHelper.getBuffered(U)):"(detached)")+")"),this.state=D.IDLE,U&&(!this.loadedmetadata&&T.type==n.PlaylistLevelType.MAIN&&U.buffered.length&&((M=this.fragCurrent)===null||M===void 0?void 0:M.sn)===((F=this.fragPrevious)===null||F===void 0?void 0:F.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},h.seekToStartPos=function(){},h._handleFragmentLoadComplete=function(T){var y=this.transmuxer;if(y){var d=T.frag,R=T.part,M=T.partsLoaded,F=!M||M.length===0||M.some(function(V){return!V}),U=new p.ChunkMetadata(d.level,d.sn,d.stats.chunkCount+1,0,R?R.index:-1,!F);y.flush(U)}},h._handleFragmentLoadProgress=function(T){},h._doFragLoad=function(T,y,d,R){var M,F=this;if(d===void 0&&(d=null),!this.levels)throw new Error("frag load aborted, missing levels");var U=null;if(T.encrypted&&!((M=T.decryptdata)!==null&&M!==void 0&&M.key)?(this.log("Loading key for "+T.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level),this.state=D.KEY_LOADING,this.fragCurrent=T,U=this.keyLoader.load(T).then(function(te){if(!F.fragContextChanged(te.frag))return F.hls.trigger(w.Events.KEY_LOADED,te),F.state===D.KEY_LOADING&&(F.state=D.IDLE),te}),this.hls.trigger(w.Events.KEY_LOADING,{frag:T}),this.throwIfFragContextChanged("KEY_LOADING")):!T.encrypted&&y.encryptedFragments.length&&this.keyLoader.loadClear(T,y.encryptedFragments),d=Math.max(T.start,d||0),this.config.lowLatencyMode&&y){var V=y.partList;if(V&&R){d>T.end&&y.fragmentHint&&(T=y.fragmentHint);var re=this.getNextPart(V,T,d);if(re>-1){var $=V[re];return this.log("Loading part sn: "+T.sn+" p: "+$.index+" cc: "+T.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+re+"-"+(V.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(d.toFixed(3))),this.nextLoadPosition=$.start+$.duration,this.state=D.FRAG_LOADING,this.hls.trigger(w.Events.FRAG_LOADING,{frag:T,part:V[re],targetBufferTime:d}),this.throwIfFragContextChanged("FRAG_LOADING parts"),U?U.then(function(te){return!te||F.fragContextChanged(te.frag)?null:F.doFragPartsLoad(T,V,re,R)}).catch(function(te){return F.handleFragLoadError(te)}):this.doFragPartsLoad(T,V,re,R).catch(function(te){return F.handleFragLoadError(te)})}else if(!T.url||this.loadedEndOfParts(V,d))return Promise.resolve(null)}}this.log("Loading fragment "+T.sn+" cc: "+T.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(d.toFixed(3))),(0,k.isFiniteNumber)(T.sn)&&!this.bitrateTest&&(this.nextLoadPosition=T.start+T.duration),this.state=D.FRAG_LOADING,this.hls.trigger(w.Events.FRAG_LOADING,{frag:T,targetBufferTime:d}),this.throwIfFragContextChanged("FRAG_LOADING");var le=this.config.progressive;return le&&U?U.then(function(te){return!te||F.fragContextChanged(te==null?void 0:te.frag)?null:F.fragmentLoader.load(T,R)}).catch(function(te){return F.handleFragLoadError(te)}):Promise.all([this.fragmentLoader.load(T,le?R:void 0),U]).then(function(te){var _e=te[0];return!le&&_e&&R&&R(_e),_e}).catch(function(te){return F.handleFragLoadError(te)})},h.throwIfFragContextChanged=function(T){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+T)},h.doFragPartsLoad=function(T,y,d,R){var M=this;return new Promise(function(F,U){var V=[],re=function $(le){var te=y[le];M.fragmentLoader.loadPart(T,te,R).then(function(_e){V[te.index]=_e;var fe=_e.part;M.hls.trigger(w.Events.FRAG_LOADED,_e);var me=y[le+1];if(me&&me.fragment===T)$(le+1);else return F({frag:T,part:fe,partsLoaded:V})}).catch(U)};re(d)})},h.handleFragLoadError=function(T){if("data"in T){var y=T.data;T.data&&y.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(w.Events.ERROR,y)}else this.hls.trigger(w.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,err:T,fatal:!0});return null},h._handleTransmuxerFlush=function(T){var y=this.getCurrentContext(T);if(!y||this.state!==D.PARSING){!this.fragCurrent&&this.state!==D.STOPPED&&this.state!==D.ERROR&&(this.state=D.IDLE);return}var d=y.frag,R=y.part,M=y.level,F=self.performance.now();d.stats.parsing.end=F,R&&(R.stats.parsing.end=F),this.updateLevelTiming(d,R,M,T.partial)},h.getCurrentContext=function(T){var y=this.levels,d=T.level,R=T.sn,M=T.part;if(!y||!y[d])return this.warn("Levels object was unset while buffering fragment "+R+" of level "+d+". The current chunk will not be buffered."),null;var F=y[d],U=M>-1?(0,g.getPartWith)(F,R,M):null,V=U?U.fragment:(0,g.getFragmentWithSN)(F,R,this.fragCurrent);return V?{frag:V,part:U,level:F}:null},h.bufferFragmentData=function(T,y,d,R){if(!(!T||this.state!==D.PARSING)){var M=T.data1,F=T.data2,U=M;if(M&&F&&(U=(0,c.appendUint8Array)(M,F)),!(!U||!U.length)){var V={type:T.type,frag:y,part:d,chunkMeta:R,parent:y.type,data:U};this.hls.trigger(w.Events.BUFFER_APPENDING,V),T.dropped&&T.independent&&!d&&this.flushBufferGap(y)}}},h.flushBufferGap=function(T){var y=this.media;if(y){if(!e.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,T.start);return}var d=y.currentTime,R=e.BufferHelper.bufferInfo(y,d,0),M=T.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,M*.25),U=Math.max(Math.min(T.start-F,R.end-F),d+F);T.start-U>F&&this.flushMainBuffer(U,T.start)}},h.getFwdBufferInfo=function(T,y){var d=this.config,R=this.getLoadPosition();if(!(0,k.isFiniteNumber)(R))return null;var M=e.BufferHelper.bufferInfo(T,R,d.maxBufferHole);if(M.len===0&&M.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(R,y);if(F&&M.nextStart<F.end)return e.BufferHelper.bufferInfo(T,R,Math.max(M.nextStart,d.maxBufferHole))}return M},h.getMaxBufferLength=function(T){var y=this.config,d;return T?d=Math.max(8*y.maxBufferSize/T,y.maxBufferLength):d=y.maxBufferLength,Math.min(d,y.maxMaxBufferLength)},h.reduceMaxBufferLength=function(T){var y=this.config,d=T||y.maxBufferLength;return y.maxMaxBufferLength>=d?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(T,y){var d=y.fragments,R=d.length;if(!R)return null;var M=this.config,F=d[0].start,U;if(y.live){var V=M.initialLiveManifestSize;if(R<V)return this.warn("Not enough fragments to start playback (have: "+R+", need: "+V+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(U=this.getInitialLiveFragment(y,d),this.startPosition=U?this.hls.liveSyncPosition||U.start:T)}else T<=F&&(U=d[0]);if(!U){var re=M.lowLatencyMode?y.partEnd:y.fragmentEnd;U=this.getFragmentAtPosition(T,re,y)}return this.mapToInitFragWhenRequired(U)},h.mapToInitFragWhenRequired=function(T){return T!=null&&T.initSegment&&!(T!=null&&T.initSegment.data)&&!this.bitrateTest?T.initSegment:T},h.getNextPart=function(T,y,d){for(var R=-1,M=!1,F=!0,U=0,V=T.length;U<V;U++){var re=T[U];if(F=F&&!re.independent,R>-1&&d<re.start)break;var $=re.loaded;$?R=-1:(M||re.independent||F)&&re.fragment===y&&(R=U),M=$}return R},h.loadedEndOfParts=function(T,y){var d=T[T.length-1];return d&&y>d.start&&d.loaded},h.getInitialLiveFragment=function(T,y){var d=this.fragPrevious,R=null;if(d){if(T.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+d.programDateTime),R=(0,l.findFragmentByPDT)(y,d.endProgramDateTime,this.config.maxFragLookUpTolerance)),!R){var M=d.sn+1;if(M>=T.startSN&&M<=T.endSN){var F=y[M-T.startSN];d.cc===F.cc&&(R=F,this.log("Live playlist, switching playlist, load frag with next SN: "+R.sn))}R||(R=(0,l.findFragWithCC)(y,d.cc),R&&this.log("Live playlist, switching playlist, load frag with same CC: "+R.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(R=this.getFragmentAtPosition(U,this.bitrateTest?T.fragmentEnd:T.edge,T))}return R},h.getFragmentAtPosition=function(T,y,d){var R=this.config,M=this.fragPrevious,F=d.fragments,U=d.endSN,V=d.fragmentHint,re=R.maxFragLookUpTolerance,$=!!(R.lowLatencyMode&&d.partList&&V);$&&V&&!this.bitrateTest&&(F=F.concat(V),U=V.sn);var le;if(T<y){var te=T>y-re?0:re;le=(0,l.findFragmentByPTS)(M,F,T,te)}else le=F[F.length-1];if(le){var _e=le.sn-d.startSN;if(this.fragmentTracker.getState(le)===B.FragmentState.OK&&(M=le),M&&le.sn===M.sn&&!$){var fe=M&&le.level===M.level;if(fe){var me=F[_e+1];le.sn<U&&this.fragmentTracker.getState(me)!==B.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+me.sn),le=me):le=null}}}return le},h.synchronizeToLiveEdge=function(T){var y=this.config,d=this.media;if(d){var R=this.hls.liveSyncPosition,M=d.currentTime,F=T.fragments[0].start,U=T.edge,V=M>=F-y.maxFragLookUpTolerance&&M<=U;if(R!==null&&d.duration>R&&(M<R||!V)){var re=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*T.targetduration;(!V&&d.readyState<4||M<U-re)&&(this.loadedmetadata||(this.nextLoadPosition=R),d.readyState&&(this.warn("Playback: "+M.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+R.toFixed(3)),d.currentTime=R))}}},h.alignPlaylists=function(T,y){var d=this.levels,R=this.levelLastLoaded,M=this.fragPrevious,F=R!==null?d[R]:null,U=T.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var V=T.fragments[0].start,re=!y,$=T.alignedSliding&&(0,k.isFiniteNumber)(V);if(re||!$&&!V){(0,m.alignStream)(M,F,T);var le=T.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+T.startSN+" prev-sn: "+(M?M.sn:"na")+" fragments: "+U),le}return V},h.waitForCdnTuneIn=function(T){var y=3;return T.live&&T.canBlockReload&&T.partTarget&&T.tuneInGoal>Math.max(T.partHoldBack,T.partTarget*y)},h.setStartPosition=function(T,y){var d=this.startPosition;if(d<y&&(d=-1),d===-1||this.lastCurrentTime===-1){var R=T.startTimeOffset;(0,k.isFiniteNumber)(R)?(d=y+R,R<0&&(d+=T.totalduration),d=Math.min(Math.max(y,d),y+T.totalduration),this.log("Start time offset "+R+" found in playlist, adjust startPosition to "+d),this.startPosition=d):T.live?d=this.hls.liveSyncPosition||y:this.startPosition=d=0,this.lastCurrentTime=d}this.nextLoadPosition=d},h.getLoadPosition=function(){var T=this.media,y=0;return this.loadedmetadata&&T?y=T.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},h.handleFragLoadAborted=function(T,y){this.transmuxer&&T.sn!=="initSegment"&&T.stats.aborted&&(this.warn("Fragment "+T.sn+(y?" part"+y.index:"")+" of level "+T.level+" was aborted"),this.resetFragmentLoading(T))},h.resetFragmentLoading=function(T){(!this.fragCurrent||!this.fragContextChanged(T)&&this.state!==D.FRAG_LOADING_WAITING_RETRY)&&(this.state=D.IDLE)},h.onFragmentOrKeyLoadError=function(T,y){if(y.fatal){this.stopLoad(),this.state=D.ERROR;return}var d=this.config;if(y.chunkMeta){var R=this.getCurrentContext(y.chunkMeta);R&&(y.frag=R.frag,y.levelRetry=!0,this.fragLoadError=d.fragLoadingMaxRetry)}var M=y.frag;if(!(!M||M.type!==T)){var F=this.fragCurrent;if(console.assert(F&&M.sn===F.sn&&M.level===F.level&&M.urlId===F.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=d.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var U=Math.min(Math.pow(2,this.fragLoadError)*d.fragLoadingRetryDelay,d.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+T+" "+M.level+" failed to load, retrying in "+U+"ms"),this.retryDate=self.performance.now()+U,this.fragLoadError++,this.state=D.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(T===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=D.IDLE):(I.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=D.ERROR)}},h.afterBufferFlushed=function(T,y,d){if(T){var R=e.BufferHelper.getBuffered(T);this.fragmentTracker.detectEvictedFragments(y,R,d),this.state===D.ENDED&&this.resetLoadingState()}},h.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=D.IDLE},h.resetStartWhenNotLoaded=function(T){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[T].details:null;y!=null&&y.live?(this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},h.updateLevelTiming=function(T,y,d,R){var M=this,F=d.details;console.assert(!!F,"level.details must be defined");var U=Object.keys(T.elementaryStreams).reduce(function(V,re){var $=T.elementaryStreams[re];if($){var le=$.endPTS-$.startPTS;if(le<=0)return M.warn("Could not parse fragment "+T.sn+" "+re+" duration reliably ("+le+")"),V||!1;var te=R?0:(0,g.updateFragPTSDTS)(F,T,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return M.hls.trigger(w.Events.LEVEL_PTS_UPDATED,{details:F,level:d,drift:te,type:re,frag:T,start:$.startPTS,end:$.endPTS}),!0}return V},!1);U||(this.warn("Found no media in fragment "+T.sn+" of level "+d.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=D.PARSED,this.hls.trigger(w.Events.FRAG_PARSED,{frag:T,part:y})},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(t,[{key:"state",get:function(){return this._state},set:function(T){var y=this._state;y!==T&&(this._state=T,this.log(y+"->"+T))}}]),t}(O.default)},"./src/controller/buffer-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>l});var k=C("./src/polyfills/number.ts"),O=C("./src/events.ts"),B=C("./src/utils/logger.ts"),e=C("./src/errors.ts"),I=C("./src/utils/buffer-helper.ts"),w=C("./src/utils/mediasource-helper.ts"),u=C("./src/loader/fragment.ts"),p=C("./src/controller/buffer-operation-queue.ts"),c=(0,w.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function g(o){var s=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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var n=s.media,r=s.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),n&&(n.removeEventListener("emptied",s._onMediaEmptied),s.updateMediaElementDuration(),s.hls.trigger(O.Events.MEDIA_ATTACHED,{media:n})),r&&r.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var n=s.media,r=s._objectUrl;n&&n.src!==r&&B.logger.error("Media element src was set while attaching MediaSource ("+r+" > "+n.src+")")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var _=g.prototype;return _.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},_.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},_.registerListeners=function(){var s=this.hls;s.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(O.Events.BUFFER_RESET,this.onBufferReset,this),s.on(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(O.Events.BUFFER_EOS,this.onBufferEos,this),s.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(O.Events.FRAG_PARSED,this.onFragParsed,this),s.on(O.Events.FRAG_CHANGED,this.onFragChanged,this)},_.unregisterListeners=function(){var s=this.hls;s.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(O.Events.BUFFER_RESET,this.onBufferReset,this),s.off(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(O.Events.BUFFER_EOS,this.onBufferEos,this),s.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(O.Events.FRAG_PARSED,this.onFragParsed,this),s.off(O.Events.FRAG_CHANGED,this.onFragChanged,this)},_._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},_.onManifestParsed=function(s,n){var r=2;(n.audio&&!n.video||!n.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},_.onMediaAttaching=function(s,n){var r=this.media=n.media;if(r&&c){var v=this.mediaSource=new c;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(v),this._objectUrl=r.src,r.addEventListener("emptied",this._onMediaEmptied)}},_.onMediaDetaching=function(){var s=this.media,n=this.mediaSource,r=this._objectUrl;if(n){if(B.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(v){B.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(s.removeEventListener("emptied",this._onMediaEmptied),r&&self.URL.revokeObjectURL(r),s.src===r?(s.removeAttribute("src"),s.load()):B.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(O.Events.MEDIA_DETACHED,void 0)},_.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(n){var r=s.sourceBuffer[n];try{r&&(s.removeBufferListeners(n),s.mediaSource&&s.mediaSource.removeSourceBuffer(r),s.sourceBuffer[n]=void 0)}catch(v){B.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",v)}}),this._initSourceBuffer()},_.onBufferCodecs=function(s,n){var r=this,v=this.getSourceBufferTypes().length;Object.keys(n).forEach(function(E){if(v){var f=r.tracks[E];if(f&&typeof f.buffer.changeType=="function"){var S=n[E],L=S.id,A=S.codec,D=S.levelCodec,a=S.container,i=S.metadata,t=(f.levelCodec||f.codec).replace(m,"$1"),h=(D||A).replace(m,"$1");if(t!==h){var b=a+";codecs="+(D||A);r.appendChangeType(E,b),B.logger.log("[buffer-controller]: switching codec "+t+" to "+h),r.tracks[E]={buffer:f.buffer,codec:A,container:a,levelCodec:D,metadata:i,id:L}}}}else r.pendingTracks[E]=n[E]}),!v&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},_.appendChangeType=function(s,n){var r=this,v=this.operationQueue,E={execute:function(){var S=r.sourceBuffer[s];S&&(B.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+n),S.changeType(n)),v.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(S){B.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",S)}};v.append(E,s)},_.onBufferAppending=function(s,n){var r=this,v=this.hls,E=this.operationQueue,f=this.tracks,S=n.data,L=n.type,A=n.frag,D=n.part,a=n.chunkMeta,i=a.buffering[L],t=self.performance.now();i.start=t;var h=A.stats.buffering,b=D?D.stats.buffering:null;h.start===0&&(h.start=t),b&&b.start===0&&(b.start=t);var T=f.audio,y=!1;L==="audio"&&(T==null?void 0:T.container)==="audio/mpeg"&&(y=!this.lastMpegAudioChunk||a.id===1||this.lastMpegAudioChunk.sn!==a.sn,this.lastMpegAudioChunk=a);var d=A.start,R={execute:function(){if(i.executeStart=self.performance.now(),y){var F=r.sourceBuffer[L];if(F){var U=d-F.timestampOffset;Math.abs(U)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d+" (delta: "+U+") sn: "+A.sn+")"),F.timestampOffset=d)}}r.appendExecutor(S,L)},onStart:function(){},onComplete:function(){var F=self.performance.now();i.executeEnd=i.end=F,h.first===0&&(h.first=F),b&&b.first===0&&(b.first=F);var U=r.sourceBuffer,V={};for(var re in U)V[re]=I.BufferHelper.getBuffered(U[re]);r.appendError=0,r.hls.trigger(O.Events.BUFFER_APPENDED,{type:L,frag:A,part:D,chunkMeta:a,parent:A.type,timeRanges:V})},onError:function(F){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",F);var U={type:e.ErrorTypes.MEDIA_ERROR,parent:A.type,details:e.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=e.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,U.details=e.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>v.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0,v.stopLoad())),v.trigger(O.Events.ERROR,U)}};E.append(R,L)},_.onBufferFlushing=function(s,n){var r=this,v=this.operationQueue,E=function(S){return{execute:r.removeExecutor.bind(r,S,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(O.Events.BUFFER_FLUSHED,{type:S})},onError:function(A){B.logger.warn("[buffer-controller]: Failed to remove from "+S+" SourceBuffer",A)}}};n.type?v.append(E(n.type),n.type):this.getSourceBufferTypes().forEach(function(f){v.append(E(f),f)})},_.onFragParsed=function(s,n){var r=this,v=n.frag,E=n.part,f=[],S=E?E.elementaryStreams:v.elementaryStreams;S[u.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(S[u.ElementaryStreamTypes.AUDIO]&&f.push("audio"),S[u.ElementaryStreamTypes.VIDEO]&&f.push("video"));var L=function(){var D=self.performance.now();v.stats.buffering.end=D,E&&(E.stats.buffering.end=D);var a=E?E.stats:v.stats;r.hls.trigger(O.Events.FRAG_BUFFERED,{frag:v,part:E,stats:a,id:v.type})};f.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(L,f)},_.onFragChanged=function(s,n){this.flushBackBuffer()},_.onBufferEos=function(s,n){var r=this,v=this.getSourceBufferTypes().reduce(function(E,f){var S=r.sourceBuffer[f];return S&&(!n.type||n.type===f)&&(S.ending=!0,S.ended||(S.ended=!0,B.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),E&&!!(!S||S.ended)},!0);v&&(B.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){r.getSourceBufferTypes().forEach(function(f){var S=r.sourceBuffer[f];S&&(S.ending=!1)});var E=r.mediaSource;if(!E||E.readyState!=="open"){E&&B.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+E.readyState);return}B.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),E.endOfStream()}))},_.onLevelUpdated=function(s,n){var r=n.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},_.flushBackBuffer=function(){var s=this.hls,n=this.details,r=this.media,v=this.sourceBuffer;if(!(!r||n===null)){var E=this.getSourceBufferTypes();if(E.length){var f=n.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!(!(0,k.isFiniteNumber)(f)||f<0)){var S=r.currentTime,L=n.levelTargetDuration,A=Math.max(f,L),D=Math.floor(S/L)*L-A;E.forEach(function(a){var i=v[a];if(i){var t=I.BufferHelper.getBuffered(i);if(t.length>0&&D>t.start(0)){if(s.trigger(O.Events.BACK_BUFFER_REACHED,{bufferEnd:D}),n.live)s.trigger(O.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:D});else if(i.ended&&t.end(t.length-1)-S<L*2){B.logger.info("[buffer-controller]: Cannot flush "+a+" back buffer while SourceBuffer is in ended state");return}s.trigger(O.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:D,type:a})}}})}}}},_.updateMediaElementDuration=function(){if(!(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")){var s=this.details,n=this.hls,r=this.media,v=this.mediaSource,E=s.fragments[0].start+s.totalduration,f=r.duration,S=(0,k.isFiniteNumber)(v.duration)?v.duration:0;s.live&&n.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=1/0,this.updateSeekableRange(s)):(E>S&&E>f||!(0,k.isFiniteNumber)(f))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),v.duration=E)}},_.updateSeekableRange=function(s){var n=this.mediaSource,r=s.fragments,v=r.length;if(v&&s.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var E=Math.max(0,r[0].start),f=Math.max(E,E+s.totalduration);n.setLiveSeekableRange(E,f)}},_.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,n=this.operationQueue,r=this.pendingTracks,v=Object.keys(r).length;if(v&&!s||v===2){this.createSourceBuffers(r),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(O.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(f){n.executeNext(f)})}},_.createSourceBuffers=function(s){var n=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var E in s)if(!n[E]){var f=s[E];if(!f)throw Error("source buffer exists for track "+E+", however track does not");var S=f.levelCodec||f.codec,L=f.container+";codecs="+S;B.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var A=n[E]=r.addSourceBuffer(L),D=E;this.addBufferListener(D,"updatestart",this._onSBUpdateStart),this.addBufferListener(D,"updateend",this._onSBUpdateEnd),this.addBufferListener(D,"error",this._onSBUpdateError),this.tracks[E]={buffer:A,codec:S,container:f.container,levelCodec:f.levelCodec,metadata:f.metadata,id:f.id},v++}catch(a){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+a.message),this.hls.trigger(O.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,mimeType:L})}}v&&this.hls.trigger(O.Events.BUFFER_CREATED,{tracks:this.tracks})},_._onSBUpdateStart=function(s){var n=this.operationQueue,r=n.current(s);r.onStart()},_._onSBUpdateEnd=function(s){var n=this.operationQueue,r=n.current(s);r.onComplete(),n.shiftAndExecuteNext(s)},_._onSBUpdateError=function(s,n){B.logger.error("[buffer-controller]: "+s+" SourceBuffer error",n),this.hls.trigger(O.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(s);r&&r.onError(n)},_.removeExecutor=function(s,n,r){var v=this.media,E=this.mediaSource,f=this.operationQueue,S=this.sourceBuffer,L=S[s];if(!v||!E||!L){B.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(s);return}var A=(0,k.isFiniteNumber)(v.duration)?v.duration:1/0,D=(0,k.isFiniteNumber)(E.duration)?E.duration:1/0,a=Math.max(0,n),i=Math.min(r,A,D);i>a&&!L.ending?(L.ended=!1,B.logger.log("[buffer-controller]: Removing ["+a+","+i+"] from the "+s+" SourceBuffer"),console.assert(!L.updating,s+" sourceBuffer must not be updating"),L.remove(a,i)):f.shiftAndExecuteNext(s)},_.appendExecutor=function(s,n){var r=this.operationQueue,v=this.sourceBuffer,E=v[n];if(!E){B.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),r.shiftAndExecuteNext(n);return}E.ended=!1,console.assert(!E.updating,n+" sourceBuffer must not be updating"),E.appendBuffer(s)},_.blockBuffers=function(s,n){var r=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(s);return}var v=this.operationQueue,E=n.map(function(f){return v.appendBlocker(f)});Promise.all(E).then(function(){s(),n.forEach(function(f){var S=r.sourceBuffer[f];(!S||!S.updating)&&v.shiftAndExecuteNext(f)})})},_.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},_.addBufferListener=function(s,n,r){var v=this.sourceBuffer[s];if(v){var E=r.bind(this,s);this.listeners[s].push({event:n,listener:E}),v.addEventListener(n,E)}},_.removeBufferListeners=function(s){var n=this.sourceBuffer[s];n&&this.listeners[s].forEach(function(r){n.removeEventListener(r.event,r.listener)})},g}()},"./src/controller/buffer-operation-queue.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k=C("./src/utils/logger.ts"),O=function(){function B(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var e=B.prototype;return e.append=function(w,u){var p=this.queues[u];p.push(w),p.length===1&&this.buffers[u]&&this.executeNext(u)},e.insertAbort=function(w,u){var p=this.queues[u];p.unshift(w),this.executeNext(u)},e.appendBlocker=function(w){var u,p=new Promise(function(m){u=m}),c={execute:u,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(c,w),p},e.executeNext=function(w){var u=this.buffers,p=this.queues,c=u[w],m=p[w];if(m.length){var l=m[0];try{l.execute()}catch(g){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(g),(!c||!c.updating)&&(m.shift(),this.executeNext(w))}}},e.shiftAndExecuteNext=function(w){this.queues[w].shift(),this.executeNext(w)},e.current=function(w){return this.queues[w][0]},B}()},"./src/controller/cap-level-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>u});var k=C("./src/events.ts");function O(p,c){for(var m=0;m<c.length;m++){var l=c[m];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,e(l.key),l)}}function B(p,c,m){return c&&O(p.prototype,c),m&&O(p,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function e(p){var c=I(p,"string");return typeof c=="symbol"?c:String(c)}function I(p,c){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var l=m.call(p,c||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(p)}var w=function(){function p(m){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=m,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var c=p.prototype;return c.setStreamController=function(l){this.streamController=l},c.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},c.registerListeners=function(){var l=this.hls;l.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),l.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.unregisterListener=function(){var l=this.hls;l.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),l.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.onFpsDropLevelCapping=function(l,g){p.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},c.onMediaAttaching=function(l,g){this.media=g.media instanceof HTMLVideoElement?g.media:null,this.clientRect=null},c.onManifestParsed=function(l,g){var _=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,_.config.capLevelToPlayerSize&&g.video&&this.startCapping()},c.onBufferCodecs=function(l,g){var _=this.hls;_.config.capLevelToPlayerSize&&g.video&&this.startCapping()},c.onMediaDetaching=function(){this.stopCapping()},c.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var l=this.hls.levels;if(l.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(l.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},c.getMaxLevel=function(l){var g=this,_=this.hls.levels;if(!_.length)return-1;var o=_.filter(function(s,n){return p.isLevelAllowed(n,g.restrictedLevels)&&n<=l});return this.clientRect=null,p.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},c.startCapping=function(){this.timer||(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())},c.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},c.getDimensions=function(){if(this.clientRect)return this.clientRect;var l=this.media,g={width:0,height:0};if(l){var _=l.getBoundingClientRect();g.width=_.width,g.height=_.height,!g.width&&!g.height&&(g.width=_.right-_.left||l.width||0,g.height=_.bottom-_.top||l.height||0)}return this.clientRect=g,g},p.isLevelAllowed=function(l,g){return g===void 0&&(g=[]),g.indexOf(l)===-1},p.getMaxLevelByMediaSize=function(l,g,_){if(!l||!l.length)return-1;for(var o=function(E,f){return f?E.width!==f.width||E.height!==f.height:!0},s=l.length-1,n=0;n<l.length;n+=1){var r=l[n];if((r.width>=g||r.height>=_)&&o(r,l[n+1])){s=n;break}}return s},B(p,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var l=1;if(!this.hls.config.ignoreDevicePixelRatio)try{l=self.devicePixelRatio}catch(g){}return l}}]),p}();const u=w},"./src/controller/cmcd-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>_});var k=C("./src/events.ts"),O=C("./src/types/cmcd.ts"),B=C("./src/utils/buffer-helper.ts"),e=C("./src/utils/logger.ts");function I(o,s){for(var n=0;n<s.length;n++){var r=s[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,u(r.key),r)}}function w(o,s,n){return s&&I(o.prototype,s),n&&I(o,n),Object.defineProperty(o,"prototype",{writable:!1}),o}function u(o){var s=p(o,"string");return typeof s=="symbol"?s:String(s)}function p(o,s){if(typeof o!="object"||o===null)return o;var n=o[Symbol.toPrimitive];if(n!==void 0){var r=n.call(o,s||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}function c(o,s){var n=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(n)return(n=n.call(o)).next.bind(n);if(Array.isArray(o)||(n=m(o))||s&&o&&typeof o.length=="number"){n&&(o=n);var r=0;return function(){return r>=o.length?{done:!0}:{done:!1,value:o[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(o,s){if(o){if(typeof o=="string")return l(o,s);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(o,s)}}function l(o,s){(s==null||s>o.length)&&(s=o.length);for(var n=0,r=new Array(s);n<s;n++)r[n]=o[n];return r}function g(){return g=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[r]=n[r])}return o},g.apply(this,arguments)}var _=function(){function o(n){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(f){try{r.apply(f,{ot:O.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(S){e.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(f){try{var S=f.frag,L=r.hls.levels[S.level],A=r.getObjectType(S),D={d:S.duration*1e3,ot:A};(A===O.CMCDObjectType.VIDEO||A===O.CMCDObjectType.AUDIO||A==O.CMCDObjectType.MUXED)&&(D.br=L.bitrate/1e3,D.tb=r.getTopBandwidth(A)/1e3,D.bl=r.getBufferLength(A)),r.apply(f,D)}catch(a){e.logger.warn("Could not generate segment CMCD data.",a)}},this.hls=n;var v=this.config=n.config,E=v.cmcd;E!=null&&(v.pLoader=this.createPlaylistLoader(),v.fLoader=this.createFragmentLoader(),this.sid=E.sessionId||o.uuid(),this.cid=E.contentId,this.useHeaders=E.useHeaders===!0,this.registerListeners())}var s=o.prototype;return s.registerListeners=function(){var r=this.hls;r.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var r=this.hls;r.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(r,v){this.media=v.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},s.onBufferCreated=function(r,v){var E,f;this.audioBuffer=(E=v.tracks.audio)===null||E===void 0?void 0:E.buffer,this.videoBuffer=(f=v.tracks.video)===null||f===void 0?void 0:f.buffer},s.createData=function(){var r;return{v:O.CMCDVersion,sf:O.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(r,v){v===void 0&&(v={}),g(v,this.createData());var E=v.ot===O.CMCDObjectType.INIT||v.ot===O.CMCDObjectType.VIDEO||v.ot===O.CMCDObjectType.MUXED;if(this.starved&&E&&(v.bs=!0,v.su=!0,this.starved=!1),v.su==null&&(v.su=this.buffering),this.useHeaders){var f=o.toHeaders(v);if(!Object.keys(f).length)return;r.headers||(r.headers={}),g(r.headers,f)}else{var S=o.toQuery(v);if(!S)return;r.url=o.appendQueryToUri(r.url,S)}},s.getObjectType=function(r){var v=r.type;if(v==="subtitle")return O.CMCDObjectType.TIMED_TEXT;if(r.sn==="initSegment")return O.CMCDObjectType.INIT;if(v==="audio")return O.CMCDObjectType.AUDIO;if(v==="main")return this.hls.audioTracks.length?O.CMCDObjectType.VIDEO:O.CMCDObjectType.MUXED},s.getTopBandwidth=function(r){var v=0,E,f=this.hls;if(r===O.CMCDObjectType.AUDIO)E=f.audioTracks;else{var S=f.maxAutoLevel,L=S>-1?S+1:f.levels.length;E=f.levels.slice(0,L)}for(var A=c(E),D;!(D=A()).done;){var a=D.value;a.bitrate>v&&(v=a.bitrate)}return v>0?v:NaN},s.getBufferLength=function(r){var v=this.hls.media,E=r===O.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!E||!v)return NaN;var f=B.BufferHelper.bufferInfo(E,v.currentTime,this.config.maxBufferHole);return f.len*1e3},s.createPlaylistLoader=function(){var r=this.config.pLoader,v=this.applyPlaylistData,E=r||this.config.loader;return function(){function f(L){this.loader=void 0,this.loader=new E(L)}var S=f.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,D,a){v(A),this.loader.load(A,D,a)},w(f,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),f}()},s.createFragmentLoader=function(){var r=this.config.fLoader,v=this.applyFragmentData,E=r||this.config.loader;return function(){function f(L){this.loader=void 0,this.loader=new E(L)}var S=f.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,D,a){v(A),this.loader.load(A,D,a)},w(f,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),f}()},o.uuid=function(){var r=URL.createObjectURL(new Blob),v=r.toString();return URL.revokeObjectURL(r),v.slice(v.lastIndexOf("/")+1)},o.serialize=function(r){for(var v=[],E=function(R){return!Number.isNaN(R)&&R!=null&&R!==""&&R!==!1},f=function(R){return Math.round(R)},S=function(R){return f(R/100)*100},L=function(R){return encodeURIComponent(R)},A={br:f,d:f,bl:S,dl:S,mtp:S,nor:L,rtp:S,tb:f},D=Object.keys(r||{}).sort(),a=c(D),i;!(i=a()).done;){var t=i.value,h=r[t];if(E(h)&&!(t==="v"&&h===1)&&!(t=="pr"&&h===1)){var b=A[t];b&&(h=b(h));var T=typeof h,y=void 0;t==="ot"||t==="sf"||t==="st"?y=t+"="+h:T==="boolean"?y=t:T==="number"?y=t+"="+h:y=t+"="+JSON.stringify(h),v.push(y)}}return v.join(",")},o.toHeaders=function(r){for(var v=Object.keys(r),E={},f=["Object","Request","Session","Status"],S=[{},{},{},{}],L={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},A=0,D=v;A<D.length;A++){var a=D[A],i=L[a]!=null?L[a]:1;S[i][a]=r[a]}for(var t=0;t<S.length;t++){var h=o.serialize(S[t]);h&&(E["CMCD-"+f[t]]=h)}return E},o.toQuery=function(r){return"CMCD="+encodeURIComponent(o.serialize(r))},o.appendQueryToUri=function(r,v){if(!v)return r;var E=r.includes("?")?"&":"?";return""+r+E+v},o}()},"./src/controller/eme-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>A});var k=C("./src/events.ts"),O=C("./src/errors.ts"),B=C("./src/utils/logger.ts"),e=C("./src/utils/mediakeys-helper.ts"),I=C("./src/utils/keysystem-util.ts"),w=C("./src/utils/numeric-encoding-utils.ts"),u=C("./src/loader/level-key.ts"),p=C("./src/utils/hex.ts"),c=C("./src/utils/mp4-tools.ts"),m=C("./node_modules/eventemitter3/index.js"),l=C.n(m);function g(D,a){D.prototype=Object.create(a.prototype),D.prototype.constructor=D,r(D,a)}function _(D){var a=typeof Map=="function"?new Map:void 0;return _=function(t){if(t===null||!n(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(t))return a.get(t);a.set(t,h)}function h(){return o(t,arguments,v(this).constructor)}return h.prototype=Object.create(t.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),r(h,t)},_(D)}function o(D,a,i){return s()?o=Reflect.construct.bind():o=function(h,b,T){var y=[null];y.push.apply(y,b);var d=Function.bind.apply(h,y),R=new d;return T&&r(R,T.prototype),R},o.apply(null,arguments)}function s(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}function n(D){return Function.toString.call(D).indexOf("[native code]")!==-1}function r(D,a){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,h){return t.__proto__=h,t},r(D,a)}function v(D){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},v(D)}var E=3,f="[eme]",S=function(){function D(i){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=D.CDMCleanupPromise?[D.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=B.logger.debug.bind(B.logger,f),this.log=B.logger.log.bind(B.logger,f),this.warn=B.logger.warn.bind(B.logger,f),this.error=B.logger.error.bind(B.logger,f),this.hls=i,this.config=i.config,this.registerListeners()}var a=D.prototype;return a.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},a.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},a.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},a.getLicenseServerUrl=function(t){var h=this.config,b=h.drmSystems,T=h.widevineLicenseUrl,y=b[t];if(y)return y.licenseUrl;if(t===e.KeySystems.WIDEVINE&&T)return T;throw new Error('no license server URL configured for key-system "'+t+'"')},a.getServerCertificateUrl=function(t){var h=this.config.drmSystems,b=h[t];if(b)return b.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+t+'"]')},a.attemptKeySystemAccess=function(t){var h=this,b=this.hls.levels,T=function(M,F,U){return!!M&&U.indexOf(M)===F},y=b.map(function(R){return R.audioCodec}).filter(T),d=b.map(function(R){return R.videoCodec}).filter(T);return y.length+d.length===0&&d.push("avc1.42e01e"),new Promise(function(R,M){var F=function U(V){var re=V.shift();h.getMediaKeysPromise(re,y,d).then(function($){return R({keySystem:re,mediaKeys:$})}).catch(function($){V.length?U(V):$ instanceof L?M($):M(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:$,fatal:!0},$.message))})};F(t)})},a.requestMediaKeySystemAccess=function(t,h){var b=this.config.requestMediaKeySystemAccessFunc;if(typeof b!="function"){var T="Configured requestMediaKeySystemAccess is not a function "+b;return e.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(T="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(T))}return b(t,h)},a.getMediaKeysPromise=function(t,h,b){var T=this,y=(0,e.getSupportedMediaKeySystemConfigurations)(t,h,b,this.config.drmSystemOptions),d=this.keySystemAccessPromises[t],R=d==null?void 0:d.keySystemAccess;if(!R){this.log('Requesting encrypted media "'+t+'" key-system access with config: '+JSON.stringify(y)),R=this.requestMediaKeySystemAccess(t,y);var M=this.keySystemAccessPromises[t]={keySystemAccess:R};return R.catch(function(F){T.log('Failed to obtain access to key-system "'+t+'": '+F)}),R.then(function(F){T.log('Access for key-system "'+F.keySystem+'" obtained');var U=T.fetchServerCertificate(t);return T.log('Create media-keys for "'+t+'"'),M.mediaKeys=F.createMediaKeys().then(function(V){return T.log('Media-keys created for "'+t+'"'),U.then(function(re){return re?T.setMediaKeysServerCertificate(V,t,re):V})}),M.mediaKeys.catch(function(V){T.error('Failed to create media-keys for "'+t+'"}: '+V)}),M.mediaKeys})}return R.then(function(){return d.mediaKeys})},a.createMediaKeySessionContext=function(t){var h=t.decryptdata,b=t.keySystem,T=t.mediaKeys;console.assert(!!T,"mediaKeys is defined"),this.log('Creating key-system session "'+b+'" keyId: '+p.default.hexDump(h.keyId||[]));var y=T.createSession(),d={decryptdata:h,keySystem:b,mediaKeys:T,mediaKeysSession:y,keyStatus:"status-pending"};return this.mediaKeySessions.push(d),d},a.renewKeySession=function(t){var h=t.decryptdata;if(h.pssh){var b=this.createMediaKeySessionContext(t),T=this.getKeyIdString(h),y="cenc";this.keyIdToKeySessionPromise[T]=this.generateRequestWithPreferredKeySession(b,y,h.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)},a.getKeyIdString=function(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(t.keyId===null)throw new Error("keyId is null");return p.default.hexDump(t.keyId)},a.updateKeySession=function(t,h){var b,T=t.mediaKeysSession;return this.log('Updating key-session "'+T.sessionId+'" for keyID '+p.default.hexDump(((b=t.decryptdata)===null||b===void 0?void 0:b.keyId)||[])+`
} (data length: `+(h&&h.byteLength)+")"),T.update(h)},a.selectKeySystemFormat=function(t){var h=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+t.sn+" "+t.type+": "+t.level+") key formats "+h.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(h)),this.keyFormatPromise},a.getKeyFormatPromise=function(t){var h=this;return new Promise(function(b,T){var y=(0,e.getKeySystemsForConfig)(h.config),d=t.map(e.keySystemFormatToKeySystemDomain).filter(function(R){return!!R&&y.indexOf(R)!==-1});return h.getKeySystemSelectionPromise(d).then(function(R){var M=R.keySystem,F=(0,e.keySystemDomainToKeySystemFormat)(M);F?b(F):T(new Error('Unable to find format for key-system "'+M+'"'))}).catch(T)})},a.loadKey=function(t){var h=this,b=t.keyInfo.decryptdata,T=this.getKeyIdString(b),y="(keyId: "+T+' format: "'+b.keyFormat+'" method: '+b.method+" uri: "+b.uri+")";this.log("Starting session for key "+y);var d=this.keyIdToKeySessionPromise[T];return d||(d=this.keyIdToKeySessionPromise[T]=this.getKeySystemForKeyPromise(b).then(function(R){var M=R.keySystem,F=R.mediaKeys;return h.throwIfDestroyed(),h.log("Handle encrypted media sn: "+t.frag.sn+" "+t.frag.type+": "+t.frag.level+" using key "+y),h.attemptSetMediaKeys(M,F).then(function(){h.throwIfDestroyed();var U=h.createMediaKeySessionContext({keySystem:M,mediaKeys:F,decryptdata:b}),V="cenc";return h.generateRequestWithPreferredKeySession(U,V,b.pssh,"playlist-key")})}),d.catch(function(R){return h.handleError(R)})),d},a.throwIfDestroyed=function(t){if(t===void 0&&(t="Invalid state"),!this.hls)throw new Error("invalid state")},a.handleError=function(t){this.hls&&(this.error(t.message),t instanceof L?this.hls.trigger(k.Events.ERROR,t.data):this.hls.trigger(k.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))},a.getKeySystemForKeyPromise=function(t){var h=this.getKeyIdString(t),b=this.keyIdToKeySessionPromise[h];if(!b){var T=(0,e.keySystemFormatToKeySystemDomain)(t.keyFormat),y=T?[T]:(0,e.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(y)}return b},a.getKeySystemSelectionPromise=function(t){if(t.length||(t=(0,e.getKeySystemsForConfig)(this.config)),t.length===0)throw new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(t)},a._onMediaEncrypted=function(t){var h=this,b=t.initDataType,T=t.initData;if(this.debug('"'+t.type+'" event: init data type: "'+b+'"'),T!==null){var y,d;if(b==="sinf"&&this.config.drmSystems[e.KeySystems.FAIRPLAY]){var R=(0,c.bin2str)(new Uint8Array(T));try{var M=(0,w.base64Decode)(JSON.parse(R).sinf),F=(0,c.parseSinf)(new Uint8Array(M));if(!F)return;y=F.subarray(8,24),d=e.KeySystems.FAIRPLAY}catch(me){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var U=(0,c.parsePssh)(T);if(U===null)return;U.version===0&&U.systemId===e.KeySystemIds.WIDEVINE&&U.data&&(y=U.data.subarray(8,24)),d=(0,e.keySystemIdToKeySystemDomain)(U.systemId)}if(!(!d||!y)){for(var V=p.default.hexDump(y),re=this.keyIdToKeySessionPromise,$=this.mediaKeySessions,le=re[V],te=function(Ae){var Be=$[Ae],Le=Be.decryptdata;if(Le.pssh||!Le.keyId)return"continue";var Ie=p.default.hexDump(Le.keyId);if(V===Ie||Le.uri.replace(/-/g,"").indexOf(V)!==-1)return le=re[Ie],delete re[Ie],Le.pssh=new Uint8Array(T),Le.keyId=y,le=re[V]=le.then(function(){return h.generateRequestWithPreferredKeySession(Be,b,T,"encrypted-event-key-match")}),"break"},_e=0;_e<$.length;_e++){var fe=te(_e);if(fe!=="continue"&&fe==="break")break}le||(le=re[V]=this.getKeySystemSelectionPromise([d]).then(function(me){var Ae,Be=me.keySystem,Le=me.mediaKeys;h.throwIfDestroyed();var Ie=new u.LevelKey("ISO-23001-7",V,(Ae=(0,e.keySystemDomainToKeySystemFormat)(Be))!=null?Ae:"");return Ie.pssh=new Uint8Array(T),Ie.keyId=y,h.attemptSetMediaKeys(Be,Le).then(function(){h.throwIfDestroyed();var pe=h.createMediaKeySessionContext({decryptdata:Ie,keySystem:Be,mediaKeys:Le});return h.generateRequestWithPreferredKeySession(pe,b,T,"encrypted-event-no-match")})})),le.catch(function(me){return h.handleError(me)})}}},a._onWaitingForKey=function(t){this.log('"'+t.type+'" event')},a.attemptSetMediaKeys=function(t,h){var b=this,T=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+t+'"');var y=Promise.all(T).then(function(){if(!b.media)throw new Error("Attempted to set mediaKeys without media element attached");return b.media.setMediaKeys(h)});return this.setMediaKeysQueue.push(y),y.then(function(){b.log('Media-keys set for "'+t+'"'),T.push(y),b.setMediaKeysQueue=b.setMediaKeysQueue.filter(function(d){return T.indexOf(d)===-1})})},a.generateRequestWithPreferredKeySession=function(t,h,b,T){var y,d,R=this,M=(y=this.config.drmSystems)===null||y===void 0||(d=y[t.keySystem])===null||d===void 0?void 0:d.generateRequest;if(M)try{var F=M.call(this.hls,h,b,t);if(!F)throw new Error("Invalid response from configured generateRequest filter");h=F.initDataType,b=t.decryptdata.pssh=F.initData?new Uint8Array(F.initData):null}catch(le){var U;if(this.warn(le.message),(U=this.hls)!==null&&U!==void 0&&U.config.debug)throw le}if(b===null)return this.log('Skipping key-session request for "'+T+'" (no initData)'),Promise.resolve(t);var V=this.getKeyIdString(t.decryptdata);this.log('Generating key-session request for "'+T+'": '+V+" (init data type: "+h+" length: "+(b?b.byteLength:null)+")");var re=new(l());t.mediaKeysSession.onmessage=function(le){var te=t.mediaKeysSession;if(!te){re.emit("error",new Error("invalid state"));return}var _e=le.messageType,fe=le.message;R.log('"'+_e+'" message event for session "'+te.sessionId+'" message size: '+fe.byteLength),_e==="license-request"||_e==="license-renewal"?R.renewLicense(t,fe).catch(function(me){R.handleError(me),re.emit("error",me)}):_e==="license-release"?t.keySystem===e.KeySystems.FAIRPLAY&&(R.updateKeySession(t,(0,I.strToUtf8array)("acknowledged")),R.removeSession(t)):R.warn('unhandled media key message type "'+_e+'"')},t.mediaKeysSession.onkeystatuseschange=function(le){var te=t.mediaKeysSession;if(!te){re.emit("error",new Error("invalid state"));return}R.onKeyStatusChange(t);var _e=t.keyStatus;re.emit("keyStatus",_e),_e==="expired"&&(R.warn(t.keySystem+" expired for key "+V),R.renewKeySession(t))};var $=new Promise(function(le,te){re.on("error",te),re.on("keyStatus",function(_e){_e.startsWith("usable")?le():_e==="output-restricted"?te(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):_e==="internal-error"?te(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+_e+'"')):_e==="expired"?te(new Error("key expired while generating request")):R.warn('unhandled key status change "'+_e+'"')})});return t.mediaKeysSession.generateRequest(h,b).then(function(){var le;R.log('Request generated for key-session "'+((le=t.mediaKeysSession)===null||le===void 0?void 0:le.sessionId)+'" keyId: '+V)}).catch(function(le){throw new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:le,fatal:!1},"Error generating key-session request: "+le)}).then(function(){return $}).catch(function(le){throw re.removeAllListeners(),R.removeSession(t),le}).then(function(){return re.removeAllListeners(),t})},a.onKeyStatusChange=function(t){var h=this;t.mediaKeysSession.keyStatuses.forEach(function(b,T){h.log('key status change "'+b+'" for keyStatuses keyId: '+p.default.hexDump("buffer"in T?new Uint8Array(T.buffer,T.byteOffset,T.byteLength):new Uint8Array(T))+" session keyId: "+p.default.hexDump(new Uint8Array(t.decryptdata.keyId||[]))+" uri: "+t.decryptdata.uri),t.keyStatus=b})},a.fetchServerCertificate=function(t){var h=this;return new Promise(function(b,T){var y=h.getServerCertificateUrl(t);if(!y)return b();h.log('Fetching serverCertificate for "'+t+'"');var d=new XMLHttpRequest;d.open("GET",y,!0),d.responseType="arraybuffer",d.onreadystatechange=function(){d.readyState===XMLHttpRequest.DONE&&(d.status===200?b(d.response):T(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:d},'"'+t+'" certificate request XHR failed ('+y+"). Status: "+d.status+" ("+d.statusText+")")))},d.send()})},a.setMediaKeysServerCertificate=function(t,h,b){var T=this;return new Promise(function(y,d){t.setServerCertificate(b).then(function(R){T.log("setServerCertificate "+(R?"success":"not supported by CDM")+" ("+(b==null?void 0:b.byteLength)+') on "'+h+'"'),y(t)}).catch(function(R){d(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:R,fatal:!0},R.message))})})},a.renewLicense=function(t,h){var b=this;return this.requestLicense(t,new Uint8Array(h)).then(function(T){return b.updateKeySession(t,new Uint8Array(T)).catch(function(y){throw new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:y,fatal:!0},y.message)})})},a.setupLicenseXHR=function(t,h,b,T){var y=this,d=this.config.licenseXhrSetup;return d?Promise.resolve().then(function(){if(!b.decryptdata)throw new Error("Key removed");return d.call(y.hls,t,h,b,T)}).catch(function(R){if(!b.decryptdata)throw R;return t.open("POST",h,!0),d.call(y.hls,t,h,b,T)}).then(function(R){t.readyState||t.open("POST",h,!0);var M=R||T;return{xhr:t,licenseChallenge:M}}):(t.open("POST",h,!0),Promise.resolve({xhr:t,licenseChallenge:T}))},a.requestLicense=function(t,h){var b=this;return new Promise(function(T,y){var d=b.getLicenseServerUrl(t.keySystem);b.log("Sending license request to URL: "+d);var R=new XMLHttpRequest;R.responseType="arraybuffer",R.onreadystatechange=function(){if(!b.hls||!t.mediaKeysSession)return y(new Error("invalid state"));if(R.readyState===4)if(R.status===200){b._requestLicenseFailureCount=0;var M=R.response;b.log("License received "+(M instanceof ArrayBuffer?M.byteLength:M));var F=b.config.licenseResponseCallback;if(F)try{M=F.call(b.hls,R,d,t)}catch(V){b.error(V)}T(M)}else if(b._requestLicenseFailureCount++,b._requestLicenseFailureCount>E||R.status>=400&&R.status<500)y(new L({type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:R},"License Request XHR failed ("+d+"). Status: "+R.status+" ("+R.statusText+")"));else{var U=E-b._requestLicenseFailureCount+1;b.warn("Retrying license request, "+U+" attempts left"),b.requestLicense(t,h).then(T,y)}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=R,b.setupLicenseXHR(R,d,t,h).then(function(M){var F=M.xhr,U=M.licenseChallenge;F.send(U)})})},a.onMediaAttached=function(t,h){if(this.config.emeEnabled){var b=h.media;this.media=b,b.addEventListener("encrypted",this.onMediaEncrypted),b.addEventListener("waitingforkey",this.onWaitingForKey)}},a.onMediaDetached=function(){var t=this,h=this.media,b=this.mediaKeySessions;h&&(h.removeEventListener("encrypted",this.onMediaEncrypted),h.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},u.LevelKey.clearKeyUriToKeyIdMap();var T=b.length;D.CDMCleanupPromise=Promise.all(b.map(function(y){return t.removeSession(y)}).concat(h==null?void 0:h.setMediaKeys(null).catch(function(y){t.log("Could not clear media keys: "+y+". media.src: "+(h==null?void 0:h.src))}))).then(function(){T&&(t.log("finished closing key sessions and clearing media keys"),b.length=0)}).catch(function(y){t.log("Could not close sessions and clear media keys: "+y+". media.src: "+(h==null?void 0:h.src))})},a.onManifestLoaded=function(t,h){var b=h.sessionKeys;if(!(!b||!this.config.emeEnabled)&&!this.keyFormatPromise){var T=b.reduce(function(y,d){return y.indexOf(d.keyFormat)===-1&&y.push(d.keyFormat),y},[]);this.log("Selecting key-system from session-keys "+T.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(T)}},a.removeSession=function(t){var h=this,b=t.mediaKeysSession,T=t.licenseXhr;if(b){this.log("Remove licenses and keys and close session "+b.sessionId),b.onmessage=null,b.onkeystatuseschange=null,T&&T.readyState!==XMLHttpRequest.DONE&&T.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;var y=this.mediaKeySessions.indexOf(t);return y>-1&&this.mediaKeySessions.splice(y,1),b.remove().catch(function(d){h.log("Could not remove session: "+d)}).then(function(){return b.close()}).catch(function(d){h.log("Could not close session: "+d)})}},D}();S.CDMCleanupPromise=void 0;var L=function(D){g(a,D);function a(i,t){var h;return h=D.call(this,t)||this,h.data=void 0,h.data=i,i.err=i.error,h}return a}(_(Error));const A=S},"./src/controller/fps-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>e});var k=C("./src/events.ts"),O=C("./src/utils/logger.ts"),B=function(){function I(u){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=u,this.registerListeners()}var w=I.prototype;return w.setStreamController=function(p){this.streamController=p},w.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},w.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},w.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},w.onMediaAttaching=function(p,c){var m=this.hls.config;if(m.capLevelOnFPSDrop){var l=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=l,l&&typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},w.checkFPS=function(p,c,m){var l=performance.now();if(c){if(this.lastTime){var g=l-this.lastTime,_=m-this.lastDroppedFrames,o=c-this.lastDecodedFrames,s=1e3*_/g,n=this.hls;if(n.trigger(k.Events.FPS_DROP,{currentDropped:_,currentDecoded:o,totalDroppedFrames:m}),s>0&&_>n.config.fpsDroppedMonitoringThreshold*o){var r=n.currentLevel;O.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=r)&&(r=r-1,n.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:n.currentLevel}),n.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=l,this.lastDroppedFrames=m,this.lastDecodedFrames=c}},w.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var c=p.getVideoPlaybackQuality();this.checkFPS(p,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},I}();const e=B},"./src/controller/fragment-finders.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{findFragWithCC:()=>u,findFragmentByPDT:()=>B,findFragmentByPTS:()=>e,fragmentWithinToleranceTest:()=>I,pdtWithinToleranceTest:()=>w});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/binary-search.ts");function B(p,c,m){if(c===null||!Array.isArray(p)||!p.length||!(0,k.isFiniteNumber)(c))return null;var l=p[0].programDateTime;if(c<(l||0))return null;var g=p[p.length-1].endProgramDateTime;if(c>=(g||0))return null;m=m||0;for(var _=0;_<p.length;++_){var o=p[_];if(w(c,m,o))return o}return null}function e(p,c,m,l){m===void 0&&(m=0),l===void 0&&(l=0);var g=null;if(p?g=c[p.sn-c[0].sn+1]||null:m===0&&c[0].start===0&&(g=c[0]),g&&I(m,l,g)===0)return g;var _=O.default.search(c,I.bind(null,m,l));return _&&(_!==p||!g)?_:g}function I(p,c,m){if(p===void 0&&(p=0),c===void 0&&(c=0),m.start<=p&&m.start+m.duration>p)return 0;var l=Math.min(c,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-l<=p?1:m.start-l>p&&m.start?-1:0}function w(p,c,m){var l=Math.min(c,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,g=m.endProgramDateTime||0;return g-l>p}function u(p,c){return O.default.search(p,function(m){return m.cc<c?1:m.cc>c?-1:0})}},"./src/controller/fragment-tracker.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{FragmentState:()=>B,FragmentTracker:()=>e});var k=C("./src/events.ts"),O=C("./src/types/loader.ts"),B;(function(u){u.NOT_LOADED="NOT_LOADED",u.APPENDING="APPENDING",u.PARTIAL="PARTIAL",u.OK="OK"})(B||(B={}));var e=function(){function u(c){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=c,this._registerListeners()}var p=u.prototype;return p._registerListeners=function(){var m=this.hls;m.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var m=this.hls;m.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},p.getAppendedFrag=function(m,l){if(l===O.PlaylistLevelType.MAIN){var g=this.activeFragment,_=this.activeParts;if(!g)return null;if(_)for(var o=_.length;o--;){var s=_[o],n=s?s.end:g.appendedPTS;if(s.start<=m&&n!==void 0&&m<=n)return o>9&&(this.activeParts=_.slice(o-9)),s}else if(g.start<=m&&g.appendedPTS!==void 0&&m<=g.appendedPTS)return g}return this.getBufferedFrag(m,l)},p.getBufferedFrag=function(m,l){for(var g=this.fragments,_=Object.keys(g),o=_.length;o--;){var s=g[_[o]];if((s==null?void 0:s.body.type)===l&&s.buffered){var n=s.body;if(n.start<=m&&m<=n.end)return n}}return null},p.detectEvictedFragments=function(m,l,g){var _=this;this.timeRanges&&(this.timeRanges[m]=l),Object.keys(this.fragments).forEach(function(o){var s=_.fragments[o];if(s){if(!s.buffered&&!s.loaded){s.body.type===g&&_.removeFragment(s.body);return}var n=s.range[m];n&&n.time.some(function(r){var v=!_.isTimeBuffered(r.startPTS,r.endPTS,l);return v&&_.removeFragment(s.body),v})}})},p.detectPartialFragments=function(m){var l=this,g=this.timeRanges,_=m.frag,o=m.part;if(!(!g||_.sn==="initSegment")){var s=w(_),n=this.fragments[s];n&&(Object.keys(g).forEach(function(r){var v=_.elementaryStreams[r];if(v){var E=g[r],f=o!==null||v.partial===!0;n.range[r]=l.getBufferedTimes(_,o,f,E)}}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,n.body.endList&&(this.endListFragments[n.body.type]=n)):this.removeFragment(n.body))}},p.fragBuffered=function(m){var l=w(m),g=this.fragments[l];g&&(g.loaded=null,g.buffered=!0)},p.getBufferedTimes=function(m,l,g,_){for(var o={time:[],partial:g},s=l?l.start:m.start,n=l?l.end:m.end,r=m.minEndPTS||n,v=m.maxStartPTS||s,E=0;E<_.length;E++){var f=_.start(E)-this.bufferPadding,S=_.end(E)+this.bufferPadding;if(v>=f&&r<=S){o.time.push({startPTS:Math.max(s,_.start(E)),endPTS:Math.min(n,_.end(E))});break}else if(s<S&&n>f)o.partial=!0,o.time.push({startPTS:Math.max(s,_.start(E)),endPTS:Math.min(n,_.end(E))});else if(n<=f)break}return o},p.getPartialFragment=function(m){var l=null,g,_,o,s=0,n=this.bufferPadding,r=this.fragments;return Object.keys(r).forEach(function(v){var E=r[v];E&&I(E)&&(_=E.body.start-n,o=E.body.end+n,m>=_&&m<=o&&(g=Math.min(m-_,o-m),s<=g&&(l=E.body,s=g)))}),l},p.isEndListAppended=function(m){var l=this.endListFragments[m];return l!==void 0&&(l.buffered||I(l))},p.getState=function(m){var l=w(m),g=this.fragments[l];return g?g.buffered?I(g)?B.PARTIAL:B.OK:B.APPENDING:B.NOT_LOADED},p.isTimeBuffered=function(m,l,g){for(var _,o,s=0;s<g.length;s++){if(_=g.start(s)-this.bufferPadding,o=g.end(s)+this.bufferPadding,m>=_&&l<=o)return!0;if(l<=_)return!1}return!1},p.onFragLoaded=function(m,l){var g=l.frag,_=l.part;if(!(g.sn==="initSegment"||g.bitrateTest||_)){var o=w(g);this.fragments[o]={body:g,loaded:l,buffered:!1,range:Object.create(null)}}},p.onBufferAppended=function(m,l){var g=this,_=l.frag,o=l.part,s=l.timeRanges;if(_.type===O.PlaylistLevelType.MAIN)if(this.activeFragment!==_&&(this.activeFragment=_,_.appendedPTS=void 0),o){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(o)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(r){var v=s[r];if(g.detectEvictedFragments(r,v),!o&&_.type===O.PlaylistLevelType.MAIN){var E=_.elementaryStreams[r];if(!E)return;for(var f=0;f<v.length;f++){var S=v.end(f);S<=E.endPTS&&S>E.startPTS?_.appendedPTS=Math.max(S,_.appendedPTS||0):_.appendedPTS=E.endPTS}}})},p.onFragBuffered=function(m,l){this.detectPartialFragments(l)},p.hasFragment=function(m){var l=w(m);return!!this.fragments[l]},p.removeFragmentsInRange=function(m,l,g){var _=this;Object.keys(this.fragments).forEach(function(o){var s=_.fragments[o];if(s&&s.buffered){var n=s.body;n.type===g&&n.start<l&&n.end>m&&_.removeFragment(n)}})},p.removeFragment=function(m){var l=w(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),m.appendedPTS=void 0,delete this.fragments[l],m.endList&&delete this.endListFragments[m.type]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},u}();function I(u){var p,c;return u.buffered&&(((p=u.range.video)===null||p===void 0?void 0:p.partial)||((c=u.range.audio)===null||c===void 0?void 0:c.partial))}function w(u){return u.type+"_"+u.level+"_"+u.urlId+"_"+u.sn}},"./src/controller/gap-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{MAX_START_GAP_JUMP:()=>w,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>u,SKIP_BUFFER_RANGE_START:()=>p,STALL_MINIMUM_DURATION_MS:()=>I,default:()=>c});var k=C("./src/utils/buffer-helper.ts"),O=C("./src/errors.ts"),B=C("./src/events.ts"),e=C("./src/utils/logger.ts"),I=250,w=2,u=.1,p=.05,c=function(){function m(g,_,o,s){this.config=void 0,this.media=null,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=g,this.media=_,this.fragmentTracker=o,this.hls=s}var l=m.prototype;return l.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},l.poll=function(_,o){var s=this.config,n=this.media,r=this.stalled;if(n!==null){var v=n.currentTime,E=n.seeking,f=this.seeking&&!E,S=!this.seeking&&E;if(this.seeking=E,v!==_){if(this.moved=!0,r!==null){if(this.stallReported){var L=self.performance.now()-r;e.logger.warn("playback not stuck anymore @"+v+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||f)&&(this.stalled=null),!(n.paused&&!E||n.ended||n.playbackRate===0||!k.BufferHelper.getBuffered(n).length)){var A=k.BufferHelper.bufferInfo(n,v,0),D=A.len>0,a=A.nextStart||0;if(!(!D&&!a)){if(E){var i=A.len>w,t=!a||o&&o.start<=v||a-v>w&&!this.fragmentTracker.getPartialFragment(v);if(i||t)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var h,b=Math.max(a,A.start||0)-v,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=T==null||(h=T.details)===null||h===void 0?void 0:h.live,d=y?T.details.targetduration*2:w;if(b>0&&b<=d){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(r===null){this.stalled=R;return}var M=R-r;if(!(!E&&M>=I&&(this._reportStall(A),!this.media))){var F=k.BufferHelper.bufferInfo(n,v,s.maxBufferHole);this._tryFixBufferStall(F,M)}}}}},l._tryFixBufferStall=function(_,o){var s=this.config,n=this.fragmentTracker,r=this.media;if(r!==null){var v=r.currentTime,E=n.getPartialFragment(v);if(E){var f=this._trySkipBufferHole(E);if(f||!this.media)return}_.len>s.maxBufferHole&&o>s.highBufferWatchdogPeriod*1e3&&(e.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},l._reportStall=function(_){var o=this.hls,s=this.media,n=this.stallReported;!n&&s&&(this.stallReported=!0,e.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer ("+JSON.stringify(_)+")"),o.trigger(B.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:_.len}))},l._trySkipBufferHole=function(_){var o=this.config,s=this.hls,n=this.media;if(n===null)return 0;for(var r=n.currentTime,v=0,E=k.BufferHelper.getBuffered(n),f=0;f<E.length;f++){var S=E.start(f);if(r+o.maxBufferHole>=v&&r<S){var L=Math.max(S+p,n.currentTime+u);return e.logger.warn("skipping hole, adjusting currentTime from "+r+" to "+L),this.moved=!0,this.stalled=null,n.currentTime=L,_&&s.trigger(B.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+r+" to "+L,frag:_}),L}v=E.end(f)}return 0},l._tryNudgeBuffer=function(){var _=this.config,o=this.hls,s=this.media,n=this.nudgeRetry;if(s!==null){var r=s.currentTime;if(this.nudgeRetry++,n<_.nudgeMaxRetry){var v=r+(n+1)*_.nudgeOffset;e.logger.warn("Nudging 'currentTime' from "+r+" to "+v),s.currentTime=v,o.trigger(B.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else e.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+_.nudgeMaxRetry+" nudges"),o.trigger(B.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}},m}()},"./src/controller/id3-track-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>_});var k=C("./src/polyfills/number.ts"),O=C("./src/events.ts"),B=C("./src/utils/texttrack-utils.ts"),e=C("./src/demux/id3.ts"),I=C("./src/loader/date-range.ts"),w=C("./src/types/demuxer.ts"),u=.25;function p(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var c=function(){var o=p();try{new o(0,Number.POSITIVE_INFINITY,"")}catch(s){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function m(o,s){return o.getTime()/1e3-s}function l(o){return Uint8Array.from(o.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var g=function(){function o(n){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=n,this._registerListeners()}var s=o.prototype;return s.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},s._registerListeners=function(){var r=this.hls;r.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(O.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),r.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},s._unregisterListeners=function(){var r=this.hls;r.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(O.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),r.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},s.onMediaAttached=function(r,v){this.media=v.media},s.onMediaDetaching=function(){this.id3Track&&((0,B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},s.onManifestLoading=function(){this.dateRangeCuesAppended={}},s.createTrack=function(r){var v=this.getID3Track(r.textTracks);return v.mode="hidden",v},s.getID3Track=function(r){if(this.media){for(var v=0;v<r.length;v++){var E=r[v];if(E.kind==="metadata"&&E.label==="id3")return(0,B.sendAddTrackEvent)(E,this.media),E}return this.media.addTextTrack("metadata","id3")}},s.onFragParsingMetadata=function(r,v){if(this.media){var E=this.hls.config,f=E.enableEmsgMetadataCues,S=E.enableID3MetadataCues;if(!(!f&&!S)){var L=v.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var A=p(),D=0;D<L.length;D++){var a=L[D].type;if(!(a===w.MetadataSchema.emsg&&!f||!S)){var i=e.getID3Frames(L[D].data);if(i){var t=L[D].pts,h=t+L[D].duration;h>c&&(h=c);var b=h-t;b<=0&&(h=t+u);for(var T=0;T<i.length;T++){var y=i[T];if(!e.isTimeStampFrame(y)){this.updateId3CueEnds(t);var d=new A(t,h,"");d.value=y,a&&(d.type=a),this.id3Track.addCue(d)}}}}}}}},s.updateId3CueEnds=function(r){var v,E=(v=this.id3Track)===null||v===void 0?void 0:v.cues;if(E)for(var f=E.length;f--;){var S=E[f];S.startTime<r&&S.endTime===c&&(S.endTime=r)}},s.onBufferFlushing=function(r,v){var E=v.startOffset,f=v.endOffset,S=v.type,L=this.id3Track,A=this.hls;if(A){var D=A.config,a=D.enableEmsgMetadataCues,i=D.enableID3MetadataCues;if(L&&(a||i)){var t;S==="audio"?t=function(b){return b.type===w.MetadataSchema.audioId3&&i}:S==="video"?t=function(b){return b.type===w.MetadataSchema.emsg&&a}:t=function(b){return b.type===w.MetadataSchema.audioId3&&i||b.type===w.MetadataSchema.emsg&&a},(0,B.removeCuesInRange)(L,E,f,t)}}},s.onLevelUpdated=function(r,v){var E=this,f=v.details;if(!(!this.media||!f.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)){var S=this.dateRangeCuesAppended,L=this.id3Track,A=f.dateRanges,D=Object.keys(A);if(L)for(var a=Object.keys(S).filter(function(R){return!D.includes(R)}),i=function(M){var F=a[M];Object.keys(S[F].cues).forEach(function(U){L.removeCue(S[F].cues[U])}),delete S[F]},t=a.length;t--;)i(t);var h=f.fragments[f.fragments.length-1];if(!(D.length===0||!(0,k.isFiniteNumber)(h==null?void 0:h.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var b=h.programDateTime/1e3-h.start,T=p(),y=function(M){var F=D[M],U=A[F],V=S[F],re=(V==null?void 0:V.cues)||{},$=(V==null?void 0:V.durationKnown)||!1,le=m(U.startDate,b),te=c,_e=U.endDate;if(_e)te=m(_e,b),$=!0;else if(U.endOnNext&&!$){var fe=D.reduce(function(pe,Ke){var Ce=A[Ke];return Ce.class===U.class&&Ce.id!==Ke&&Ce.startDate>U.startDate&&pe.push(Ce),pe},[]).sort(function(pe,Ke){return pe.startDate.getTime()-Ke.startDate.getTime()})[0];fe&&(te=m(fe.startDate,b),$=!0)}for(var me=Object.keys(U.attr),Ae=0;Ae<me.length;Ae++){var Be=me[Ae];if(!(Be===I.DateRangeAttribute.ID||Be===I.DateRangeAttribute.CLASS||Be===I.DateRangeAttribute.START_DATE||Be===I.DateRangeAttribute.DURATION||Be===I.DateRangeAttribute.END_DATE||Be===I.DateRangeAttribute.END_ON_NEXT)){var Le=re[Be];if(Le)$&&!V.durationKnown&&(Le.endTime=te);else{var Ie=U.attr[Be];Le=new T(le,te,""),(Be===I.DateRangeAttribute.SCTE35_OUT||Be===I.DateRangeAttribute.SCTE35_IN)&&(Ie=l(Ie)),Le.value={key:Be,data:Ie},Le.type=w.MetadataSchema.dateRange,E.id3Track.addCue(Le),re[Be]=Le}}}S[F]={cues:re,dateRange:U,durationKnown:$}},d=0;d<D.length;d++)y(d)}}},o}();const _=g},"./src/controller/latency-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>p});var k=C("./src/errors.ts"),O=C("./src/events.ts"),B=C("./src/utils/logger.ts");function e(c,m){for(var l=0;l<m.length;l++){var g=m[l];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,w(g.key),g)}}function I(c,m,l){return m&&e(c.prototype,m),l&&e(c,l),Object.defineProperty(c,"prototype",{writable:!1}),c}function w(c){var m=u(c,"string");return typeof m=="symbol"?m:String(m)}function u(c,m){if(typeof c!="object"||c===null)return c;var l=c[Symbol.toPrimitive];if(l!==void 0){var g=l.call(c,m||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(c)}var p=function(){function c(l){var g=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 g.timeupdate()},this.hls=l,this.config=l.config,this.registerListeners()}var m=c.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(O.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(O.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(O.Events.ERROR,this.onError)},m.onMediaAttached=function(g,_){this.media=_.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(g,_){var o=_.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(g,_){_.details===k.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,B.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},m.timeupdate=function(){var g=this.media,_=this.levelDetails;if(!(!g||!_)){this.currentTime=g.currentTime;var o=this.computeLatency();if(o!==null){this._latency=o;var s=this.config,n=s.lowLatencyMode,r=s.maxLiveSyncPlaybackRate;if(!(!n||r===1)){var v=this.targetLatency;if(v!==null){var E=o-v,f=Math.min(this.maxLatency,v+_.targetduration),S=E<f;if(_.live&&S&&E>.05&&this.forwardBufferLength>1){var L=Math.min(2,Math.max(1,r)),A=Math.round(2/(1+Math.exp(-.75*E-this.edgeStalled))*20)/20;g.playbackRate=Math.min(L,Math.max(1,A))}else g.playbackRate!==1&&g.playbackRate!==0&&(g.playbackRate=1)}}}}},m.estimateLiveEdge=function(){var g=this.levelDetails;return g===null?null:g.edge+g.age},m.computeLatency=function(){var g=this.estimateLiveEdge();return g===null?null:g-this.currentTime},I(c,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var g=this.config,_=this.levelDetails;return g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:_?g.liveMaxLatencyDurationCount*_.targetduration:0}},{key:"targetLatency",get:function(){var g=this.levelDetails;if(g===null)return null;var _=g.holdBack,o=g.partHoldBack,s=g.targetduration,n=this.config,r=n.liveSyncDuration,v=n.liveSyncDurationCount,E=n.lowLatencyMode,f=this.hls.userConfig,S=E&&o||_;(f.liveSyncDuration||f.liveSyncDurationCount||S===0)&&(S=r!==void 0?r:v*s);var L=s,A=1;return S+Math.min(this.stallCount*A,L)}},{key:"liveSyncPosition",get:function(){var g=this.estimateLiveEdge(),_=this.targetLatency,o=this.levelDetails;if(g===null||_===null||o===null)return null;var s=o.edge,n=g-_-this.edgeStalled,r=s-o.totalduration,v=s-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(r,n),v)}},{key:"drift",get:function(){var g=this.levelDetails;return g===null?1:g.drift}},{key:"edgeStalled",get:function(){var g=this.levelDetails;if(g===null)return 0;var _=(this.config.lowLatencyMode&&g.partTarget||g.targetduration)*3;return Math.max(g.age-_,0)}},{key:"forwardBufferLength",get:function(){var g=this.media,_=this.levelDetails;if(!g||!_)return 0;var o=g.buffered.length;return(o?g.buffered.end(o-1):_.edge)-this.currentTime}}]),c}()},"./src/controller/level-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>n});var k=C("./src/types/level.ts"),O=C("./src/events.ts"),B=C("./src/errors.ts"),e=C("./src/utils/codecs.ts"),I=C("./src/controller/level-helper.ts"),w=C("./src/controller/base-playlist-controller.ts"),u=C("./src/types/loader.ts");function p(){return p=Object.assign?Object.assign.bind():function(r){for(var v=1;v<arguments.length;v++){var E=arguments[v];for(var f in E)Object.prototype.hasOwnProperty.call(E,f)&&(r[f]=E[f])}return r},p.apply(this,arguments)}function c(r,v){for(var E=0;E<v.length;E++){var f=v[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,l(f.key),f)}}function m(r,v,E){return v&&c(r.prototype,v),E&&c(r,E),Object.defineProperty(r,"prototype",{writable:!1}),r}function l(r){var v=g(r,"string");return typeof v=="symbol"?v:String(v)}function g(r,v){if(typeof r!="object"||r===null)return r;var E=r[Symbol.toPrimitive];if(E!==void 0){var f=E.call(r,v||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(r)}function _(r,v){r.prototype=Object.create(v.prototype),r.prototype.constructor=r,o(r,v)}function o(r,v){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,S){return f.__proto__=S,f},o(r,v)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),n=function(r){_(v,r);function v(f){var S;return S=r.call(this,f,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var E=v.prototype;return E._registerListeners=function(){var S=this.hls;S.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(O.Events.ERROR,this.onError,this)},E._unregisterListeners=function(){var S=this.hls;S.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(O.Events.ERROR,this.onError,this)},E.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},E.startLoad=function(){var S=this._levels;S.forEach(function(L){L.loadError=0}),r.prototype.startLoad.call(this)},E.onManifestLoaded=function(S,L){var A=[],D=[],a=[],i,t={},h,b=!1,T=!1,y=!1;if(L.levels.forEach(function(F){var U=F.attrs;b=b||!!(F.width&&F.height),T=T||!!F.videoCodec,y=y||!!F.audioCodec,s&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var V=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;h=t[V],h?h.url.push(F.url):(h=new k.Level(F),t[V]=h,A.push(h)),U&&(U.AUDIO&&(0,I.addGroupId)(h,"audio",U.AUDIO),U.SUBTITLES&&(0,I.addGroupId)(h,"text",U.SUBTITLES))}),(b||T)&&y&&(A=A.filter(function(F){var U=F.videoCodec,V=F.width,re=F.height;return!!U||!!(V&&re)})),A=A.filter(function(F){var U=F.audioCodec,V=F.videoCodec;return(!U||(0,e.isCodecSupportedInMp4)(U,"audio"))&&(!V||(0,e.isCodecSupportedInMp4)(V,"video"))}),L.audioTracks&&(D=L.audioTracks.filter(function(F){return!F.audioCodec||(0,e.isCodecSupportedInMp4)(F.audioCodec,"audio")}),(0,I.assignTrackIdsByGroup)(D)),L.subtitles&&(a=L.subtitles,(0,I.assignTrackIdsByGroup)(a)),A.length>0){i=A[0].bitrate,A.sort(function(F,U){return F.attrs["HDCP-LEVEL"]!==U.attrs["HDCP-LEVEL"]?(F.attrs["HDCP-LEVEL"]||"")>(U.attrs["HDCP-LEVEL"]||"")?1:-1:F.bitrate!==U.bitrate?F.bitrate-U.bitrate:F.attrs.SCORE!==U.attrs.SCORE?F.attrs.decimalFloatingPoint("SCORE")-U.attrs.decimalFloatingPoint("SCORE"):b&&F.height!==U.height?F.height-U.height:0}),this._levels=A;for(var d=0;d<A.length;d++)if(A[d].bitrate===i){this._firstLevel=d,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+i);break}var R=y&&!T,M={levels:A,audioTracks:D,subtitleTracks:a,sessionData:L.sessionData,sessionKeys:L.sessionKeys,firstLevel:this._firstLevel,stats:L.stats,audio:y,video:T,altAudio:!R&&D.some(function(F){return!!F.url})};this.hls.trigger(O.Events.MANIFEST_PARSED,M),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(O.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:L.url,reason:"no level with compatible codecs found in manifest"})},E.onError=function(S,L){var A,D;if(r.prototype.onError.call(this,S,L),!L.fatal){var a=L.context,i=this._levels[this.currentLevelIndex];if(a&&(a.type===u.PlaylistContextType.AUDIO_TRACK&&i.audioGroupIds&&a.groupId===i.audioGroupIds[i.urlId]||a.type===u.PlaylistContextType.SUBTITLE_TRACK&&i.textGroupIds&&a.groupId===i.textGroupIds[i.urlId])){this.redundantFailover(this.currentLevelIndex);return}var t=!1,h=!0,b;switch(L.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(L.frag){var T=L.frag.type===u.PlaylistLevelType.MAIN?L.frag.level:this.currentLevelIndex,y=this._levels[T];y?(y.fragmentError++,y.fragmentError>this.hls.config.fragLoadingMaxRetry&&(b=T)):b=T}break;case B.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var d=i.attrs["HDCP-LEVEL"];d&&(this.hls.maxHdcpLevel=k.HdcpLevels[k.HdcpLevels.indexOf(d)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case B.ErrorDetails.FRAG_PARSING_ERROR:case B.ErrorDetails.KEY_SYSTEM_NO_SESSION:b=((A=L.frag)===null||A===void 0?void 0:A.type)===u.PlaylistLevelType.MAIN?L.frag.level:this.currentLevelIndex,L.levelRetry=!1;break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:a&&(a.deliveryDirectives&&(h=!1),b=a.level),t=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:b=(D=L.level)!=null?D:this.currentLevelIndex,t=!0;break}b!==void 0&&this.recoverLevel(L,b,t,h)}},E.recoverLevel=function(S,L,A,D){var a=S.details,i=this._levels[L];if(i.loadError++,A){var t=this.retryLoadingOrFail(S);if(t)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(D){var h=i.url.length;if(h>1&&i.loadError<h)S.levelRetry=!0,this.redundantFailover(L);else if(this.manualLevelIndex===-1){for(var b=-1,T=this._levels,y=T.length;y--;){var d=(y+this.currentLevelIndex)%T.length;if(d!==this.currentLevelIndex&&T[d].loadError===0){b=d;break}}b>-1&&this.currentLevelIndex!==b?(this.warn(a+": switch to "+b),S.levelRetry=!0,this.hls.nextAutoLevel=b):S.levelRetry===!1&&(S.fatal=!0)}}},E.redundantFailover=function(S){var L=this._levels[S],A=L.url.length;if(A>1){var D=(L.urlId+1)%A;this.warn("Switching to redundant URL-id "+D),this._levels.forEach(function(a){a.urlId=D}),this.level=S}},E.onFragLoaded=function(S,L){var A=L.frag;if(A!==void 0&&A.type===u.PlaylistLevelType.MAIN){var D=this._levels[A.level];D!==void 0&&(D.fragmentError=0,D.loadError=0)}},E.onLevelLoaded=function(S,L){var A,D=L.level,a=L.details,i=this._levels[D];if(!i){var t;this.warn("Invalid level index "+D),(t=L.deliveryDirectives)!==null&&t!==void 0&&t.skip&&(a.deltaUpdateFailed=!0);return}D===this.currentLevelIndex?(i.fragmentError===0&&(i.loadError=0,this.retryCount=0),this.playlistLoaded(D,L,i.details)):(A=L.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(a.deltaUpdateFailed=!0)},E.onAudioTrackSwitched=function(S,L){var A=this.hls.levels[this.currentLevelIndex];if(A&&A.audioGroupIds){for(var D=-1,a=this.hls.audioTracks[L.id].groupId,i=0;i<A.audioGroupIds.length;i++)if(A.audioGroupIds[i]===a){D=i;break}D!==A.urlId&&(A.urlId=D,this.startLoad())}},E.loadPlaylist=function(S){r.prototype.loadPlaylist.call(this);var L=this.currentLevelIndex,A=this._levels[L];if(this.canLoad&&A&&A.url.length>0){var D=A.urlId,a=A.url[D];if(S)try{a=S.addDirectives(a)}catch(i){this.warn("Could not construct new URL with HLS Delivery Directives: "+i)}this.log("Attempt loading level index "+L+((S==null?void 0:S.msn)!==void 0?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+D+" "+a),this.clearTimer(),this.hls.trigger(O.Events.LEVEL_LOADING,{url:a,level:L,id:D,deliveryDirectives:S||null})}},E.removeLevel=function(S,L){var A=function(i,t){return t!==L},D=this._levels.filter(function(a,i){return i!==S?!0:a.url.length>1&&L!==void 0?(a.url=a.url.filter(A),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(A)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(A)),a.urlId=0,!0):!1}).map(function(a,i){var t=a.details;return t!=null&&t.fragments&&t.fragments.forEach(function(h){h.level=i}),a});this._levels=D,this.hls.trigger(O.Events.LEVELS_UPDATED,{levels:D})},m(v,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var L,A=this._levels;if(A.length!==0&&!(this.currentLevelIndex===S&&(L=A[S])!==null&&L!==void 0&&L.details)){if(S<0||S>=A.length){var D=S<0;if(this.hls.trigger(O.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:D,reason:"invalid level idx"}),D)return;S=Math.min(S,A.length-1)}this.clearTimer();var a=this.currentLevelIndex,i=A[a],t=A[S];this.log("switching to level "+S+" from "+a),this.currentLevelIndex=S;var h=p({},t,{level:S,maxBitrate:t.maxBitrate,uri:t.uri,urlId:t.urlId});delete h._urlId,this.hls.trigger(O.Events.LEVEL_SWITCHING,h);var b=t.details;if(!b||b.live){var T=this.switchParams(t.uri,i==null?void 0:i.details);this.loadPlaylist(T)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),v}(w.default)},"./src/controller/level-helper.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{addGroupId:()=>I,addSliding:()=>s,adjustSliding:()=>o,assignTrackIdsByGroup:()=>w,computeReloadInterval:()=>n,getFragmentWithSN:()=>r,getPartWith:()=>v,mapFragmentIntersection:()=>_,mapPartIntersection:()=>g,mergeDetails:()=>m,updateFragPTSDTS:()=>c,updatePTS:()=>u});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/logger.ts"),B=C("./src/loader/date-range.ts");function e(){return e=Object.assign?Object.assign.bind():function(E){for(var f=1;f<arguments.length;f++){var S=arguments[f];for(var L in S)Object.prototype.hasOwnProperty.call(S,L)&&(E[L]=S[L])}return E},e.apply(this,arguments)}function I(E,f,S){switch(f){case"audio":E.audioGroupIds||(E.audioGroupIds=[]),E.audioGroupIds.push(S);break;case"text":E.textGroupIds||(E.textGroupIds=[]),E.textGroupIds.push(S);break}}function w(E){var f={};E.forEach(function(S){var L=S.groupId||"";S.id=f[L]=f[L]||0,f[L]++})}function u(E,f,S){var L=E[f],A=E[S];p(L,A)}function p(E,f){var S=f.startPTS;if((0,k.isFiniteNumber)(S)){var L=0,A;f.sn>E.sn?(L=S-E.start,A=E):(L=E.start-S,A=f),A.duration!==L&&(A.duration=L)}else if(f.sn>E.sn){var D=E.cc===f.cc;D&&E.minEndPTS?f.start=E.start+(E.minEndPTS-E.start):f.start=E.start+E.duration}else f.start=Math.max(E.start-f.duration,0)}function c(E,f,S,L,A,D){var a=L-S;a<=0&&(O.logger.warn("Fragment should have a positive duration",f),L=S+f.duration,D=A+f.duration);var i=S,t=L,h=f.startPTS,b=f.endPTS;if((0,k.isFiniteNumber)(h)){var T=Math.abs(h-S);(0,k.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(T,f.deltaPTS):f.deltaPTS=T,i=Math.max(S,h),S=Math.min(S,h),A=Math.min(A,f.startDTS),t=Math.min(L,b),L=Math.max(L,b),D=Math.max(D,f.endDTS)}f.duration=L-S;var y=S-f.start;f.start=f.startPTS=S,f.maxStartPTS=i,f.startDTS=A,f.endPTS=L,f.minEndPTS=t,f.endDTS=D;var d=f.sn;if(!E||d<E.startSN||d>E.endSN)return 0;var R,M=d-E.startSN,F=E.fragments;for(F[M]=f,R=M;R>0;R--)p(F[R],F[R-1]);for(R=M;R<F.length-1;R++)p(F[R],F[R+1]);return E.fragmentHint&&p(F[F.length-1],E.fragmentHint),E.PTSKnown=E.alignedSliding=!0,y}function m(E,f){for(var S=null,L=E.fragments,A=L.length-1;A>=0;A--){var D=L[A].initSegment;if(D){S=D;break}}E.fragmentHint&&delete E.fragmentHint.endPTS;var a=0,i;if(_(E,f,function(R,M){R.relurl&&(a=R.cc-M.cc),(0,k.isFiniteNumber)(R.startPTS)&&(0,k.isFiniteNumber)(R.endPTS)&&(M.start=M.startPTS=R.startPTS,M.startDTS=R.startDTS,M.appendedPTS=R.appendedPTS,M.maxStartPTS=R.maxStartPTS,M.endPTS=R.endPTS,M.endDTS=R.endDTS,M.minEndPTS=R.minEndPTS,M.duration=R.endPTS-R.startPTS,M.duration&&(i=M),f.PTSKnown=f.alignedSliding=!0),M.elementaryStreams=R.elementaryStreams,M.loader=R.loader,M.stats=R.stats,M.urlId=R.urlId,R.initSegment&&(M.initSegment=R.initSegment,S=R.initSegment)}),S){var t=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;t.forEach(function(R){var M;(!R.initSegment||R.initSegment.relurl===((M=S)===null||M===void 0?void 0:M.relurl))&&(R.initSegment=S)})}if(f.skippedSegments)if(f.deltaUpdateFailed=f.fragments.some(function(R){return!R}),f.deltaUpdateFailed){O.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=f.skippedSegments;h--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}else f.canSkipDateRanges&&(f.dateRanges=l(E.dateRanges,f.dateRanges,f.recentlyRemovedDateranges));var b=f.fragments;if(a){O.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<b.length;T++)b[T].cc+=a}f.skippedSegments&&(f.startCC=f.fragments[0].cc),g(E.partList,f.partList,function(R,M){M.elementaryStreams=R.elementaryStreams,M.stats=R.stats}),i?c(f,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):o(E,f),b.length&&(f.totalduration=f.edge-b[0].start),f.driftStartTime=E.driftStartTime,f.driftStart=E.driftStart;var y=f.advancedDateTime;if(f.advanced&&y){var d=f.edge;f.driftStart||(f.driftStartTime=y,f.driftStart=d),f.driftEndTime=y,f.driftEnd=d}else f.driftEndTime=E.driftEndTime,f.driftEnd=E.driftEnd,f.advancedDateTime=E.advancedDateTime}function l(E,f,S){var L=e({},E);return S&&S.forEach(function(A){delete L[A]}),Object.keys(f).forEach(function(A){var D=new B.DateRange(f[A].attr,L[A]);D.isValid?L[A]=D:O.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(f[A].attr)+'"')}),L}function g(E,f,S){if(E&&f)for(var L=0,A=0,D=E.length;A<=D;A++){var a=E[A],i=f[A+L];a&&i&&a.index===i.index&&a.fragment.sn===i.fragment.sn?S(a,i):L--}}function _(E,f,S){for(var L=f.skippedSegments,A=Math.max(E.startSN,f.startSN)-f.startSN,D=(E.fragmentHint?1:0)+(L?f.endSN:Math.min(E.endSN,f.endSN))-f.startSN,a=f.startSN-E.startSN,i=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,t=E.fragmentHint?E.fragments.concat(E.fragmentHint):E.fragments,h=A;h<=D;h++){var b=t[a+h],T=i[h];L&&!T&&h<L&&(T=f.fragments[h]=b),b&&T&&S(b,T)}}function o(E,f){var S=f.startSN+f.skippedSegments-E.startSN,L=E.fragments;S<0||S>=L.length||s(f,L[S].start)}function s(E,f){if(f){for(var S=E.fragments,L=E.skippedSegments;L<S.length;L++)S[L].start+=f;E.fragmentHint&&(E.fragmentHint.start+=f)}}function n(E,f){f===void 0&&(f=1/0);var S=1e3*E.targetduration;if(E.updated){var L=E.fragments,A=4;if(L.length&&S*A>f){var D=L[L.length-1].duration*1e3;D<S&&(S=D)}}else S/=2;return Math.round(S)}function r(E,f,S){if(!E||!E.details)return null;var L=E.details,A=L.fragments[f-L.startSN];return A||(A=L.fragmentHint,A&&A.sn===f)?A:f<L.startSN&&S&&S.sn===f?S:null}function v(E,f,S){if(!E||!E.details)return null;var L=E.details.partList;if(L)for(var A=L.length;A--;){var D=L[A];if(D.index===S&&D.fragment.sn===f)return D}return null}},"./src/controller/stream-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>f});var k=C("./src/polyfills/number.ts"),O=C("./src/controller/base-stream-controller.ts"),B=C("./src/is-supported.ts"),e=C("./src/events.ts"),I=C("./src/utils/buffer-helper.ts"),w=C("./src/controller/fragment-tracker.ts"),u=C("./src/types/loader.ts"),p=C("./src/loader/fragment.ts"),c=C("./src/demux/transmuxer-interface.ts"),m=C("./src/types/transmuxer.ts"),l=C("./src/controller/gap-controller.ts"),g=C("./src/errors.ts");function _(S,L){for(var A=0;A<L.length;A++){var D=L[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(S,s(D.key),D)}}function o(S,L,A){return L&&_(S.prototype,L),A&&_(S,A),Object.defineProperty(S,"prototype",{writable:!1}),S}function s(S){var L=n(S,"string");return typeof L=="symbol"?L:String(L)}function n(S,L){if(typeof S!="object"||S===null)return S;var A=S[Symbol.toPrimitive];if(A!==void 0){var D=A.call(S,L||"default");if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(L==="string"?String:Number)(S)}function r(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,v(S,L)}function v(S,L){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,a){return D.__proto__=a,D},v(S,L)}var E=100,f=function(S){r(L,S);function L(D,a,i){var t;return t=S.call(this,D,a,i,"[stream-controller]")||this,t.audioCodecSwap=!1,t.gapController=null,t.level=-1,t._forceStartLoad=!1,t.altAudio=!1,t.audioOnly=!1,t.fragPlaying=null,t.onvplaying=null,t.onvseeked=null,t.fragLastKbps=0,t.couldBacktrack=!1,t.backtrackFragment=null,t.audioCodecSwitch=!1,t.videoBuffer=null,t._registerListeners(),t}var A=L.prototype;return A._registerListeners=function(){var a=this.hls;a.on(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(e.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(e.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.on(e.Events.ERROR,this.onError,this),a.on(e.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.on(e.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(e.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(e.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.on(e.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var a=this.hls;a.off(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(e.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.off(e.Events.ERROR,this.onError,this),a.off(e.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.off(e.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(e.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(e.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.off(e.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(a){if(this.levels){var i=this.lastCurrentTime,t=this.hls;if(this.stopLoad(),this.setInterval(E),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var h=t.startLevel;h===-1&&(t.config.testBandwidth&&this.levels.length>1?(h=0,this.bitrateTest=!0):h=t.nextAutoLevel),this.level=t.nextLoadLevel=h,this.loadedmetadata=!1}i>0&&a===-1&&(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),a=i),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()}else this._forceStartLoad=!0,this.state=O.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_LEVEL:{var a,i=this.levels,t=this.level,h=i==null||(a=i[t])===null||a===void 0?void 0:a.details;if(h&&(!h.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(h))break;this.state=O.State.IDLE;break}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var b,T=self.performance.now(),y=this.retryDate;(!y||T>=y||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=O.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var a=this.hls,i=this.levelLastLoaded,t=this.levels,h=this.media,b=a.config,T=a.nextLoadLevel;if(!(i===null||!h&&(this.startFragRequested||!b.startFragPrefetch))&&!(this.altAudio&&this.audioOnly)&&!(!t||!t[T])){var y=t[T],d=this.getMainFwdBufferInfo();if(d!==null){var R=this.getLevelDetails();if(R&&this._streamEnded(d,R)){var M={};this.altAudio&&(M.type="video"),this.hls.trigger(e.Events.BUFFER_EOS,M),this.state=O.State.ENDED;return}this.level=a.nextLoadLevel=T;var F=y.details;if(!F||this.state===O.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==T){this.level=T,this.state=O.State.WAITING_LEVEL;return}var U=d.len,V=this.getMaxBufferLength(y.maxBitrate);if(!(U>=V)){this.backtrackFragment&&this.backtrackFragment.start>d.end&&(this.backtrackFragment=null);var re=this.backtrackFragment?this.backtrackFragment.start:d.end,$=this.getNextFragment(re,F);if(this.couldBacktrack&&!this.fragPrevious&&$&&$.sn!=="initSegment"&&this.fragmentTracker.getState($)!==w.FragmentState.OK){var le,te=((le=this.backtrackFragment)!=null?le:$).sn,_e=te-F.startSN,fe=F.fragments[_e-1];fe&&$.cc===fe.cc&&($=fe,this.fragmentTracker.removeFragment(fe))}else this.backtrackFragment&&d.len&&(this.backtrackFragment=null);if($&&this.fragmentTracker.getState($)===w.FragmentState.OK&&this.nextLoadPosition>re){var me=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO,Ae=(me===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Ae&&this.afterBufferFlushed(Ae,me,u.PlaylistLevelType.MAIN),$=this.getNextFragment(this.nextLoadPosition,F)}$&&($.initSegment&&!$.initSegment.data&&!this.bitrateTest&&($=$.initSegment),this.loadFragment($,F,re))}}}},A.loadFragment=function(a,i,t){var h,b=this.fragmentTracker.getState(a);this.fragCurrent=a,b===w.FragmentState.NOT_LOADED?a.sn==="initSegment"?this._loadInitSegment(a,i):this.bitrateTest?(this.log("Fragment "+a.sn+" of level "+a.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(a,i)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,a,i,t)):b===w.FragmentState.APPENDING?this.reduceMaxBufferLength(a.duration)&&this.fragmentTracker.removeFragment(a):((h=this.media)===null||h===void 0?void 0:h.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(a){var i=this.fragmentTracker.getAppendedFrag(a,u.PlaylistLevelType.MAIN);return i&&"fragment"in i?i.fragment:i},A.getBufferedFrag=function(a){return this.fragmentTracker.getBufferedFrag(a,u.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(a){return a?this.getBufferedFrag(a.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var a=this.levels,i=this.media;if(i!=null&&i.readyState){var t,h=this.getAppendedFrag(i.currentTime);if(h&&h.start>1&&this.flushMainBuffer(0,h.start-1),!i.paused&&a){var b=this.hls.nextLoadLevel,T=a[b],y=this.fragLastKbps;y&&this.fragCurrent?t=this.fragCurrent.duration*T.maxBitrate/(1e3*y)+1:t=0}else t=0;var d=this.getBufferedFrag(i.currentTime+t);if(d){var R=this.followingBufferedFrag(d);if(R){this.abortCurrentFrag();var M=R.maxStartPTS?R.maxStartPTS:R.start,F=R.duration,U=Math.max(d.end,M+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(U,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var a=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,a&&a.abortRequests(),this.state){case O.State.KEY_LOADING:case O.State.FRAG_LOADING:case O.State.FRAG_LOADING_WAITING_RETRY:case O.State.PARSING:case O.State.PARSED:this.state=O.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(a,i){S.prototype.flushMainBuffer.call(this,a,i,this.altAudio?"video":null)},A.onMediaAttached=function(a,i){S.prototype.onMediaAttached.call(this,a,i);var t=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),t.addEventListener("playing",this.onvplaying),t.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,t,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var a=this.media;a&&this.onvplaying&&this.onvseeked&&(a.removeEventListener("playing",this.onvplaying),a.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var a=this.media,i=a?a.currentTime:null;(0,k.isFiniteNumber)(i)&&this.log("Media seeked to "+i.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(e.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},A.onManifestParsed=function(a,i){var t=!1,h=!1,b;i.levels.forEach(function(T){b=T.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(t=!0),b.indexOf("mp4a.40.5")!==-1&&(h=!0))}),this.audioCodecSwitch=t&&h&&!(0,B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=i.levels,this.startFragRequested=!1},A.onLevelLoading=function(a,i){var t=this.levels;if(!(!t||this.state!==O.State.IDLE)){var h=t[i.level];(!h.details||h.details.live&&this.levelLastLoaded!==i.level||this.waitForCdnTuneIn(h.details))&&(this.state=O.State.WAITING_LEVEL)}},A.onLevelLoaded=function(a,i){var t,h=this.levels,b=i.level,T=i.details,y=T.totalduration;if(!h){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+y);var d=this.fragCurrent;d&&(this.state===O.State.FRAG_LOADING||this.state===O.State.FRAG_LOADING_WAITING_RETRY)&&d.level!==i.level&&d.loader&&(this.state=O.State.IDLE,this.backtrackFragment=null,d.abortRequests());var R=h[b],M=0;if(T.live||(t=R.details)!==null&&t!==void 0&&t.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;M=this.alignPlaylists(T,R.details)}if(R.details=T,this.levelLastLoaded=b,this.hls.trigger(e.Events.LEVEL_UPDATED,{details:T,level:b}),this.state===O.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=O.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,M),this.tick()},A._handleFragmentLoadProgress=function(a){var i,t=a.frag,h=a.part,b=a.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+t.sn+" of level "+t.level+" will not be buffered");return}var y=T[t.level],d=y.details;if(!d){this.warn("Dropping fragment "+t.sn+" of level "+t.level+" after level details were reset");return}var R=y.videoCodec,M=d.PTSKnown||!d.live,F=(i=t.initSegment)===null||i===void 0?void 0:i.data,U=this._getAudioCodec(y),V=this.transmuxer=this.transmuxer||new c.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),re=h?h.index:-1,$=re!==-1,le=new m.ChunkMetadata(t.level,t.sn,t.stats.chunkCount,b.byteLength,re,$),te=this.initPTS[t.cc];V.push(b,F,U,R,t,h,d.totalduration,M,le,te)},A.onAudioTrackSwitching=function(a,i){var t=this.altAudio,h=!!i.url,b=i.id;if(!h){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T&&(this.log("Switching to main audio track, cancel main fragment load"),T.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var y=this.hls;t&&y.trigger(e.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),y.trigger(e.Events.AUDIO_TRACK_SWITCHED,{id:b})}},A.onAudioTrackSwitched=function(a,i){var t=i.id,h=!!this.hls.audioTracks[t].url;if(h){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=h,this.tick()},A.onBufferCreated=function(a,i){var t=i.tracks,h,b,T=!1;for(var y in t){var d=t[y];if(d.id==="main"){if(b=y,h=d,y==="video"){var R=t[y];R&&(this.videoBuffer=R.buffer)}}else T=!0}T&&h?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=h.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(a,i){var t=i.frag,h=i.part;if(!(t&&t.type!==u.PlaylistLevelType.MAIN)){if(this.fragContextChanged(t)){this.warn("Fragment "+t.sn+(h?" p: "+h.index:"")+" of level "+t.level+" finished buffering, but was aborted. state: "+this.state),this.state===O.State.PARSED&&(this.state=O.State.IDLE);return}var b=h?h.stats:t.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),t.sn!=="initSegment"&&(this.fragPrevious=t),this.fragBufferedComplete(t,h)}},A.onError=function(a,i){if(i.type===g.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,i);return}switch(i.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:case g.ErrorDetails.FRAG_PARSING_ERROR:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,i);break;case g.ErrorDetails.LEVEL_LOAD_ERROR:case g.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(i.fatal?(this.warn(""+i.details),this.state=O.State.ERROR):!i.levelRetry&&this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE));break;case g.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="main"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var t=!0,h=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);h&&h.len>.5&&(t=!this.reduceMaxBufferLength(h.len)),t&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var a=this.media,i=this.gapController;if(!(!a||!i||!a.readyState)){if(this.loadedmetadata||!I.BufferHelper.getBuffered(a).length){var t=this.state!==O.State.IDLE?this.fragCurrent:null;i.poll(this.lastCurrentTime,t)}this.lastCurrentTime=a.currentTime}},A.onFragLoadEmergencyAborted=function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(a,i){var t=i.type;if(t!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var h=(t===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(h,t,u.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(a,i){this.levels=i.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var a=this.media;if(a){var i=a.currentTime,t=this.startPosition;if(t>=0&&i<t){if(a.seeking){this.log("could not seek to "+t+", already seeking at "+i);return}var h=I.BufferHelper.getBuffered(a),b=h.length?h.start(0):0,T=b-t;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+T+" to match buffer start"),t+=T,this.startPosition=t),this.log("seek to target start position "+t+" from current time "+i),a.currentTime=t}}},A._getAudioCodec=function(a){var i=this.config.defaultAudioCodec||a.audioCodec;return this.audioCodecSwap&&i&&(this.log("Swapping audio codec"),i.indexOf("mp4a.40.5")!==-1?i="mp4a.40.2":i="mp4a.40.5"),i},A._loadBitrateTestFrag=function(a,i){var t=this;a.bitrateTest=!0,this._doFragLoad(a,i).then(function(h){var b=t.hls;if(!(!h||t.fragContextChanged(a))){t.fragLoadError=0,t.state=O.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var T=a.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),b.trigger(e.Events.FRAG_LOADED,h),a.bitrateTest=!1}})},A._handleTransmuxComplete=function(a){var i,t="main",h=this.hls,b=a.remuxResult,T=a.chunkMeta,y=this.getCurrentContext(T);if(!y){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(T.level);return}var d=y.frag,R=y.part,M=y.level,F=b.video,U=b.text,V=b.id3,re=b.initSegment,$=M.details,le=this.altAudio?void 0:b.audio;if(!this.fragContextChanged(d)){if(this.state=O.State.PARSING,re){re.tracks&&(this._bufferInitSegment(M,re.tracks,d,T),h.trigger(e.Events.FRAG_PARSING_INIT_SEGMENT,{frag:d,id:t,tracks:re.tracks}));var te=re.initPTS,_e=re.timescale;(0,k.isFiniteNumber)(te)&&(this.initPTS[d.cc]=te,h.trigger(e.Events.INIT_PTS_FOUND,{frag:d,id:t,initPTS:te,timescale:_e}))}if(F&&b.independent!==!1){if($){var fe=F.startPTS,me=F.endPTS,Ae=F.startDTS,Be=F.endDTS;if(R)R.elementaryStreams[F.type]={startPTS:fe,endPTS:me,startDTS:Ae,endDTS:Be};else if(F.firstKeyFrame&&F.independent&&T.id===1&&(this.couldBacktrack=!0),F.dropped&&F.independent){var Le=this.getMainFwdBufferInfo(),Ie=(Le?Le.end:this.getLoadPosition())+this.config.maxBufferHole,pe=F.firstKeyFramePTS?F.firstKeyFramePTS:fe;if(Ie<pe-this.config.maxBufferHole){this.backtrack(d);return}d.setElementaryStreamInfo(F.type,d.start,me,d.start,Be,!0)}d.setElementaryStreamInfo(F.type,fe,me,Ae,Be),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(F,d,R,T)}}else if(b.independent===!1){this.backtrack(d);return}if(le){var Ke=le.startPTS,Ce=le.endPTS,ie=le.startDTS,X=le.endDTS;R&&(R.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:Ke,endPTS:Ce,startDTS:ie,endDTS:X}),d.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,Ke,Ce,ie,X),this.bufferFragmentData(le,d,R,T)}if($&&V!==null&&V!==void 0&&(i=V.samples)!==null&&i!==void 0&&i.length){var q={id:t,frag:d,details:$,samples:V.samples};h.trigger(e.Events.FRAG_PARSING_METADATA,q)}if($&&U){var ue={id:t,frag:d,details:$,samples:U.samples};h.trigger(e.Events.FRAG_PARSING_USERDATA,ue)}}},A._bufferInitSegment=function(a,i,t,h){var b=this;if(this.state===O.State.PARSING){this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&delete i.audio;var T=i.audio,y=i.video,d=i.audiovideo;if(T){var R=a.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),T.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(R="mp4a.40.5")),M.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),a.audioCodec&&a.audioCodec!==R&&this.log('Swapping manifest audio codec "'+a.audioCodec+'" for "'+R+'"'),T.levelCodec=R,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(a.audioCodec||"")+"/"+T.codec+"]")}y&&(y.levelCodec=a.videoCodec,y.id="main",this.log("Init video buffer, container:"+y.container+", codecs[level/parsed]=["+(a.videoCodec||"")+"/"+y.codec+"]")),d&&this.log("Init audiovideo buffer, container:"+d.container+", codecs[level/parsed]=["+(a.attrs.CODECS||"")+"/"+d.codec+"]"),this.hls.trigger(e.Events.BUFFER_CODECS,i),Object.keys(i).forEach(function(F){var U=i[F],V=U.initSegment;V!=null&&V.byteLength&&b.hls.trigger(e.Events.BUFFER_APPENDING,{type:F,data:V,frag:t,part:null,chunkMeta:h,parent:t.type})}),this.tick()}},A.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.MAIN)},A.backtrack=function(a){this.couldBacktrack=!0,this.backtrackFragment=a,this.resetTransmuxer(),this.flushBufferGap(a),this.fragmentTracker.removeFragment(a),this.fragPrevious=null,this.nextLoadPosition=a.start,this.state=O.State.IDLE},A.checkFragmentChanged=function(){var a=this.media,i=null;if(a&&a.readyState>1&&a.seeking===!1){var t=a.currentTime;if(I.BufferHelper.isBuffered(a,t)?i=this.getAppendedFrag(t):I.BufferHelper.isBuffered(a,t+.1)&&(i=this.getAppendedFrag(t+.1)),i){this.backtrackFragment=null;var h=this.fragPlaying,b=i.level;(!h||i.sn!==h.sn||h.level!==b||i.urlId!==h.urlId)&&(this.fragPlaying=i,this.hls.trigger(e.Events.FRAG_CHANGED,{frag:i}),(!h||h.level!==b)&&this.hls.trigger(e.Events.LEVEL_SWITCHED,{level:b}))}}},o(L,[{key:"nextLevel",get:function(){var a=this.nextBufferedFrag;return a?a.level:-1}},{key:"currentFrag",get:function(){var a=this.media;return a?this.fragPlaying||this.getAppendedFrag(a.currentTime):null}},{key:"currentProgramDateTime",get:function(){var a=this.media;if(a){var i=a.currentTime,t=this.currentFrag;if(t&&(0,k.isFiniteNumber)(i)&&(0,k.isFiniteNumber)(t.programDateTime)){var h=t.programDateTime+(i-t.start)*1e3;return new Date(h)}}return null}},{key:"currentLevel",get:function(){var a=this.currentFrag;return a?a.level:-1}},{key:"nextBufferedFrag",get:function(){var a=this.currentFrag;return a?this.followingBufferedFrag(a):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(O.default)},"./src/controller/subtitle-stream-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{SubtitleStreamController:()=>r});var k=C("./src/events.ts"),O=C("./src/utils/buffer-helper.ts"),B=C("./src/controller/fragment-finders.ts"),e=C("./src/utils/discontinuities.ts"),I=C("./src/controller/level-helper.ts"),w=C("./src/controller/fragment-tracker.ts"),u=C("./src/controller/base-stream-controller.ts"),p=C("./src/types/loader.ts"),c=C("./src/types/level.ts");function m(E,f){for(var S=0;S<f.length;S++){var L=f[S];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,g(L.key),L)}}function l(E,f,S){return f&&m(E.prototype,f),S&&m(E,S),Object.defineProperty(E,"prototype",{writable:!1}),E}function g(E){var f=_(E,"string");return typeof f=="symbol"?f:String(f)}function _(E,f){if(typeof E!="object"||E===null)return E;var S=E[Symbol.toPrimitive];if(S!==void 0){var L=S.call(E,f||"default");if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(E)}function o(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,s(E,f)}function s(E,f){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,A){return L.__proto__=A,L},s(E,f)}var n=500,r=function(E){o(f,E);function f(L,A,D){var a;return a=E.call(this,L,A,D,"[subtitle-stream-controller]")||this,a.levels=[],a.currentTrackId=-1,a.tracksBuffered=[],a.mainDetails=null,a._registerListeners(),a}var S=f.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var A=this.hls;A.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(k.Events.ERROR,this.onError,this),A.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),A.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var A=this.hls;A.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(k.Events.ERROR,this.onError,this),A.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),A.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.startLoad=function(A){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(n),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=A,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(A,D){this.mainDetails=D.details},S.onSubtitleFragProcessed=function(A,D){var a=D.frag,i=D.success;if(this.fragPrevious=a,this.state=u.State.IDLE,!!i){var t=this.tracksBuffered[this.currentTrackId];if(t){for(var h,b=a.start,T=0;T<t.length;T++)if(b>=t[T].start&&b<=t[T].end){h=t[T];break}var y=a.start+a.duration;h?h.end=y:(h={start:b,end:y},t.push(h)),this.fragmentTracker.fragBuffered(a)}}},S.onBufferFlushing=function(A,D){var a=D.startOffset,i=D.endOffset;if(a===0&&i!==Number.POSITIVE_INFINITY){var t=this.currentTrackId,h=this.levels;if(!h.length||!h[t]||!h[t].details)return;var b=h[t].details,T=b.targetduration,y=i-T;if(y<=0)return;D.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(d){for(var R=0;R<d.length;){if(d[R].end<=y){d.shift();continue}else if(d[R].start<y)d[R].start=y;else break;R++}}),this.fragmentTracker.removeFragmentsInRange(a,y,p.PlaylistLevelType.SUBTITLE)}},S.onFragBuffered=function(A,D){if(!this.loadedmetadata&&D.frag.type===p.PlaylistLevelType.MAIN){var a;(a=this.media)!==null&&a!==void 0&&a.buffered.length&&(this.loadedmetadata=!0)}},S.onError=function(A,D){var a=D.frag;!a||a.type!==p.PlaylistLevelType.SUBTITLE||(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=u.State.IDLE)},S.onSubtitleTracksUpdated=function(A,D){var a=this,i=D.subtitleTracks;this.tracksBuffered=[],this.levels=i.map(function(t){return new c.Level(t)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(t){a.tracksBuffered[t.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(A,D){if(this.currentTrackId=D.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.levels[this.currentTrackId];a!=null&&a.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,a&&this.setInterval(n)},S.onSubtitleTrackLoaded=function(A,D){var a,i=D.details,t=D.id,h=this.currentTrackId,b=this.levels;if(b.length){var T=b[h];if(!(t>=b.length||t!==h||!T)){this.mediaBuffer=this.mediaBufferTimeRanges;var y=0;if(i.live||(a=T.details)!==null&&a!==void 0&&a.live){var d=this.mainDetails;if(i.deltaUpdateFailed||!d)return;var R=d.fragments[0];T.details?(y=this.alignPlaylists(i,T.details),y===0&&R&&(y=R.start,(0,I.addSliding)(i,y))):i.hasProgramDateTime&&d.hasProgramDateTime?((0,e.alignMediaPlaylistByPDT)(i,d),y=i.fragments[0].start):R&&(y=R.start,(0,I.addSliding)(i,y))}if(T.details=i,this.levelLastLoaded=t,!this.startFragRequested&&(this.mainDetails||!i.live)&&this.setStartPosition(T.details,y),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE){var M=(0,B.findFragmentByPTS)(null,i.fragments,this.media.currentTime,0);M||(this.warn("Subtitle playlist not aligned with playback"),T.details=void 0)}}}},S._handleFragmentLoadComplete=function(A){var D=this,a=A.frag,i=A.payload,t=a.decryptdata,h=this.hls;if(!this.fragContextChanged(a)&&i&&i.byteLength>0&&t&&t.key&&t.iv&&t.method==="AES-128"){var b=performance.now();this.decrypter.decrypt(new Uint8Array(i),t.key.buffer,t.iv.buffer).then(function(T){var y=performance.now();h.trigger(k.Events.FRAG_DECRYPTED,{frag:a,payload:T,stats:{tstart:b,tdecrypt:y}})}).catch(function(T){D.warn(T.name+": "+T.message),D.state=u.State.IDLE})}},S.doTick=function(){if(!this.media){this.state=u.State.IDLE;return}if(this.state===u.State.IDLE){var A=this.currentTrackId,D=this.levels;if(!D.length||!D[A]||!D[A].details)return;var a=D[A].details,i=a.targetduration,t=this.config,h=this.getLoadPosition(),b=O.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],h-i,t.maxBufferHole),T=b.end,y=b.len,d=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN),R=this.getMaxBufferLength(d==null?void 0:d.len)+i;if(y>R)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var M=a.fragments,F=M.length,U=a.edge,V=null,re=this.fragPrevious;if(T<U){var $=t.maxFragLookUpTolerance;V=(0,B.findFragmentByPTS)(re,M,Math.max(M[0].start,T),$),!V&&re&&re.start<M[0].start&&(V=M[0])}else V=M[F-1];if(!V)return;V=this.mapToInitFragWhenRequired(V),this.fragmentTracker.getState(V)===w.FragmentState.NOT_LOADED&&this.loadFragment(V,a,T)}},S.getMaxBufferLength=function(A){var D=E.prototype.getMaxBufferLength.call(this);return A?Math.max(D,A):D},S.loadFragment=function(A,D,a){this.fragCurrent=A,A.sn==="initSegment"?this._loadInitSegment(A,D):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,A,D,a))},l(f,[{key:"mediaBufferTimeRanges",get:function(){return new v(this.tracksBuffered[this.currentTrackId]||[])}}]),f}(u.default),v=function(f){this.buffered=void 0;var S=function(A,D,a){if(D=D>>>0,D>a-1)throw new DOMException("Failed to execute '"+A+"' on 'TimeRanges': The index provided ("+D+") is greater than the maximum bound ("+a+")");return f[D][A]};this.buffered={get length(){return f.length},end:function(A){return S("end",A,f.length)},start:function(A){return S("start",A,f.length)}}}},"./src/controller/subtitle-track-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>_});var k=C("./src/events.ts"),O=C("./src/utils/texttrack-utils.ts"),B=C("./src/controller/base-playlist-controller.ts"),e=C("./src/types/loader.ts");function I(o,s){for(var n=0;n<s.length;n++){var r=s[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,u(r.key),r)}}function w(o,s,n){return s&&I(o.prototype,s),n&&I(o,n),Object.defineProperty(o,"prototype",{writable:!1}),o}function u(o){var s=p(o,"string");return typeof s=="symbol"?s:String(s)}function p(o,s){if(typeof o!="object"||o===null)return o;var n=o[Symbol.toPrimitive];if(n!==void 0){var r=n.call(o,s||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}function c(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,m(o,s)}function m(o,s){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,v){return r.__proto__=v,r},m(o,s)}var l=function(o){c(s,o);function s(r){var v;return v=o.call(this,r,"[subtitle-track-controller]")||this,v.media=null,v.tracks=[],v.groupId=null,v.tracksInGroup=[],v.trackId=-1,v.selectDefaultTrack=!0,v.queuedDefaultTrack=-1,v.trackChangeListener=function(){return v.onTextTracksChanged()},v.asyncPollTrackChange=function(){return v.pollTrackChange(0)},v.useTextTrackPolling=!1,v.subtitlePollingInterval=-1,v._subtitleDisplay=!0,v.registerListeners(),v}var n=s.prototype;return n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,o.prototype.destroy.call(this)},n.registerListeners=function(){var v=this.hls;v.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),v.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),v.on(k.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var v=this.hls;v.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),v.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),v.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),v.off(k.Events.ERROR,this.onError,this)},n.onMediaAttached=function(v,E){this.media=E.media,this.media&&(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))},n.pollTrackChange=function(v){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,v)},n.onMediaDetaching=function(){if(this.media){self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var v=g(this.media.textTracks);v.forEach(function(E){(0,O.clearCurrentCues)(E)}),this.subtitleTrack=-1,this.media=null}},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},n.onManifestParsed=function(v,E){this.tracks=E.subtitleTracks},n.onSubtitleTrackLoaded=function(v,E){var f=E.id,S=E.details,L=this.trackId,A=this.tracksInGroup[L];if(!A){this.warn("Invalid subtitle track id "+f);return}var D=A.details;A.details=E.details,this.log("subtitle track "+f+" loaded ["+S.startSN+"-"+S.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,E,D))},n.onLevelLoading=function(v,E){this.switchLevel(E.level)},n.onLevelSwitching=function(v,E){this.switchLevel(E.level)},n.switchLevel=function(v){var E=this.hls.levels[v];if(E!=null&&E.textGroupIds){var f=E.textGroupIds[E.urlId];if(this.groupId!==f){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,L=this.tracks.filter(function(a){return!f||a.groupId===f});this.tracksInGroup=L;var A=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=f;var D={subtitleTracks:L};this.log("Updating subtitle tracks, "+L.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,D),A!==-1&&this.setSubtitleTrack(A,S)}}},n.findTrackId=function(v){for(var E=this.tracksInGroup,f=0;f<E.length;f++){var S=E[f];if((!this.selectDefaultTrack||S.default)&&(!v||v===S.name))return S.id}return-1},n.onError=function(v,E){o.prototype.onError.call(this,v,E),!(E.fatal||!E.context)&&E.context.type===e.PlaylistContextType.SUBTITLE_TRACK&&E.context.id===this.trackId&&E.context.groupId===this.groupId&&this.retryLoadingOrFail(E)},n.loadPlaylist=function(v){o.prototype.loadPlaylist.call(this);var E=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(E)){var f=E.id,S=E.groupId,L=E.url;if(v)try{L=v.addDirectives(L)}catch(A){this.warn("Could not construct new URL with HLS Delivery Directives: "+A)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:L,id:f,groupId:S,deliveryDirectives:v||null})}},n.toggleTrackModes=function(v){var E=this,f=this.media,S=this.trackId;if(f){var L=g(f.textTracks),A=L.filter(function(i){return i.groupId===E.groupId});if(v===-1)[].slice.call(L).forEach(function(i){i.mode="disabled"});else{var D=A[S];D&&(D.mode="disabled")}var a=A[v];a&&(a.mode=this.subtitleDisplay?"showing":"hidden")}},n.setSubtitleTrack=function(v,E){var f,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=v;return}if(this.trackId!==v&&this.toggleTrackModes(v),!(this.trackId===v&&(v===-1||(f=S[v])!==null&&f!==void 0&&f.details)||v<-1||v>=S.length)){this.clearTimer();var L=S[v];if(this.log("Switching to subtitle track "+v),this.trackId=v,L){var A=L.id,D=L.groupId,a=D===void 0?"":D,i=L.name,t=L.type,h=L.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:A,groupId:a,name:i,type:t,url:h});var b=this.switchParams(L.url,E==null?void 0:E.details);this.loadPlaylist(b)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:v})}},n.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!(!this.media||!this.hls.config.renderTextTracksNatively)){for(var v=-1,E=g(this.media.textTracks),f=0;f<E.length;f++)if(E[f].mode==="hidden")v=f;else if(E[f].mode==="showing"){v=f;break}this.subtitleTrack!==v&&(this.subtitleTrack=v)}},w(s,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(v){this._subtitleDisplay=v,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(v){this.selectDefaultTrack=!1;var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(v,E)}}]),s}(B.default);function g(o){for(var s=[],n=0;n<o.length;n++){var r=o[n];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&s.push(o[n])}return s}const _=l},"./src/controller/timeline-controller.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{TimelineController:()=>l});var k=C("./src/polyfills/number.ts"),O=C("./src/events.ts"),B=C("./src/utils/cea-608-parser.ts"),e=C("./src/utils/output-filter.ts"),I=C("./src/utils/webvtt-parser.ts"),w=C("./src/utils/texttrack-utils.ts"),u=C("./src/utils/imsc1-ttml-parser.ts"),p=C("./src/utils/mp4-tools.ts"),c=C("./src/types/loader.ts"),m=C("./src/utils/logger.ts"),l=function(){function s(r){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.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 v=new e.default(this,"textTrack1"),E=new e.default(this,"textTrack2"),f=new e.default(this,"textTrack3"),S=new e.default(this,"textTrack4");this.cea608Parser1=new B.default(1,v,E),this.cea608Parser2=new B.default(3,f,S)}r.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(O.Events.FRAG_LOADING,this.onFragLoading,this),r.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=s.prototype;return n.destroy=function(){var v=this.hls;v.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),v.off(O.Events.FRAG_LOADING,this.onFragLoading,this),v.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),v.off(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),v.off(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),v.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),v.off(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),v.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(v,E,f,S,L){for(var A=!1,D=L.length;D--;){var a=L[D],i=_(a[0],a[1],E,f);if(i>=0&&(a[0]=Math.min(a[0],E),a[1]=Math.max(a[1],f),A=!0,i/(f-E)>.5))return}if(A||L.push([E,f]),this.config.renderTextTracksNatively){var t=this.captionsTracks[v];this.Cues.newCue(t,E,f,S)}else{var h=this.Cues.newCue(null,E,f,S);this.hls.trigger(O.Events.CUES_PARSED,{type:"captions",cues:h,track:v})}},n.onInitPtsFound=function(v,E){var f=this,S=E.frag,L=E.id,A=E.initPTS,D=E.timescale,a=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=A,this.timescale[S.cc]=D),a.length&&(this.unparsedVttFrags=[],a.forEach(function(i){f.onFragLoaded(O.Events.FRAG_LOADED,i)}))},n.getExistingTrack=function(v){var E=this.media;if(E)for(var f=0;f<E.textTracks.length;f++){var S=E.textTracks[f];if(S[v])return S}return null},n.createCaptionsTrack=function(v){this.config.renderTextTracksNatively?this.createNativeTrack(v):this.createNonNativeTrack(v)},n.createNativeTrack=function(v){if(!this.captionsTracks[v]){var E=this.captionsProperties,f=this.captionsTracks,S=this.media,L=E[v],A=L.label,D=L.languageCode,a=this.getExistingTrack(v);if(a)f[v]=a,(0,w.clearCurrentCues)(f[v]),(0,w.sendAddTrackEvent)(f[v],S);else{var i=this.createTextTrack("captions",A,D);i&&(i[v]=!0,f[v]=i)}}},n.createNonNativeTrack=function(v){if(!this.nonNativeCaptionsTracks[v]){var E=this.captionsProperties[v];if(E){var f=E.label,S={_id:v,label:f,kind:"captions",default:E.media?!!E.media.default:!1,closedCaptions:E.media};this.nonNativeCaptionsTracks[v]=S,this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})}}},n.createTextTrack=function(v,E,f){var S=this.media;if(S)return S.addTextTrack(v,E,f)},n.onMediaAttaching=function(v,E){this.media=E.media,this._cleanTracks()},n.onMediaDetaching=function(){var v=this.captionsTracks;Object.keys(v).forEach(function(E){(0,w.clearCurrentCues)(v[E]),delete v[E]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var v=this.media;if(v){var E=v.textTracks;if(E)for(var f=0;f<E.length;f++)(0,w.clearCurrentCues)(E[f])}},n.onSubtitleTracksUpdated=function(v,E){var f=this;this.textTracks=[];var S=E.subtitleTracks||[],L=S.some(function(i){return i.textCodec===u.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var A=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var D=this.media?this.media.textTracks:[];this.tracks.forEach(function(i,t){var h;if(t<D.length){for(var b=null,T=0;T<D.length;T++)if(g(D[T],i)){b=D[T];break}b&&(h=b)}if(h)(0,w.clearCurrentCues)(h);else{var y=f._captionsOrSubtitlesFromCharacteristics(i);h=f.createTextTrack(y,i.name,i.lang),h&&(h.mode="disabled")}h&&(h.groupId=i.groupId,f.textTracks.push(h))})}else if(!A&&this.tracks&&this.tracks.length){var a=this.tracks.map(function(i){return{label:i.name,kind:i.type.toLowerCase(),default:i.default,subtitleTrack:i}});this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}},n._captionsOrSubtitlesFromCharacteristics=function(v){var E;if((E=v.attrs)!==null&&E!==void 0&&E.CHARACTERISTICS){var f=/transcribes-spoken-dialog/gi.test(v.attrs.CHARACTERISTICS),S=/describes-music-and-sound/gi.test(v.attrs.CHARACTERISTICS);if(f&&S)return"captions"}return"subtitles"},n.onManifestLoaded=function(v,E){var f=this;this.config.enableCEA708Captions&&E.captions&&E.captions.forEach(function(S){var L=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(L){var A="textTrack"+L[1],D=f.captionsProperties[A];D&&(D.label=S.name,S.lang&&(D.languageCode=S.lang),D.media=S)}})},n.closedCaptionsForLevel=function(v){var E=this.hls.levels[v.level];return E==null?void 0:E.attrs["CLOSED-CAPTIONS"]},n.onFragLoading=function(v,E){var f=this.cea608Parser1,S=this.cea608Parser2,L=this.lastSn,A=this.lastPartIndex;if(!(!this.enabled||!(f&&S))&&E.frag.type===c.PlaylistLevelType.MAIN){var D,a,i=E.frag.sn,t=(D=E==null||(a=E.part)===null||a===void 0?void 0:a.index)!=null?D:-1;i===L+1||i===L&&t===A+1||(f.reset(),S.reset()),this.lastSn=i,this.lastPartIndex=t}},n.onFragLoaded=function(v,E){var f=E.frag,S=E.payload,L=this.initPTS,A=this.unparsedVttFrags;if(f.type===c.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!(0,k.isFiniteNumber)(L[f.cc])){A.push(E),L.length&&this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var D=f.decryptdata,a="stats"in E;if(D==null||!D.encrypted||a){var i=this.tracks[f.level],t=this.vttCCs;t[f.cc]||(t[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),i&&i.textCodec===u.IMSC1_CODEC?this._parseIMSC1(f,S):this._parseVTTs(f,S,t)}}else this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(v,E){var f=this,S=this.hls;(0,u.parseIMSC1)(E,this.initPTS[v.cc],this.timescale[v.cc],function(L){f._appendCues(L,v.level),S.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:v})},function(L){m.logger.log("Failed to parse IMSC1: "+L),S.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:L})})},n._parseVTTs=function(v,E,f){var S,L=this,A=this.hls,D=(S=v.initSegment)!==null&&S!==void 0&&S.data?(0,p.appendUint8Array)(v.initSegment.data,new Uint8Array(E)):E;(0,I.parseWebVTT)(D,this.initPTS[v.cc],this.timescale[v.cc],f,v.cc,v.start,function(a){L._appendCues(a,v.level),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:v})},function(a){L._fallbackToIMSC1(v,E),m.logger.log("Failed to parse VTT cue: "+a),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:a})})},n._fallbackToIMSC1=function(v,E){var f=this,S=this.tracks[v.level];S.textCodec||(0,u.parseIMSC1)(E,this.initPTS[v.cc],this.timescale[v.cc],function(){S.textCodec=u.IMSC1_CODEC,f._parseIMSC1(v,E)},function(){S.textCodec="wvtt"})},n._appendCues=function(v,E){var f=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[E];if(!S||S.mode==="disabled")return;v.forEach(function(D){return(0,w.addCueToTrack)(S,D)})}else{var L=this.tracks[E];if(!L)return;var A=L.default?"default":"subtitles"+E;f.trigger(O.Events.CUES_PARSED,{type:"subtitles",cues:v,track:A})}},n.onFragDecrypted=function(v,E){var f=E.frag;if(f.type===c.PlaylistLevelType.SUBTITLE){if(!(0,k.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(E);return}this.onFragLoaded(O.Events.FRAG_LOADED,E)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(v,E){var f=this.cea608Parser1,S=this.cea608Parser2;if(!(!this.enabled||!(f&&S))){var L=E.frag,A=E.samples;if(!(L.type===c.PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(L)==="NONE"))for(var D=0;D<A.length;D++){var a=A[D].bytes;if(a){var i=this.extractCea608Data(a);f.addData(A[D].pts,i[0]),S.addData(A[D].pts,i[1])}}}},n.onBufferFlushing=function(v,E){var f=E.startOffset,S=E.endOffset,L=E.endOffsetSubtitles,A=E.type,D=this.media;if(!(!D||D.currentTime<S)){if(!A||A==="video"){var a=this.captionsTracks;Object.keys(a).forEach(function(t){return(0,w.removeCuesInRange)(a[t],f,S)})}if(this.config.renderTextTracksNatively&&f===0&&L!==void 0){var i=this.textTracks;Object.keys(i).forEach(function(t){return(0,w.removeCuesInRange)(i[t],f,L)})}}},n.extractCea608Data=function(v){for(var E=[[],[]],f=v[0]&31,S=2,L=0;L<f;L++){var A=v[S++],D=127&v[S++],a=127&v[S++];if(!(D===0&&a===0)){var i=(4&A)!==0;if(i){var t=3&A;(t===0||t===1)&&(E[t].push(D),E[t].push(a))}}}return E},s}();function g(s,n){return s&&s.label===n.name&&!(s.textTrack1||s.textTrack2)}function _(s,n,r,v){return Math.min(n,v)-Math.max(s,r)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},"./src/crypt/aes-crypto.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});var k=function(){function O(e,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=I}var B=O.prototype;return B.decrypt=function(I,w){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},w,I)},O}()},"./src/crypt/aes-decryptor.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>B,removePadding:()=>O});var k=C("./src/utils/typed-array.ts");function O(e){var I=e.byteLength,w=I&&new DataView(e.buffer).getUint8(I-1);return w?(0,k.sliceUint8)(e,0,I-w):e}var B=function(){function e(){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 I=e.prototype;return I.uint8ArrayToUint32Array_=function(u){for(var p=new DataView(u),c=new Uint32Array(4),m=0;m<4;m++)c[m]=p.getUint32(m*4);return c},I.initTable=function(){var u=this.sBox,p=this.invSBox,c=this.subMix,m=c[0],l=c[1],g=c[2],_=c[3],o=this.invSubMix,s=o[0],n=o[1],r=o[2],v=o[3],E=new Uint32Array(256),f=0,S=0,L=0;for(L=0;L<256;L++)L<128?E[L]=L<<1:E[L]=L<<1^283;for(L=0;L<256;L++){var A=S^S<<1^S<<2^S<<3^S<<4;A=A>>>8^A&255^99,u[f]=A,p[A]=f;var D=E[f],a=E[D],i=E[a],t=E[A]*257^A*16843008;m[f]=t<<24|t>>>8,l[f]=t<<16|t>>>16,g[f]=t<<8|t>>>24,_[f]=t,t=i*16843009^a*65537^D*257^f*16843008,s[A]=t<<24|t>>>8,n[A]=t<<16|t>>>16,r[A]=t<<8|t>>>24,v[A]=t,f?(f=D^E[E[E[i^D]]],S^=E[E[S]]):f=S=1}},I.expandKey=function(u){for(var p=this.uint8ArrayToUint32Array_(u),c=!0,m=0;m<p.length&&c;)c=p[m]===this.key[m],m++;if(!c){this.key=p;var l=this.keySize=p.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var g=this.ksRows=(l+6+1)*4,_,o,s=this.keySchedule=new Uint32Array(g),n=this.invKeySchedule=new Uint32Array(g),r=this.sBox,v=this.rcon,E=this.invSubMix,f=E[0],S=E[1],L=E[2],A=E[3],D,a;for(_=0;_<g;_++){if(_<l){D=s[_]=p[_];continue}a=D,_%l===0?(a=a<<8|a>>>24,a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[a&255],a^=v[_/l|0]<<24):l>6&&_%l===4&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[a&255]),s[_]=D=(s[_-l]^a)>>>0}for(o=0;o<g;o++)_=g-o,o&3?a=s[_]:a=s[_-4],o<4||_<=4?n[o]=a:n[o]=f[r[a>>>24]]^S[r[a>>>16&255]]^L[r[a>>>8&255]]^A[r[a&255]],n[o]=n[o]>>>0}},I.networkToHostOrderSwap=function(u){return u<<24|(u&65280)<<8|(u&16711680)>>8|u>>>24},I.decrypt=function(u,p,c){for(var m=this.keySize+6,l=this.invKeySchedule,g=this.invSBox,_=this.invSubMix,o=_[0],s=_[1],n=_[2],r=_[3],v=this.uint8ArrayToUint32Array_(c),E=v[0],f=v[1],S=v[2],L=v[3],A=new Int32Array(u),D=new Int32Array(A.length),a,i,t,h,b,T,y,d,R,M,F,U,V,re,$=this.networkToHostOrderSwap;p<A.length;){for(R=$(A[p]),M=$(A[p+1]),F=$(A[p+2]),U=$(A[p+3]),b=R^l[0],T=U^l[1],y=F^l[2],d=M^l[3],V=4,re=1;re<m;re++)a=o[b>>>24]^s[T>>16&255]^n[y>>8&255]^r[d&255]^l[V],i=o[T>>>24]^s[y>>16&255]^n[d>>8&255]^r[b&255]^l[V+1],t=o[y>>>24]^s[d>>16&255]^n[b>>8&255]^r[T&255]^l[V+2],h=o[d>>>24]^s[b>>16&255]^n[T>>8&255]^r[y&255]^l[V+3],b=a,T=i,y=t,d=h,V=V+4;a=g[b>>>24]<<24^g[T>>16&255]<<16^g[y>>8&255]<<8^g[d&255]^l[V],i=g[T>>>24]<<24^g[y>>16&255]<<16^g[d>>8&255]<<8^g[b&255]^l[V+1],t=g[y>>>24]<<24^g[d>>16&255]<<16^g[b>>8&255]<<8^g[T&255]^l[V+2],h=g[d>>>24]<<24^g[b>>16&255]<<16^g[T>>8&255]<<8^g[y&255]^l[V+3],D[p]=$(a^E),D[p+1]=$(h^f),D[p+2]=$(t^S),D[p+3]=$(i^L),E=R,f=M,S=F,L=U,p=p+4}return D.buffer},e}()},"./src/crypt/decrypter.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>p});var k=C("./src/crypt/aes-crypto.ts"),O=C("./src/crypt/fast-aes-key.ts"),B=C("./src/crypt/aes-decryptor.ts"),e=C("./src/utils/logger.ts"),I=C("./src/utils/mp4-tools.ts"),w=C("./src/utils/typed-array.ts"),u=16,p=function(){function c(l,g){var _=g===void 0?{}:g,o=_.removePKCS7Padding,s=o===void 0?!0:o;if(this.logEnabled=!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.useSoftware=void 0,this.useSoftware=l.enableSoftwareAES,this.removePKCS7Padding=s,s)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(r){}this.subtle===null&&(this.useSoftware=!0)}var m=c.prototype;return m.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},m.isSync=function(){return this.useSoftware},m.flush=function(){var g=this.currentResult,_=this.remainderData;if(!g||_)return this.reset(),null;var o=new Uint8Array(g);return this.reset(),this.removePKCS7Padding?(0,B.removePadding)(o):o},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(g,_,o){var s=this;return this.useSoftware?new Promise(function(n,r){s.softwareDecrypt(new Uint8Array(g),_,o);var v=s.flush();v?n(v.buffer):r(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(g),_,o)},m.softwareDecrypt=function(g,_,o){var s=this.currentIV,n=this.currentResult,r=this.remainderData;this.logOnce("JS AES decrypt"),r&&(g=(0,I.appendUint8Array)(r,g),this.remainderData=null);var v=this.getValidChunk(g);if(!v.length)return null;s&&(o=s);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new B.default),E.expandKey(_);var f=n;return this.currentResult=E.decrypt(v.buffer,0,o),this.currentIV=(0,w.sliceUint8)(v,-16).buffer,f||null},m.webCryptoDecrypt=function(g,_,o){var s=this,n=this.subtle;return(this.key!==_||!this.fastAesKey)&&(this.key=_,this.fastAesKey=new O.default(n,_)),this.fastAesKey.expandKey().then(function(r){if(!n)return Promise.reject(new Error("web crypto not initialized"));s.logOnce("WebCrypto AES decrypt");var v=new k.default(n,new Uint8Array(o));return v.decrypt(g.buffer,r)}).catch(function(r){return e.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+r.name+": "+r.message),s.onWebCryptoError(g,_,o)})},m.onWebCryptoError=function(g,_,o){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(g,_,o);var s=this.flush();if(s)return s.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},m.getValidChunk=function(g){var _=g,o=g.length-g.length%u;return o!==g.length&&(_=(0,w.sliceUint8)(g,0,o),this.remainderData=(0,w.sliceUint8)(g,o)),_},m.logOnce=function(g){this.logEnabled&&(e.logger.log("[decrypter]: "+g),this.logEnabled=!1)},c}()},"./src/crypt/fast-aes-key.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});var k=function(){function O(e,I){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=I}var B=O.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},O}()},"./src/demux/aacdemuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>p});var k=C("./src/demux/base-audio-demuxer.ts"),O=C("./src/demux/adts.ts"),B=C("./src/utils/logger.ts"),e=C("./src/demux/id3.ts");function I(c,m){c.prototype=Object.create(m.prototype),c.prototype.constructor=c,w(c,m)}function w(c,m){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,_){return g.__proto__=_,g},w(c,m)}var u=function(c){I(m,c);function m(g,_){var o;return o=c.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=g,o.config=_,o}var l=m.prototype;return l.resetInitSegment=function(_,o,s,n){c.prototype.resetInitSegment.call(this,_,o,s,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:o,duration:n,inputTimeScale:9e4,dropped:0}},m.probe=function(_){if(!_)return!1;for(var o=e.getID3Data(_,0)||[],s=o.length,n=_.length;s<n;s++)if(O.probe(_,s))return B.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(_,o){return O.canParse(_,o)},l.appendFrame=function(_,o,s){O.initTrackConfig(_,this.observer,o,s,_.manifestCodec);var n=O.appendFrame(_,o,s,this.basePTS,this.frameIndex);if(n&&n.missing===0)return n},m}(k.default);const p=u},"./src/demux/adts.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{appendFrame:()=>s,canGetFrameLength:()=>p,canParse:()=>m,getAudioConfig:()=>e,getFrameDuration:()=>_,getFullFrameLength:()=>u,getHeaderLength:()=>w,initTrackConfig:()=>g,isHeader:()=>c,isHeaderPattern:()=>I,parseFrameHeader:()=>o,probe:()=>l});var k=C("./src/utils/logger.ts"),O=C("./src/errors.ts"),B=C("./src/events.ts");function e(n,r,v,E){var f,S,L,A,D=navigator.userAgent.toLowerCase(),a=E,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((r[v+2]&192)>>>6)+1;var t=(r[v+2]&60)>>>2;if(t>i.length-1){n.trigger(B.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+t});return}return L=(r[v+2]&1)<<2,L|=(r[v+3]&192)>>>6,k.logger.log("manifest codec:"+E+", ADTS type:"+f+", samplingIndex:"+t),/firefox/i.test(D)?t>=6?(f=5,A=new Array(4),S=t-3):(f=2,A=new Array(2),S=t):D.indexOf("android")!==-1?(f=2,A=new Array(2),S=t):(f=5,A=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&t>=6?S=t-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(t>=6&&L===1||/vivaldi/i.test(D))||!E&&L===1)&&(f=2,A=new Array(2)),S=t)),A[0]=f<<3,A[0]|=(t&14)>>1,A[1]|=(t&1)<<7,A[1]|=L<<3,f===5&&(A[1]|=(S&14)>>1,A[2]=(S&1)<<7,A[2]|=8,A[3]=0),{config:A,samplerate:i[t],channelCount:L,codec:"mp4a.40."+f,manifestCodec:a}}function I(n,r){return n[r]===255&&(n[r+1]&246)===240}function w(n,r){return n[r+1]&1?7:9}function u(n,r){return(n[r+3]&3)<<11|n[r+4]<<3|(n[r+5]&224)>>>5}function p(n,r){return r+5<n.length}function c(n,r){return r+1<n.length&&I(n,r)}function m(n,r){return p(n,r)&&I(n,r)&&u(n,r)<=n.length-r}function l(n,r){if(c(n,r)){var v=w(n,r);if(r+v>=n.length)return!1;var E=u(n,r);if(E<=v)return!1;var f=r+E;return f===n.length||c(n,f)}return!1}function g(n,r,v,E,f){if(!n.samplerate){var S=e(r,v,E,f);if(!S)return;n.config=S.config,n.samplerate=S.samplerate,n.channelCount=S.channelCount,n.codec=S.codec,n.manifestCodec=S.manifestCodec,k.logger.log("parsed codec:"+n.codec+", rate:"+S.samplerate+", channels:"+S.channelCount)}}function _(n){return 9216e4/n}function o(n,r){var v=w(n,r);if(r+v<=n.length){var E=u(n,r)-v;if(E>0)return{headerLength:v,frameLength:E}}}function s(n,r,v,E,f){var S=_(n.samplerate),L=E+f*S,A=o(r,v),D;if(A){var a=A.frameLength,i=A.headerLength,t=i+a,h=Math.max(0,v+t-r.length);h?(D=new Uint8Array(t-i),D.set(r.subarray(v+i,r.length),0)):D=r.subarray(v+i,v+t);var b={unit:D,pts:L};return h||n.samples.push(b),{sample:b,length:t,missing:h}}var T=r.length-v;D=new Uint8Array(T),D.set(r.subarray(v,r.length),0);var y={unit:D,pts:L};return{sample:y,length:T,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>c,initPTSFn:()=>p});var k=C("./src/polyfills/number.ts"),O=C("./src/demux/id3.ts"),B=C("./src/types/demuxer.ts"),e=C("./src/demux/dummy-demuxed-track.ts"),I=C("./src/utils/mp4-tools.ts"),w=C("./src/utils/typed-array.ts"),u=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var l=m.prototype;return l.resetInitSegment=function(_,o,s,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},l.resetTimeStamp=function(_){this.initPTS=_,this.resetContiguity()},l.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},l.canParse=function(_,o){return!1},l.appendFrame=function(_,o,s){},l.demux=function(_,o){this.cachedData&&(_=(0,I.appendUint8Array)(this.cachedData,_),this.cachedData=null);var s=O.getID3Data(_,0),n=s?s.length:0,r,v=this._audioTrack,E=this._id3Track,f=s?O.getTimeStamp(s):void 0,S=_.length;for((this.basePTS===null||this.frameIndex===0&&(0,k.isFiniteNumber)(f))&&(this.basePTS=p(f,o,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&E.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:B.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});n<S;){if(this.canParse(_,n)){var L=this.appendFrame(v,_,n);L?(this.frameIndex++,this.lastPTS=L.sample.pts,n+=L.length,r=n):n=S}else O.canParse(_,n)?(s=O.getID3Data(_,n),E.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:B.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),n+=s.length,r=n):n++;if(n===S&&r!==S){var A=(0,w.sliceUint8)(_,r);this.cachedData?this.cachedData=(0,I.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:v,videoTrack:(0,e.dummyTrack)(),id3Track:E,textTrack:(0,e.dummyTrack)()}},l.demuxSampleAes=function(_,o,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},l.flush=function(_){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),{audioTrack:this._audioTrack,videoTrack:(0,e.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,e.dummyTrack)()}},l.destroy=function(){},m}(),p=function(l,g,_){return(0,k.isFiniteNumber)(l)?l*90:g*9e4+(_||0)};const c=u},"./src/demux/chunk-cache.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});var k=function(){function B(){this.chunks=[],this.dataLength=0}var e=B.prototype;return e.push=function(w){this.chunks.push(w),this.dataLength+=w.length},e.flush=function(){var w=this.chunks,u=this.dataLength,p;if(w.length)w.length===1?p=w[0]:p=O(w,u);else return new Uint8Array(0);return this.reset(),p},e.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function O(B,e){for(var I=new Uint8Array(e),w=0,u=0;u<B.length;u++){var p=B[u];I.set(p,w),w+=p.length}return I}},"./src/demux/dummy-demuxed-track.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{dummyTrack:()=>k});function k(O,B){return O===void 0&&(O=""),B===void 0&&(B=9e4),{type:O,id:-1,pid:-1,inputTimeScale:B,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>B});var k=C("./src/utils/logger.ts"),O=function(){function e(w){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=w,this.bytesAvailable=w.byteLength,this.word=0,this.bitsAvailable=0}var I=e.prototype;return I.loadWord=function(){var u=this.data,p=this.bytesAvailable,c=u.byteLength-p,m=new Uint8Array(4),l=Math.min(4,p);if(l===0)throw new Error("no bytes available");m.set(u.subarray(c,c+l)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l},I.skipBits=function(u){var p;u=Math.min(u,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>u?(this.word<<=u,this.bitsAvailable-=u):(u-=this.bitsAvailable,p=u>>3,u-=p<<3,this.bytesAvailable-=p,this.loadWord(),this.word<<=u,this.bitsAvailable-=u)},I.readBits=function(u){var p=Math.min(this.bitsAvailable,u),c=this.word>>>32-p;if(u>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0)this.word<<=p;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return p=u-p,p>0&&this.bitsAvailable?c<<p|this.readBits(p):c},I.skipLZ=function(){var u;for(u=0;u<this.bitsAvailable;++u)if(this.word&2147483648>>>u)return this.word<<=u,this.bitsAvailable-=u,u;return this.loadWord(),u+this.skipLZ()},I.skipUEG=function(){this.skipBits(1+this.skipLZ())},I.skipEG=function(){this.skipBits(1+this.skipLZ())},I.readUEG=function(){var u=this.skipLZ();return this.readBits(u+1)-1},I.readEG=function(){var u=this.readUEG();return 1&u?1+u>>>1:-1*(u>>>1)},I.readBoolean=function(){return this.readBits(1)===1},I.readUByte=function(){return this.readBits(8)},I.readUShort=function(){return this.readBits(16)},I.readUInt=function(){return this.readBits(32)},I.skipScalingList=function(u){for(var p=8,c=8,m,l=0;l<u;l++)c!==0&&(m=this.readEG(),c=(p+m+256)%256),p=c===0?p:c},I.readSPS=function(){var u=0,p=0,c=0,m=0,l,g,_,o=this.readUByte.bind(this),s=this.readBits.bind(this),n=this.readUEG.bind(this),r=this.readBoolean.bind(this),v=this.skipBits.bind(this),E=this.skipEG.bind(this),f=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);o();var L=o();if(s(5),v(3),o(),f(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var A=n();if(A===3&&v(1),f(),f(),v(1),r())for(g=A!==3?8:12,_=0;_<g;_++)r()&&(_<6?S(16):S(64))}f();var D=n();if(D===0)n();else if(D===1)for(v(1),E(),E(),l=n(),_=0;_<l;_++)E();f(),v(1);var a=n(),i=n(),t=s(1);t===0&&v(1),v(1),r()&&(u=n(),p=n(),c=n(),m=n());var h=[1,1];if(r()&&r()){var b=o();switch(b){case 1:h=[1,1];break;case 2:h=[12,11];break;case 3:h=[10,11];break;case 4:h=[16,11];break;case 5:h=[40,33];break;case 6:h=[24,11];break;case 7:h=[20,11];break;case 8:h=[32,11];break;case 9:h=[80,33];break;case 10:h=[18,11];break;case 11:h=[15,11];break;case 12:h=[64,33];break;case 13:h=[160,99];break;case 14:h=[4,3];break;case 15:h=[3,2];break;case 16:h=[2,1];break;case 255:{h=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((a+1)*16-u*2-p*2),height:(2-t)*(i+1)*16-(t?2:4)*(c+m),pixelRatio:h}},I.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();const B=O},"./src/demux/id3.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{canParse:()=>I,decodeFrame:()=>m,getID3Data:()=>B,getID3Frames:()=>c,getTimeStamp:()=>w,isFooter:()=>O,isHeader:()=>k,isTimeStampFrame:()=>u,testables:()=>n,utf8ArrayToStr:()=>s});var k=function(f,S){return S+10<=f.length&&f[S]===73&&f[S+1]===68&&f[S+2]===51&&f[S+3]<255&&f[S+4]<255&&f[S+6]<128&&f[S+7]<128&&f[S+8]<128&&f[S+9]<128},O=function(f,S){return S+10<=f.length&&f[S]===51&&f[S+1]===68&&f[S+2]===73&&f[S+3]<255&&f[S+4]<255&&f[S+6]<128&&f[S+7]<128&&f[S+8]<128&&f[S+9]<128},B=function(f,S){for(var L=S,A=0;k(f,S);){A+=10;var D=e(f,S+6);A+=D,O(f,S+10)&&(A+=10),S+=A}if(A>0)return f.subarray(L,L+A)},e=function(f,S){var L=0;return L=(f[S]&127)<<21,L|=(f[S+1]&127)<<14,L|=(f[S+2]&127)<<7,L|=f[S+3]&127,L},I=function(f,S){return k(f,S)&&e(f,S+6)+10<=f.length-S},w=function(f){for(var S=c(f),L=0;L<S.length;L++){var A=S[L];if(u(A))return o(A)}},u=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},p=function(f){var S=String.fromCharCode(f[0],f[1],f[2],f[3]),L=e(f,4),A=10;return{type:S,size:L,data:f.subarray(A,A+L)}},c=function(f){for(var S=0,L=[];k(f,S);){var A=e(f,S+6);S+=10;for(var D=S+A;S+8<D;){var a=p(f.subarray(S)),i=m(a);i&&L.push(i),S+=a.size+10}O(f,S)&&(S+=10)}return L},m=function(f){return f.type==="PRIV"?l(f):f.type[0]==="W"?_(f):g(f)},l=function(f){if(!(f.size<2)){var S=s(f.data,!0),L=new Uint8Array(f.data.subarray(S.length+1));return{key:f.type,info:S,data:L.buffer}}},g=function(f){if(!(f.size<2)){if(f.type==="TXXX"){var S=1,L=s(f.data.subarray(S),!0);S+=L.length+1;var A=s(f.data.subarray(S));return{key:f.type,info:L,data:A}}var D=s(f.data.subarray(1));return{key:f.type,data:D}}},_=function(f){if(f.type==="WXXX"){if(f.size<2)return;var S=1,L=s(f.data.subarray(S),!0);S+=L.length+1;var A=s(f.data.subarray(S));return{key:f.type,info:L,data:A}}var D=s(f.data);return{key:f.type,data:D}},o=function(f){if(f.data.byteLength===8){var S=new Uint8Array(f.data),L=S[3]&1,A=(S[4]<<23)+(S[5]<<15)+(S[6]<<7)+S[7];return A/=45,L&&(A+=4772185884e-2),Math.round(A)}},s=function(f,S){S===void 0&&(S=!1);var L=v();if(L){var A=L.decode(f);if(S){var D=A.indexOf("\0");return D!==-1?A.substring(0,D):A}return A.replace(/\0/g,"")}for(var a=f.length,i,t,h,b="",T=0;T<a;){if(i=f[T++],i===0&&S)return b;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(i);break;case 12:case 13:t=f[T++],b+=String.fromCharCode((i&31)<<6|t&63);break;case 14:t=f[T++],h=f[T++],b+=String.fromCharCode((i&15)<<12|(t&63)<<6|(h&63)<<0);break;default:}}return b},n={decodeTextFrame:g},r;function v(){return!r&&typeof self.TextDecoder!="undefined"&&(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>p});var k=C("./src/demux/base-audio-demuxer.ts"),O=C("./src/demux/id3.ts"),B=C("./src/utils/logger.ts"),e=C("./src/demux/mpegaudio.ts");function I(c,m){c.prototype=Object.create(m.prototype),c.prototype.constructor=c,w(c,m)}function w(c,m){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,_){return g.__proto__=_,g},w(c,m)}var u=function(c){I(m,c);function m(){return c.apply(this,arguments)||this}var l=m.prototype;return l.resetInitSegment=function(_,o,s,n){c.prototype.resetInitSegment.call(this,_,o,s,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:o,duration:n,inputTimeScale:9e4,dropped:0}},m.probe=function(_){if(!_)return!1;for(var o=O.getID3Data(_,0)||[],s=o.length,n=_.length;s<n;s++)if(e.probe(_,s))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(_,o){return e.canParse(_,o)},l.appendFrame=function(_,o,s){if(this.basePTS!==null)return e.appendFrame(_,o,s,this.basePTS,this.frameIndex)},m}(k.default);const p=u},"./src/demux/mp4demuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>u});var k=C("./src/polyfills/number.ts"),O=C("./src/types/demuxer.ts"),B=C("./src/utils/mp4-tools.ts"),e=C("./src/demux/dummy-demuxed-track.ts"),I=/\/emsg[-/]ID3/i,w=function(){function p(m,l){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=l}var c=p.prototype;return c.resetTimeStamp=function(){},c.resetInitSegment=function(l,g,_,o){var s=this.videoTrack=(0,e.dummyTrack)("video",1),n=this.audioTrack=(0,e.dummyTrack)("audio",1),r=this.txtTrack=(0,e.dummyTrack)("text",1);if(this.id3Track=(0,e.dummyTrack)("id3",1),this.timeOffset=0,!(!l||!l.byteLength)){var v=(0,B.parseInitSegment)(l);if(v.video){var E=v.video,f=E.id,S=E.timescale,L=E.codec;s.id=f,s.timescale=r.timescale=S,s.codec=L}if(v.audio){var A=v.audio,D=A.id,a=A.timescale,i=A.codec;n.id=D,n.timescale=a,n.codec=i}r.id=B.RemuxerTrackIdConfig.text,s.sampleDuration=0,s.duration=n.duration=o}},c.resetContiguity=function(){},p.probe=function(l){return l=l.length>16384?l.subarray(0,16384):l,(0,B.findBox)(l,["moof"]).length>0},c.demux=function(l,g){this.timeOffset=g;var _=l,o=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(_=(0,B.appendUint8Array)(this.remainderData,l));var n=(0,B.segmentValidRange)(_);this.remainderData=n.remainder,o.samples=n.valid||new Uint8Array}else o.samples=_;var r=this.extractID3Track(o,g);return s.samples=(0,B.parseSamples)(g,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:r,textTrack:this.txtTrack}},c.flush=function(){var l=this.timeOffset,g=this.videoTrack,_=this.txtTrack;g.samples=this.remainderData||new Uint8Array,this.remainderData=null;var o=this.extractID3Track(g,this.timeOffset);return _.samples=(0,B.parseSamples)(l,g),{videoTrack:g,audioTrack:(0,e.dummyTrack)(),id3Track:o,textTrack:(0,e.dummyTrack)()}},c.extractID3Track=function(l,g){var _=this.id3Track;if(l.samples.length){var o=(0,B.findBox)(l.samples,["emsg"]);o&&o.forEach(function(s){var n=(0,B.parseEmsg)(s);if(I.test(n.schemeIdUri)){var r=(0,k.isFiniteNumber)(n.presentationTime)?n.presentationTime/n.timeScale:g+n.presentationTimeDelta/n.timeScale,v=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;v<=.001&&(v=Number.POSITIVE_INFINITY);var E=n.payload;_.samples.push({data:E,len:E.byteLength,dts:r,pts:r,type:O.MetadataSchema.emsg,duration:v})}})}return _},c.demuxSampleAes=function(l,g,_){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},c.destroy=function(){},p}();const u=w},"./src/demux/mpegaudio.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{appendFrame:()=>w,canParse:()=>m,isHeader:()=>c,isHeaderPattern:()=>p,parseHeader:()=>u,probe:()=>l});var k=null,O=[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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],e=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function w(g,_,o,s,n){if(!(o+24>_.length)){var r=u(_,o);if(r&&o+r.frameLength<=_.length){var v=r.samplesPerFrame*9e4/r.sampleRate,E=s+n*v,f={unit:_.subarray(o,o+r.frameLength),pts:E,dts:E};return g.config=[],g.channelCount=r.channelCount,g.samplerate=r.sampleRate,g.samples.push(f),{sample:f,length:r.frameLength,missing:0}}}}function u(g,_){var o=g[_+1]>>3&3,s=g[_+1]>>1&3,n=g[_+2]>>4&15,r=g[_+2]>>2&3;if(o!==1&&n!==0&&n!==15&&r!==3){var v=g[_+2]>>1&1,E=g[_+3]>>6,f=o===3?3-s:s===3?3:4,S=O[f*14+n-1]*1e3,L=o===3?0:o===2?1:2,A=B[L*3+r],D=E===3?1:2,a=e[o][s],i=I[s],t=a*8*i,h=Math.floor(a*S/A+v)*i;if(k===null){var b=navigator.userAgent||"",T=b.match(/Chrome\/(\d+)/i);k=T?parseInt(T[1]):0}var y=!!k&&k<=87;return y&&s===2&&S>=224e3&&E===0&&(g[_+3]=g[_+3]|128),{sampleRate:A,channelCount:D,frameLength:h,samplesPerFrame:t}}}function p(g,_){return g[_]===255&&(g[_+1]&224)===224&&(g[_+1]&6)!==0}function c(g,_){return _+1<g.length&&p(g,_)}function m(g,_){var o=4;return p(g,_)&&o<=g.length-_}function l(g,_){if(_+1<g.length&&p(g,_)){var o=4,s=u(g,_),n=o;s!=null&&s.frameLength&&(n=s.frameLength);var r=_+n;return r===g.length||c(g,r)}return!1}},"./src/demux/sample-aes.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>e});var k=C("./src/crypt/decrypter.ts"),O=C("./src/utils/mp4-tools.ts"),B=function(){function I(u,p,c){this.keyData=void 0,this.decrypter=void 0,this.keyData=c,this.decrypter=new k.default(p,{removePKCS7Padding:!1})}var w=I.prototype;return w.decryptBuffer=function(p){return this.decrypter.decrypt(p,this.keyData.key.buffer,this.keyData.iv.buffer)},w.decryptAacSample=function(p,c,m){var l=this,g=p[c].unit;if(!(g.length<=16)){var _=g.subarray(16,g.length-g.length%16),o=_.buffer.slice(_.byteOffset,_.byteOffset+_.length);this.decryptBuffer(o).then(function(s){var n=new Uint8Array(s);g.set(n,16),l.decrypter.isSync()||l.decryptAacSamples(p,c+1,m)})}},w.decryptAacSamples=function(p,c,m){for(;;c++){if(c>=p.length){m();return}if(!(p[c].unit.length<32)&&(this.decryptAacSample(p,c,m),!this.decrypter.isSync()))return}},w.getAvcEncryptedData=function(p){for(var c=Math.floor((p.length-48)/160)*16+16,m=new Int8Array(c),l=0,g=32;g<p.length-16;g+=160,l+=16)m.set(p.subarray(g,g+16),l);return m},w.getAvcDecryptedUnit=function(p,c){for(var m=new Uint8Array(c),l=0,g=32;g<p.length-16;g+=160,l+=16)p.set(m.subarray(l,l+16),g);return p},w.decryptAvcSample=function(p,c,m,l,g){var _=this,o=(0,O.discardEPB)(g.data),s=this.getAvcEncryptedData(o);this.decryptBuffer(s.buffer).then(function(n){g.data=_.getAvcDecryptedUnit(o,n),_.decrypter.isSync()||_.decryptAvcSamples(p,c,m+1,l)})},w.decryptAvcSamples=function(p,c,m,l){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,m=0){if(c>=p.length){l();return}for(var g=p[c].units;!(m>=g.length);m++){var _=g[m];if(!(_.data.length<=48||_.type!==1&&_.type!==5)&&(this.decryptAvcSample(p,c,m,l,_),!this.decrypter.isSync()))return}}},I}();const e=B},"./src/demux/transmuxer-interface.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>m});var k=C("./src/demux/webworkify-webpack.js"),O=C("./src/events.ts"),B=C("./src/demux/transmuxer.ts"),e=C("./src/utils/logger.ts"),I=C("./src/errors.ts"),w=C("./src/utils/mediasource-helper.ts"),u=C("./node_modules/eventemitter3/index.js"),p=C.n(u),c=(0,w.getMediaSource)()||{isTypeSupported:function(){return!1}},m=function(){function l(_,o,s,n){var r=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var v=_.config;this.hls=_,this.id=o,this.useWorker=!!v.enableWorker,this.onTransmuxComplete=s,this.onFlush=n;var E=function(D,a){a=a||{},a.frag=r.frag,a.id=r.id,r.hls.trigger(D,a)};this.observer=new u.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,E),this.observer.on(O.Events.ERROR,E);var f={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){e.logger.log("demuxing in webworker");var L;try{L=this.worker=(0,k.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),L.addEventListener("message",this.onwmsg),L.onerror=function(A){r.useWorker=!1,e.logger.warn("Exception in webworker, fallback to inline"),r.hls.trigger(O.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(A.message+" ("+A.filename+":"+A.lineno+")")})},L.postMessage({cmd:"init",typeSupported:f,vendor:S,id:o,config:JSON.stringify(v)})}catch(A){e.logger.warn("Error in worker:",A),e.logger.error("Error while initializing DemuxerWorker, fallback to inline"),L&&self.URL.revokeObjectURL(L.objectURL),this.transmuxer=new B.default(this.observer,f,v,S,o),this.worker=null}}else this.transmuxer=new B.default(this.observer,f,v,S,o)}var g=l.prototype;return g.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null,this.onwmsg=void 0;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},g.push=function(o,s,n,r,v,E,f,S,L,A){var D,a,i=this;L.transmuxing.start=self.performance.now();var t=this.transmuxer,h=this.worker,b=E?E.start:v.start,T=v.decryptdata,y=this.frag,d=!(y&&v.cc===y.cc),R=!(y&&L.level===y.level),M=y?L.sn-y.sn:-1,F=this.part?L.part-this.part.index:-1,U=M===0&&L.id>1&&L.id===(y==null?void 0:y.stats.chunkCount),V=!R&&(M===1||M===0&&(F===1||U&&F<=0)),re=self.performance.now();(R||M||v.stats.parsing.start===0)&&(v.stats.parsing.start=re),E&&(F||!V)&&(E.stats.parsing.start=re);var $=!(y&&((D=v.initSegment)===null||D===void 0?void 0:D.url)===((a=y.initSegment)===null||a===void 0?void 0:a.url)),le=new B.TransmuxState(d,V,S,R,b,$);if(!V||d||$){e.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+L.sn+" p: "+L.part+" level: "+L.level+" id: "+L.id+`
discontinuity: `+d+`
trackSwitch: `+R+`
contiguous: `+V+`
accurateTimeOffset: `+S+`
timeOffset: `+b+`
initSegmentChange: `+$);var te=new B.TransmuxConfig(n,r,s,f,A);this.configureTransmuxer(te)}if(this.frag=v,this.part=E,h)h.postMessage({cmd:"demux",data:o,decryptdata:T,chunkMeta:L,state:le},o instanceof ArrayBuffer?[o]:[]);else if(t){var _e=t.push(o,T,L,le);(0,B.isPromise)(_e)?(t.async=!0,_e.then(function(fe){i.handleTransmuxComplete(fe)}).catch(function(fe){i.transmuxerError(fe,L,"transmuxer-interface push error")})):(t.async=!1,this.handleTransmuxComplete(_e))}},g.flush=function(o){var s=this;o.transmuxing.start=self.performance.now();var n=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:o});else if(n){var v=n.flush(o),E=(0,B.isPromise)(v);E||n.async?((0,B.isPromise)(v)||(v=Promise.resolve(v)),v.then(function(f){s.handleFlushResult(f,o)}).catch(function(f){s.transmuxerError(f,o,"transmuxer-interface flush error")})):this.handleFlushResult(v,o)}},g.transmuxerError=function(o,s,n){this.hls&&this.hls.trigger(O.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:s,fatal:!1,error:o,err:o,reason:n})},g.handleFlushResult=function(o,s){var n=this;o.forEach(function(r){n.handleTransmuxComplete(r)}),this.onFlush(s)},g.onWorkerMessage=function(o){var s=o.data,n=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}case"workerLog":e.logger[s.data.logType]&&e.logger[s.data.logType](s.data.message);break;default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,n.trigger(s.event,s.data);break}}},g.configureTransmuxer=function(o){var s=this.worker,n=this.transmuxer;s?s.postMessage({cmd:"configure",config:o}):n&&n.configure(o)},g.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},l}()},"./src/demux/transmuxer-worker.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>u});var k=C("./src/demux/transmuxer.ts"),O=C("./src/events.ts"),B=C("./src/utils/logger.ts"),e=C("./node_modules/eventemitter3/index.js"),I=C.n(e),w=C("./src/errors.ts");function u(g){var _=new e.EventEmitter,o=function(r,v){g.postMessage({event:r,data:v})};_.on(O.Events.FRAG_DECRYPTED,o),_.on(O.Events.ERROR,o);var s=function(){var r=function(f){var S=function(A){o("workerLog",{logType:f,message:A})};B.logger[f]=S};for(var v in B.logger)r(v)};g.addEventListener("message",function(n){var r=n.data;switch(r.cmd){case"init":{var v=JSON.parse(r.config);g.transmuxer=new k.default(_,r.typeSupported,v,r.vendor,r.id),(0,B.enableLogs)(v.debug,r.id),s(),o("init",null);break}case"configure":{g.transmuxer.configure(r.config);break}case"demux":{var E=g.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);(0,k.isPromise)(E)?(g.transmuxer.async=!0,E.then(function(A){p(g,A)}).catch(function(A){o(O.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:r.chunkMeta,fatal:!1,error:A,err:A,reason:"transmuxer-worker push error"})})):(g.transmuxer.async=!1,p(g,E));break}case"flush":{var f=r.chunkMeta,S=g.transmuxer.flush(f),L=(0,k.isPromise)(S);L||g.transmuxer.async?((0,k.isPromise)(S)||(S=Promise.resolve(S)),S.then(function(A){m(g,A,f)}).catch(function(A){o(O.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:r.chunkMeta,fatal:!1,error:A,err:A,reason:"transmuxer-worker flush error"})})):m(g,S,f);break}default:break}})}function p(g,_){if(l(_.remuxResult))return!1;var o=[],s=_.remuxResult,n=s.audio,r=s.video;return n&&c(o,n),r&&c(o,r),g.postMessage({event:"transmuxComplete",data:_},o),!0}function c(g,_){_.data1&&g.push(_.data1.buffer),_.data2&&g.push(_.data2.buffer)}function m(g,_,o){var s=_.reduce(function(n,r){return p(g,r)||n},!1);s||g.postMessage({event:"transmuxComplete",data:_[0]}),g.postMessage({event:"flush",data:o})}function l(g){return!g.audio&&!g.video&&!g.text&&!g.id3&&!g.initSegment}},"./src/demux/transmuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{TransmuxConfig:()=>r,TransmuxState:()=>v,default:()=>_,isPromise:()=>n});var k=C("./src/events.ts"),O=C("./src/errors.ts"),B=C("./src/crypt/decrypter.ts"),e=C("./src/demux/aacdemuxer.ts"),I=C("./src/demux/mp4demuxer.ts"),w=C("./src/demux/tsdemuxer.ts"),u=C("./src/demux/mp3demuxer.ts"),p=C("./src/remux/mp4-remuxer.ts"),c=C("./src/remux/passthrough-remuxer.ts"),m=C("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(E){m.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var g=[{demux:I.default,remux:c.default},{demux:w.default,remux:p.default},{demux:e.default,remux:p.default},{demux:u.default,remux:p.default}],_=function(){function E(S,L,A,D,a){this.async=!1,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.observer=S,this.typeSupported=L,this.config=A,this.vendor=D,this.id=a}var f=E.prototype;return f.configure=function(L){this.transmuxConfig=L,this.decrypter&&this.decrypter.reset()},f.push=function(L,A,D,a){var i=this,t=D.transmuxing;t.executeStart=l();var h=new Uint8Array(L),b=this.currentTransmuxState,T=this.transmuxConfig;a&&(this.currentTransmuxState=a);var y=a||b,d=y.contiguous,R=y.discontinuity,M=y.trackSwitch,F=y.accurateTimeOffset,U=y.timeOffset,V=y.initSegmentChange,re=T.audioCodec,$=T.videoCodec,le=T.defaultInitPts,te=T.duration,_e=T.initSegmentData,fe=o(h,A);if(fe&&fe.method==="AES-128"){var me=this.getDecrypter();if(me.isSync()){var Ae=me.softwareDecrypt(h,fe.key.buffer,fe.iv.buffer),Be=D.part>-1;if(Be&&(Ae=me.flush()),!Ae)return t.executeEnd=l(),s(D);h=new Uint8Array(Ae)}else return this.decryptionPromise=me.webCryptoDecrypt(h,fe.key.buffer,fe.iv.buffer).then(function(Ke){var Ce=i.push(Ke,null,D);return i.decryptionPromise=null,Ce}),this.decryptionPromise}var Le=this.needsProbing(R,M);Le&&this.configureTransmuxer(h),(R||M||V||Le)&&this.resetInitSegment(_e,re,$,te,A),(R||V||Le)&&this.resetInitialTimestamp(le),d||this.resetContiguity();var Ie=this.transmux(h,fe,U,F,D),pe=this.currentTransmuxState;return pe.contiguous=!0,pe.discontinuity=!1,pe.trackSwitch=!1,t.executeEnd=l(),Ie},f.flush=function(L){var A=this,D=L.transmuxing;D.executeStart=l();var a=this.decrypter,i=this.currentTransmuxState,t=this.decryptionPromise;if(t)return t.then(function(){return A.flush(L)});var h=[],b=i.timeOffset;if(a){var T=a.flush();T&&h.push(this.push(T,null,L))}var y=this.demuxer,d=this.remuxer;if(!y||!d)return this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),D.executeEnd=l(),[s(L)];var R=y.flush(b);return n(R)?R.then(function(M){return A.flushRemux(h,M,L),h}):(this.flushRemux(h,R,L),h)},f.flushRemux=function(L,A,D){var a=A.audioTrack,i=A.videoTrack,t=A.id3Track,h=A.textTrack,b=this.currentTransmuxState,T=b.accurateTimeOffset,y=b.timeOffset;m.logger.log("[transmuxer.ts]: Flushed fragment "+D.sn+(D.part>-1?" p: "+D.part:"")+" of level "+D.level);var d=this.remuxer.remux(a,i,t,h,y,T,!0,this.id);L.push({remuxResult:d,chunkMeta:D}),D.transmuxing.executeEnd=l()},f.resetInitialTimestamp=function(L){var A=this.demuxer,D=this.remuxer;!A||!D||(A.resetTimeStamp(L),D.resetTimeStamp(L))},f.resetContiguity=function(){var L=this.demuxer,A=this.remuxer;!L||!A||(L.resetContiguity(),A.resetNextTimestamp())},f.resetInitSegment=function(L,A,D,a,i){var t=this.demuxer,h=this.remuxer;!t||!h||(t.resetInitSegment(L,A,D,a),h.resetInitSegment(L,A,D,i))},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(L,A,D,a,i){var t;return A&&A.method==="SAMPLE-AES"?t=this.transmuxSampleAes(L,A,D,a,i):t=this.transmuxUnencrypted(L,D,a,i),t},f.transmuxUnencrypted=function(L,A,D,a){var i=this.demuxer.demux(L,A,!1,!this.config.progressive),t=i.audioTrack,h=i.videoTrack,b=i.id3Track,T=i.textTrack,y=this.remuxer.remux(t,h,b,T,A,D,!1,this.id);return{remuxResult:y,chunkMeta:a}},f.transmuxSampleAes=function(L,A,D,a,i){var t=this;return this.demuxer.demuxSampleAes(L,A,D).then(function(h){var b=t.remuxer.remux(h.audioTrack,h.videoTrack,h.id3Track,h.textTrack,D,a,!1,t.id);return{remuxResult:b,chunkMeta:i}})},f.configureTransmuxer=function(L){for(var A=this.config,D=this.observer,a=this.typeSupported,i=this.vendor,t,h=0,b=g.length;h<b;h++)if(g[h].demux.probe(L)){t=g[h];break}t||(m.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),t={demux:I.default,remux:c.default});var T=this.demuxer,y=this.remuxer,d=t.remux,R=t.demux;(!y||!(y instanceof d))&&(this.remuxer=new d(D,A,a,i)),(!T||!(T instanceof R))&&(this.demuxer=new R(D,A,a),this.probe=R.probe)},f.needsProbing=function(L,A){return!this.demuxer||!this.remuxer||L||A},f.getDecrypter=function(){var L=this.decrypter;return L||(L=this.decrypter=new B.default(this.config)),L},E}();function o(E,f){var S=null;return E.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(S=f),S}var s=function(f){return{remuxResult:{},chunkMeta:f}};function n(E){return"then"in E&&E.then instanceof Function}var r=function(f,S,L,A,D){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=S,this.initSegmentData=L,this.duration=A,this.defaultInitPts=D},v=function(f,S,L,A,D,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=f,this.contiguous=S,this.accurateTimeOffset=L,this.trackSwitch=A,this.timeOffset=D,this.initSegmentChange=a}},"./src/demux/tsdemuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>E});var k=C("./src/demux/adts.ts"),O=C("./src/demux/mpegaudio.ts"),B=C("./src/demux/exp-golomb.ts"),e=C("./src/demux/sample-aes.ts"),I=C("./src/events.ts"),w=C("./src/utils/mp4-tools.ts"),u=C("./src/utils/logger.ts"),p=C("./src/errors.ts"),c=C("./src/types/demuxer.ts");function m(){return m=Object.assign?Object.assign.bind():function(f){for(var S=1;S<arguments.length;S++){var L=arguments[S];for(var A in L)Object.prototype.hasOwnProperty.call(L,A)&&(f[A]=L[A])}return f},m.apply(this,arguments)}var l=188,g=function(){function f(L,A,D){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._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=L,this.config=A,this.typeSupported=D}f.probe=function(A){var D=f.syncOffset(A);return D>0&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+D),D!==-1},f.syncOffset=function(A){for(var D=A.length,a=Math.min(l*5,A.length-l)+1,i=0;i<a;){for(var t=!1,h=i;h<D&&A[h]===71;h+=l)if(!t&&o(A,h)===0&&(t=!0),t&&h+l>a)return i;i++}return-1},f.createTrack=function(A,D){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:w.RemuxerTrackIdConfig[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?D:void 0}};var S=f.prototype;return S.resetInitSegment=function(A,D,a,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video"),this._audioTrack=f.createTrack("audio",i),this._id3Track=f.createTrack("id3"),this._txtTrack=f.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=D,this.videoCodec=a,this._duration=i},S.resetTimeStamp=function(){},S.resetContiguity=function(){var A=this._audioTrack,D=this._avcTrack,a=this._id3Track;A&&(A.pesData=null),D&&(D.pesData=null),a&&(a.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},S.demux=function(A,D,a,i){a===void 0&&(a=!1),i===void 0&&(i=!1),a||(this.sampleAes=null);var t,h=this._avcTrack,b=this._audioTrack,T=this._id3Track,y=this._txtTrack,d=h.pid,R=h.pesData,M=b.pid,F=T.pid,U=b.pesData,V=T.pesData,re=null,$=this.pmtParsed,le=this._pmtId,te=A.length;if(this.remainderData&&(A=(0,w.appendUint8Array)(this.remainderData,A),te=A.length,this.remainderData=null),te<l&&!i)return this.remainderData=A,{audioTrack:b,videoTrack:h,id3Track:T,textTrack:y};var _e=Math.max(0,f.syncOffset(A));te-=(te-_e)%l,te<A.byteLength&&!i&&(this.remainderData=new Uint8Array(A.buffer,te,A.buffer.byteLength-te));for(var fe=0,me=_e;me<te;me+=l)if(A[me]===71){var Ae=!!(A[me+1]&64),Be=o(A,me),Le=(A[me+3]&48)>>4,Ie=void 0;if(Le>1){if(Ie=me+5+A[me+4],Ie===me+l)continue}else Ie=me+4;switch(Be){case d:Ae&&(R&&(t=r(R))&&this.parseAVCPES(h,y,t,!1),R={data:[],size:0}),R&&(R.data.push(A.subarray(Ie,me+l)),R.size+=me+l-Ie);break;case M:if(Ae){if(U&&(t=r(U)))switch(b.segmentCodec){case"aac":this.parseAACPES(b,t);break;case"mp3":this.parseMPEGPES(b,t);break}U={data:[],size:0}}U&&(U.data.push(A.subarray(Ie,me+l)),U.size+=me+l-Ie);break;case F:Ae&&(V&&(t=r(V))&&this.parseID3PES(T,t),V={data:[],size:0}),V&&(V.data.push(A.subarray(Ie,me+l)),V.size+=me+l-Ie);break;case 0:Ae&&(Ie+=A[Ie]+1),le=this._pmtId=s(A,Ie);break;case le:{Ae&&(Ie+=A[Ie]+1);var pe=n(A,Ie,this.typeSupported,a);d=pe.avc,d>0&&(h.pid=d),M=pe.audio,M>0&&(b.pid=M,b.segmentCodec=pe.segmentCodec),F=pe.id3,F>0&&(T.pid=F),re!==null&&!$&&(u.logger.warn("MPEG-TS PMT found at "+me+" after unknown PID '"+re+"'. Backtracking to sync byte @"+_e+" to parse all TS packets."),re=null,me=_e-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:re=Be;break}}else fe++;fe>0&&this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+fe+" TS packet/s that do not start with 0x47"}),h.pesData=R,b.pesData=U,T.pesData=V;var Ke={audioTrack:b,videoTrack:h,id3Track:T,textTrack:y};return i&&this.extractRemainingSamples(Ke),Ke},S.flush=function(){var A=this.remainderData;this.remainderData=null;var D;return A?D=this.demux(A,-1,!1,!0):D={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(D),this.sampleAes?this.decrypt(D,this.sampleAes):D},S.extractRemainingSamples=function(A){var D=A.audioTrack,a=A.videoTrack,i=A.id3Track,t=A.textTrack,h=a.pesData,b=D.pesData,T=i.pesData,y;if(h&&(y=r(h))?(this.parseAVCPES(a,t,y,!0),a.pesData=null):a.pesData=h,b&&(y=r(b))){switch(D.segmentCodec){case"aac":this.parseAACPES(D,y);break;case"mp3":this.parseMPEGPES(D,y);break}D.pesData=null}else b!=null&&b.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),D.pesData=b;T&&(y=r(T))?(this.parseID3PES(i,y),i.pesData=null):i.pesData=T},S.demuxSampleAes=function(A,D,a){var i=this.demux(A,a,!0,!this.config.progressive),t=this.sampleAes=new e.default(this.observer,this.config,D);return this.decrypt(i,t)},S.decrypt=function(A,D){return new Promise(function(a){var i=A.audioTrack,t=A.videoTrack;i.samples&&i.segmentCodec==="aac"?D.decryptAacSamples(i.samples,0,function(){t.samples?D.decryptAvcSamples(t.samples,0,0,function(){a(A)}):a(A)}):t.samples&&D.decryptAvcSamples(t.samples,0,0,function(){a(A)})})},S.destroy=function(){this._duration=0},S.parseAVCPES=function(A,D,a,i){var t=this,h=this.parseAVCNALu(A,a.data),b=!1,T=this.avcSample,y,d=!1;a.data=null,T&&h.length&&!A.audFound&&(v(T,A),T=this.avcSample=_(!1,a.pts,a.dts,"")),h.forEach(function(R){switch(R.type){case 1:{y=!0,T||(T=t.avcSample=_(!0,a.pts,a.dts,"")),b&&(T.debug+="NDR "),T.frame=!0;var M=R.data;if(d&&M.length>4){var F=new B.default(M).readSliceType();(F===2||F===4||F===7||F===9)&&(T.key=!0)}break}case 5:y=!0,T||(T=t.avcSample=_(!0,a.pts,a.dts,"")),b&&(T.debug+="IDR "),T.key=!0,T.frame=!0;break;case 6:{y=!0,b&&T&&(T.debug+="SEI "),(0,w.parseSEIMessageFromNALu)(R.data,1,a.pts,D.samples);break}case 7:if(y=!0,d=!0,b&&T&&(T.debug+="SPS "),!A.sps){var U=new B.default(R.data),V=U.readSPS();A.width=V.width,A.height=V.height,A.pixelRatio=V.pixelRatio,A.sps=[R.data],A.duration=t._duration;for(var re=R.data.subarray(1,4),$="avc1.",le=0;le<3;le++){var te=re[le].toString(16);te.length<2&&(te="0"+te),$+=te}A.codec=$}break;case 8:y=!0,b&&T&&(T.debug+="PPS "),A.pps||(A.pps=[R.data]);break;case 9:y=!1,A.audFound=!0,T&&v(T,A),T=t.avcSample=_(!1,a.pts,a.dts,b?"AUD ":"");break;case 12:y=!0;break;default:y=!1,T&&(T.debug+="unknown NAL "+R.type+" ");break}if(T&&y){var _e=T.units;_e.push(R)}}),i&&T&&(v(T,A),this.avcSample=null)},S.getLastNalUnit=function(A){var D,a=this.avcSample,i;if((!a||a.units.length===0)&&(a=A[A.length-1]),(D=a)!==null&&D!==void 0&&D.units){var t=a.units;i=t[t.length-1]}return i},S.parseAVCNALu=function(A,D){var a=D.byteLength,i=A.naluState||0,t=i,h=[],b=0,T,y,d,R=-1,M=0;for(i===-1&&(R=0,M=D[0]&31,i=0,b=1);b<a;){if(T=D[b++],!i){i=T?0:1;continue}if(i===1){i=T?0:2;continue}if(!T)i=3;else if(T===1){if(R>=0){var F={data:D.subarray(R,b-i-1),type:M};h.push(F)}else{var U=this.getLastNalUnit(A.samples);if(U&&(t&&b<=4-t&&U.state&&(U.data=U.data.subarray(0,U.data.byteLength-t)),y=b-i-1,y>0)){var V=new Uint8Array(U.data.byteLength+y);V.set(U.data,0),V.set(D.subarray(0,y),U.data.byteLength),U.data=V,U.state=0}}b<a?(d=D[b]&31,R=b,M=d,i=0):i=-1}else i=0}if(R>=0&&i>=0){var re={data:D.subarray(R,a),type:M,state:i};h.push(re)}if(h.length===0){var $=this.getLastNalUnit(A.samples);if($){var le=new Uint8Array($.data.byteLength+D.byteLength);le.set($.data,0),le.set(D,$.data.byteLength),$.data=le}}return A.naluState=i,h},S.parseAACPES=function(A,D){var a=0,i=this.aacOverFlow,t=D.data;if(i){this.aacOverFlow=null;var h=i.missing,b=i.sample.unit.byteLength;if(h===-1){var T=new Uint8Array(b+t.byteLength);T.set(i.sample.unit,0),T.set(t,b),t=T}else{var y=b-h;i.sample.unit.set(t.subarray(0,h),y),A.samples.push(i.sample),a=i.missing}}var d,R;for(d=a,R=t.length;d<R-1&&!k.isHeader(t,d);d++);if(d!==a){var M,F;if(d<R-1?(M="AAC PES did not start with ADTS header,offset:"+d,F=!1):(M="no ADTS header found in AAC PES",F=!0),u.logger.warn("parsing error:"+M),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:M}),F)return}k.initTrackConfig(A,this.observer,t,d,this.audioCodec);var U;if(D.pts!==void 0)U=D.pts;else if(i){var V=k.getFrameDuration(A.samplerate);U=i.sample.pts+V}else{u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var re=0,$;d<R;)if($=k.appendFrame(A,t,d,U,re),d+=$.length,$.missing){this.aacOverFlow=$;break}else for(re++;d<R-1&&!k.isHeader(t,d);d++);},S.parseMPEGPES=function(A,D){var a=D.data,i=a.length,t=0,h=0,b=D.pts;if(b===void 0){u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<i;)if(O.isHeader(a,h)){var T=O.appendFrame(A,a,h,b,t);if(T)h+=T.length,t++;else break}else h++},S.parseID3PES=function(A,D){if(D.pts===void 0){u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var a=m({},D,{type:this._avcTrack?c.MetadataSchema.emsg:c.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});A.samples.push(a)},f}();function _(f,S,L,A){return{key:f,frame:!1,pts:S,dts:L,units:[],debug:A,length:0}}function o(f,S){return((f[S+1]&31)<<8)+f[S+2]}function s(f,S){return(f[S+10]&31)<<8|f[S+11]}function n(f,S,L,A){var D={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},a=(f[S+1]&15)<<8|f[S+2],i=S+3+a-4,t=(f[S+10]&15)<<8|f[S+11];for(S+=12+t;S<i;){var h=o(f,S);switch(f[S]){case 207:if(!A){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:D.audio===-1&&(D.audio=h);break;case 21:D.id3===-1&&(D.id3=h);break;case 219:if(!A){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:D.avc===-1&&(D.avc=h);break;case 3:case 4:L.mpeg!==!0&&L.mp3!==!0?u.logger.log("MPEG audio found, not supported in this browser"):D.audio===-1&&(D.audio=h,D.segmentCodec="mp3");break;case 36:u.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((f[S+3]&15)<<8|f[S+4])+5}return D}function r(f){var S=0,L,A,D,a,i,t=f.data;if(!f||f.size===0)return null;for(;t[0].length<19&&t.length>1;){var h=new Uint8Array(t[0].length+t[1].length);h.set(t[0]),h.set(t[1],t[0].length),t[0]=h,t.splice(1,1)}L=t[0];var b=(L[0]<<16)+(L[1]<<8)+L[2];if(b===1){if(A=(L[4]<<8)+L[5],A&&A>f.size-6)return null;var T=L[7];T&192&&(a=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,T&64?(i=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,a-i>54e5&&(u.logger.warn(Math.round((a-i)/9e4)+"s delta between PTS and DTS, align them"),a=i)):i=a),D=L[8];var y=D+9;if(f.size<=y)return null;f.size-=y;for(var d=new Uint8Array(f.size),R=0,M=t.length;R<M;R++){L=t[R];var F=L.byteLength;if(y)if(y>F){y-=F;continue}else L=L.subarray(y),F-=y,y=0;d.set(L,S),S+=F}return A&&(A-=D+3),{data:d,pts:a,dts:i,len:A}}return null}function v(f,S){if(f.units.length&&f.frame){if(f.pts===void 0){var L=S.samples,A=L.length;if(A){var D=L[A-1];f.pts=D.pts,f.dts=D.dts}else{S.dropped++;return}}S.samples.push(f)}f.debug.length&&u.logger.log(f.pts+"/"+f.dts+":"+f.debug)}const E=g},"./src/demux/webworkify-webpack.js":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>l});var k=function(){var _=ENTRY_MODULE,o={},s=function r(v){var E=o[v];if(E!==void 0)return E.exports;var f=o[v]={exports:{}};return _[v].call(f.exports,f,f.exports,r),f.exports};s.m=_,function(){s.n=function(r){var v=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(v,{a:v}),v}}(),function(){s.d=function(r,v){for(var E in v)s.o(v,E)&&!s.o(r,E)&&Object.defineProperty(r,E,{enumerable:!0,get:v[E]})}}(),function(){s.o=function(r,v){return Object.prototype.hasOwnProperty.call(r,v)}}(),function(){s.r=function(r){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}}();var n=s(ENTRY_MODULE);return n.default||n},O=k.toString().split("ENTRY_MODULE"),B="[\\.|\\-|\\+|\\w|/|@]+",e="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function I(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function w(g){return!isNaN(1*g)}function u(g,_,o){var s={};s[o]=[];var n=_.toString().replace(/^"[^"]+"/,"function"),r=n.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||n.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!r)return s;for(var v=r[1],E=new RegExp("(\\\\n|\\W)"+I(v)+e,"g"),f;f=E.exec(n);)f[3]!=="dll-reference"&&s[o].push(f[3]);for(E=new RegExp("\\("+I(v)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+e,"g");f=E.exec(n);)g[f[2]]||(s[o].push(f[1]),g[f[2]]=C(f[1]).m),s[f[2]]=s[f[2]]||[],s[f[2]].push(f[4]);for(var S=Object.keys(s),L=0;L<S.length;L++)for(var A=0;A<s[S[L]].length;A++)w(s[S[L]][A])&&(s[S[L]][A]=1*s[S[L]][A]);return s}function p(g){var _=Object.keys(g);return _.reduce(function(o,s){return o||g[s].length>0},!1)}function c(g,_){for(var o={main:[_]},s={main:[]},n={main:{}};p(o);)for(var r=Object.keys(o),v=0;v<r.length;v++){var E=r[v],f=o[E],S=f.pop();if(n[E]=n[E]||{},!(n[E][S]||!g[E][S])){n[E][S]=!0,s[E]=s[E]||[],s[E].push(S);for(var L=u(g,g[E][S],E),A=Object.keys(L),D=0;D<A.length;D++)o[A[D]]=o[A[D]]||[],o[A[D]]=o[A[D]].concat(L[A[D]])}}return s}function m(g,_,o,s){var n=g[s].map(function(r){return'"'+r+'": '+_[s][r].toString().replace(/^"[^"]+"/,"function")}).join(",");return O[0]+"{"+n+"}"+O[1]+'"'+o+'"'+O[2]}function l(g,_){_=_||{};var o={main:C.m},s=_.all?{main:Object.keys(o.main)}:c(o,g),n="";Object.keys(s).filter(function(S){return S!=="main"}).forEach(function(S){for(var L=0;s[S][L];)L++;s[S].push(L),o[S][L]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",n=n+("var "+S+" = ("+m(s,o,L,modules)+`)();
`)}),n=n+("new (("+m(s,o,g,"main")+")())(self);");var r=new window.Blob([n],{type:"text/javascript"}),v=window.URL||window.webkitURL||window.mozURL||window.msURL,E=v.createObjectURL(r),f=new window.Worker(E);return f.objectURL=E,f}},"./src/errors.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{ErrorDetails:()=>O,ErrorTypes:()=>k});var k;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(k||(k={}));var O;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",B.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",B.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",B.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",B.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(O||(O={}))},"./src/events.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{Events:()=>k});var k;(function(O){O.MEDIA_ATTACHING="hlsMediaAttaching",O.MEDIA_ATTACHED="hlsMediaAttached",O.MEDIA_DETACHING="hlsMediaDetaching",O.MEDIA_DETACHED="hlsMediaDetached",O.BUFFER_RESET="hlsBufferReset",O.BUFFER_CODECS="hlsBufferCodecs",O.BUFFER_CREATED="hlsBufferCreated",O.BUFFER_APPENDING="hlsBufferAppending",O.BUFFER_APPENDED="hlsBufferAppended",O.BUFFER_EOS="hlsBufferEos",O.BUFFER_FLUSHING="hlsBufferFlushing",O.BUFFER_FLUSHED="hlsBufferFlushed",O.MANIFEST_LOADING="hlsManifestLoading",O.MANIFEST_LOADED="hlsManifestLoaded",O.MANIFEST_PARSED="hlsManifestParsed",O.LEVEL_SWITCHING="hlsLevelSwitching",O.LEVEL_SWITCHED="hlsLevelSwitched",O.LEVEL_LOADING="hlsLevelLoading",O.LEVEL_LOADED="hlsLevelLoaded",O.LEVEL_UPDATED="hlsLevelUpdated",O.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",O.LEVELS_UPDATED="hlsLevelsUpdated",O.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",O.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",O.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",O.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",O.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",O.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",O.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",O.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",O.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",O.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",O.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",O.CUES_PARSED="hlsCuesParsed",O.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",O.INIT_PTS_FOUND="hlsInitPtsFound",O.FRAG_LOADING="hlsFragLoading",O.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",O.FRAG_LOADED="hlsFragLoaded",O.FRAG_DECRYPTED="hlsFragDecrypted",O.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",O.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",O.FRAG_PARSING_METADATA="hlsFragParsingMetadata",O.FRAG_PARSED="hlsFragParsed",O.FRAG_BUFFERED="hlsFragBuffered",O.FRAG_CHANGED="hlsFragChanged",O.FPS_DROP="hlsFpsDrop",O.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",O.ERROR="hlsError",O.DESTROYING="hlsDestroying",O.KEY_LOADING="hlsKeyLoading",O.KEY_LOADED="hlsKeyLoaded",O.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",O.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>L});var k=C("./node_modules/url-toolkit/src/url-toolkit.js"),O=C.n(k),B=C("./src/loader/playlist-loader.ts"),e=C("./src/controller/id3-track-controller.ts"),I=C("./src/controller/latency-controller.ts"),w=C("./src/controller/level-controller.ts"),u=C("./src/controller/fragment-tracker.ts"),p=C("./src/loader/key-loader.ts"),c=C("./src/controller/stream-controller.ts"),m=C("./src/is-supported.ts"),l=C("./src/utils/logger.ts"),g=C("./src/config.ts"),_=C("./node_modules/eventemitter3/index.js"),o=C.n(_),s=C("./src/events.ts"),n=C("./src/errors.ts"),r=C("./src/types/level.ts");function v(A,D){for(var a=0;a<D.length;a++){var i=D[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,f(i.key),i)}}function E(A,D,a){return D&&v(A.prototype,D),a&&v(A,a),Object.defineProperty(A,"prototype",{writable:!1}),A}function f(A){var D=S(A,"string");return typeof D=="symbol"?D:String(D)}function S(A,D){if(typeof A!="object"||A===null)return A;var a=A[Symbol.toPrimitive];if(a!==void 0){var i=a.call(A,D||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(A)}var L=function(){A.isSupported=function(){return(0,m.isSupported)()};function A(a){a===void 0&&(a={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new _.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,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 i=this.config=(0,g.mergeConfig)(A.DefaultConfig,a);this.userConfig=a,(0,l.enableLogs)(i.debug,"Hls instance"),this._autoLevelCapping=-1,i.progressive&&(0,g.enableStreamingMode)(i);var t=i.abrController,h=i.bufferController,b=i.capLevelController,T=i.fpsController,y=this.abrController=new t(this),d=this.bufferController=new h(this),R=this.capLevelController=new b(this),M=new T(this),F=new B.default(this),U=new e.default(this),V=this.levelController=new w.default(this),re=new u.FragmentTracker(this),$=new p.default(this.config),le=this.streamController=new c.default(this,re,$);R.setStreamController(le),M.setStreamController(le);var te=[F,V,le];this.networkControllers=te;var _e=[y,d,R,M,U,re];this.audioTrackController=this.createController(i.audioTrackController,te);var fe=i.audioStreamController;fe&&te.push(new fe(this,re,$)),this.subtitleTrackController=this.createController(i.subtitleTrackController,te);var me=i.subtitleStreamController;me&&te.push(new me(this,re,$)),this.createController(i.timelineController,_e),$.emeController=this.emeController=this.createController(i.emeController,_e),this.cmcdController=this.createController(i.cmcdController,_e),this.latencyController=this.createController(I.default,_e),this.coreComponents=_e}var D=A.prototype;return D.createController=function(i,t){if(i){var h=new i(this);return t&&t.push(h),h}return null},D.on=function(i,t,h){h===void 0&&(h=this),this._emitter.on(i,t,h)},D.once=function(i,t,h){h===void 0&&(h=this),this._emitter.once(i,t,h)},D.removeAllListeners=function(i){this._emitter.removeAllListeners(i)},D.off=function(i,t,h,b){h===void 0&&(h=this),this._emitter.off(i,t,h,b)},D.listeners=function(i){return this._emitter.listeners(i)},D.emit=function(i,t,h){return this._emitter.emit(i,t,h)},D.trigger=function(i,t){if(this.config.debug)return this.emit(i,i,t);try{return this.emit(i,i,t)}catch(h){l.logger.error("An internal error happened while handling event "+i+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(s.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:i,error:h})}return!1},D.listenerCount=function(i){return this._emitter.listenerCount(i)},D.destroy=function(){l.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(i){return i.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(i){return i.destroy()}),this.coreComponents.length=0},D.attachMedia=function(i){l.logger.log("attachMedia"),this._media=i,this.trigger(s.Events.MEDIA_ATTACHING,{media:i})},D.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(i){this.stopLoad();var t=this.media,h=this.url,b=this.url=k.buildAbsoluteURL(self.location.href,i,{alwaysNormalize:!0});l.logger.log("loadSource:"+b),t&&h&&h!==b&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(s.Events.MANIFEST_LOADING,{url:i})},D.startLoad=function(i){i===void 0&&(i=-1),l.logger.log("startLoad("+i+")"),this.networkControllers.forEach(function(t){t.startLoad(i)})},D.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(i){i.stopLoad()})},D.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){l.logger.log("recoverMediaError");var i=this._media;this.detachMedia(),i&&this.attachMedia(i)},D.removeLevel=function(i,t){t===void 0&&(t=0),this.levelController.removeLevel(i,t)},E(A,[{key:"levels",get:function(){var i=this.levelController.levels;return i||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(i){l.logger.log("set currentLevel:"+i),this.loadLevel=i,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(i){l.logger.log("set nextLevel:"+i),this.levelController.manualLevel=i,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(i){l.logger.log("set loadLevel:"+i),this.levelController.manualLevel=i}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(i){this.levelController.nextLoadLevel=i}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(i){l.logger.log("set firstLevel:"+i),this.levelController.firstLevel=i}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(i){l.logger.log("set startLevel:"+i),i!==-1&&(i=Math.max(i,this.minAutoLevel)),this.levelController.startLevel=i}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(i){var t=!!i;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(i){this._autoLevelCapping!==i&&(l.logger.log("set autoLevelCapping:"+i),this._autoLevelCapping=i)}},{key:"bandwidthEstimate",get:function(){var i=this.abrController.bwEstimator;return i?i.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(i){r.HdcpLevels.indexOf(i)>-1&&(this._maxHdcpLevel=i)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var i=this.levels,t=this.config.minAutoBitrate;if(!i)return 0;for(var h=i.length,b=0;b<h;b++)if(i[b].maxBitrate>=t)return b;return 0}},{key:"maxAutoLevel",get:function(){var i=this.levels,t=this.autoLevelCapping,h=this.maxHdcpLevel,b;if(t===-1&&i&&i.length?b=i.length-1:b=t,h)for(var T=b;T--;){var y=i[T].attrs["HDCP-LEVEL"];if(y&&y<=h)return T}return b}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(i){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,i)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var i=this.audioTrackController;return i?i.audioTracks:[]}},{key:"audioTrack",get:function(){var i=this.audioTrackController;return i?i.audioTrack:-1},set:function(i){var t=this.audioTrackController;t&&(t.audioTrack=i)}},{key:"subtitleTracks",get:function(){var i=this.subtitleTrackController;return i?i.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var i=this.subtitleTrackController;return i?i.subtitleTrack:-1},set:function(i){var t=this.subtitleTrackController;t&&(t.subtitleTrack=i)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var i=this.subtitleTrackController;return i?i.subtitleDisplay:!1},set:function(i){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=i)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(i){this.config.lowLatencyMode=i}},{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.3.5"}},{key:"Events",get:function(){return s.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return A.defaultConfig?A.defaultConfig:g.hlsDefaultConfig},set:function(i){A.defaultConfig=i}}]),A}();L.defaultConfig=void 0},"./src/is-supported.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{changeTypeSupported:()=>e,isSupported:()=>B});var k=C("./src/utils/mediasource-helper.ts");function O(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var I=(0,k.getMediaSource)();if(!I)return!1;var w=O(),u=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!w||w.prototype&&typeof w.prototype.appendBuffer=="function"&&typeof w.prototype.remove=="function";return!!u&&!!p}function e(){var I,w=O();return typeof(w==null||(I=w.prototype)===null||I===void 0?void 0:I.changeType)=="function"}},"./src/loader/date-range.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{DateRange:()=>m,DateRangeAttribute:()=>c});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/attr-list.ts"),B=C("./src/utils/logger.ts");function e(){return e=Object.assign?Object.assign.bind():function(l){for(var g=1;g<arguments.length;g++){var _=arguments[g];for(var o in _)Object.prototype.hasOwnProperty.call(_,o)&&(l[o]=_[o])}return l},e.apply(this,arguments)}function I(l,g){for(var _=0;_<g.length;_++){var o=g[_];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,u(o.key),o)}}function w(l,g,_){return g&&I(l.prototype,g),_&&I(l,_),Object.defineProperty(l,"prototype",{writable:!1}),l}function u(l){var g=p(l,"string");return typeof g=="symbol"?g:String(g)}function p(l,g){if(typeof l!="object"||l===null)return l;var _=l[Symbol.toPrimitive];if(_!==void 0){var o=_.call(l,g||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(l)}var c;(function(l){l.ID="ID",l.CLASS="CLASS",l.START_DATE="START-DATE",l.DURATION="DURATION",l.END_DATE="END-DATE",l.END_ON_NEXT="END-ON-NEXT",l.PLANNED_DURATION="PLANNED-DURATION",l.SCTE35_OUT="SCTE35-OUT",l.SCTE35_IN="SCTE35-IN"})(c||(c={}));var m=function(){function l(g,_){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,_){var o=_.attr;for(var s in o)if(Object.prototype.hasOwnProperty.call(g,s)&&g[s]!==o[s]){B.logger.warn('DATERANGE tag attribute: "'+s+'" does not match for tags with ID: "'+g.ID+'"'),this._badValueForSameId=s;break}g=e(new O.AttrList({}),o,g)}if(this.attr=g,this._startDate=new Date(g[c.START_DATE]),c.END_DATE in this.attr){var n=new Date(this.attr[c.END_DATE]);(0,k.isFiniteNumber)(n.getTime())&&(this._endDate=n)}}return w(l,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var _=this.duration;return _!==null?new Date(this._startDate.getTime()+_*1e3):null}},{key:"duration",get:function(){if(c.DURATION in this.attr){var _=this.attr.decimalFloatingPoint(c.DURATION);if((0,k.isFiniteNumber)(_))return _}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return c.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(c.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(c.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,k.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),l}()},"./src/loader/fragment-loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{LoadError:()=>_,default:()=>l});var k=C("./src/polyfills/number.ts"),O=C("./src/errors.ts");function B(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,p(o,s)}function e(o){var s=typeof Map=="function"?new Map:void 0;return e=function(r){if(r===null||!u(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(r))return s.get(r);s.set(r,v)}function v(){return I(r,arguments,c(this).constructor)}return v.prototype=Object.create(r.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p(v,r)},e(o)}function I(o,s,n){return w()?I=Reflect.construct.bind():I=function(v,E,f){var S=[null];S.push.apply(S,E);var L=Function.bind.apply(v,S),A=new L;return f&&p(A,f.prototype),A},I.apply(null,arguments)}function w(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function u(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function p(o,s){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,v){return r.__proto__=v,r},p(o,s)}function c(o){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},c(o)}var m=Math.pow(2,17),l=function(){function o(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var s=o.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(r,v){var E=this,f=r.url;if(!f)return Promise.reject(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var S=this.config,L=S.fLoader,A=S.loader;return new Promise(function(D,a){E.loader&&E.loader.destroy();var i=E.loader=r.loader=L?new L(S):new A(S),t=g(r),h={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:r.sn==="initSegment"?1/0:m};r.stats=i.stats,i.load(t,h,{onSuccess:function(T,y,d,R){E.resetLoader(r,i);var M=T.data;d.resetIV&&r.decryptdata&&(r.decryptdata.iv=new Uint8Array(M.slice(0,16)),M=M.slice(16)),D({frag:r,part:null,payload:M,networkDetails:R})},onError:function(T,y,d){E.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,response:T,networkDetails:d}))},onAbort:function(T,y,d){E.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,networkDetails:d}))},onTimeout:function(T,y,d){E.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,networkDetails:d}))},onProgress:function(T,y,d,R){v&&v({frag:r,part:null,payload:d,networkDetails:R})}})})},s.loadPart=function(r,v,E){var f=this;this.abort();var S=this.config,L=S.fLoader,A=S.loader;return new Promise(function(D,a){f.loader&&f.loader.destroy();var i=f.loader=r.loader=L?new L(S):new A(S),t=g(r,v),h={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:m};v.stats=i.stats,i.load(t,h,{onSuccess:function(T,y,d,R){f.resetLoader(r,i),f.updateStatsFromPart(r,v);var M={frag:r,part:v,payload:T.data,networkDetails:R};E(M),D(M)},onError:function(T,y,d){f.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,part:v,response:T,networkDetails:d}))},onAbort:function(T,y,d){r.stats.aborted=v.stats.aborted,f.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,part:v,networkDetails:d}))},onTimeout:function(T,y,d){f.resetLoader(r,i),a(new _({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,part:v,networkDetails:d}))}})})},s.updateStatsFromPart=function(r,v){var E=r.stats,f=v.stats,S=f.total;if(E.loaded+=f.loaded,S){var L=Math.round(r.duration/v.duration),A=Math.min(Math.round(E.loaded/S),L),D=L-A,a=D*Math.round(E.loaded/A);E.total=E.loaded+a}else E.total=Math.max(E.loaded,E.total);var i=E.loading,t=f.loading;i.start?i.first+=t.first-t.start:(i.start=t.start,i.first=t.first),i.end=t.end},s.resetLoader=function(r,v){r.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},o}();function g(o,s){s===void 0&&(s=null);var n=s||o,r={frag:o,part:s,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},v=n.byteRangeStartOffset,E=n.byteRangeEndOffset;if((0,k.isFiniteNumber)(v)&&(0,k.isFiniteNumber)(E)){var f,S=v,L=E;if(o.sn==="initSegment"&&((f=o.decryptdata)===null||f===void 0?void 0:f.method)==="AES-128"){var A=E-v;A%16&&(L=E+(16-A%16)),v!==0&&(r.resetIV=!0,S=v-16)}r.rangeStart=S,r.rangeEnd=L}return r}var _=function(o){B(s,o);function s(n){for(var r,v=arguments.length,E=new Array(v>1?v-1:0),f=1;f<v;f++)E[f-1]=arguments[f];return r=o.call.apply(o,[this].concat(E))||this,r.data=void 0,r.data=n,r}return s}(e(Error))},"./src/loader/fragment.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{BaseSegment:()=>g,ElementaryStreamTypes:()=>l,Fragment:()=>_,Part:()=>o});var k=C("./src/polyfills/number.ts"),O=C("./node_modules/url-toolkit/src/url-toolkit.js"),B=C.n(O),e=C("./src/loader/load-stats.ts");function I(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,w(s,n)}function w(s,n){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,E){return v.__proto__=E,v},w(s,n)}function u(s,n){for(var r=0;r<n.length;r++){var v=n[r];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(s,c(v.key),v)}}function p(s,n,r){return n&&u(s.prototype,n),r&&u(s,r),Object.defineProperty(s,"prototype",{writable:!1}),s}function c(s){var n=m(s,"string");return typeof n=="symbol"?n:String(n)}function m(s,n){if(typeof s!="object"||s===null)return s;var r=s[Symbol.toPrimitive];if(r!==void 0){var v=r.call(s,n||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(s)}var l;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(l||(l={}));var g=function(){function s(r){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[l.AUDIO]=null,v[l.VIDEO]=null,v[l.AUDIOVIDEO]=null,v),this.baseurl=r}var n=s.prototype;return n.setByteRange=function(v,E){var f=v.split("@",2),S=[];f.length===1?S[0]=E?E.byteRangeEndOffset:0:S[0]=parseInt(f[1]),S[1]=parseInt(f[0])+S[0],this._byteRange=S},p(s,[{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=(0,O.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),s}(),_=function(s){I(n,s);function n(v,E){var f;return f=s.call(this,E)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkeys=void 0,f.type=void 0,f.loader=null,f.keyLoader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new e.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.endList=void 0,f.type=v,f}var r=n.prototype;return r.setKeyFormat=function(E){if(this.levelkeys){var f=this.levelkeys[E];f&&!this._decryptdata&&(this._decryptdata=f.getDecryptData(this.sn))}},r.abortRequests=function(){var E,f;(E=this.loader)===null||E===void 0||E.abort(),(f=this.keyLoader)===null||f===void 0||f.abort()},r.setElementaryStreamInfo=function(E,f,S,L,A,D){D===void 0&&(D=!1);var a=this.elementaryStreams,i=a[E];if(!i){a[E]={startPTS:f,endPTS:S,startDTS:L,endDTS:A,partial:D};return}i.startPTS=Math.min(i.startPTS,f),i.endPTS=Math.max(i.endPTS,S),i.startDTS=Math.min(i.startDTS,L),i.endDTS=Math.max(i.endDTS,A)},r.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[l.AUDIO]=null,E[l.VIDEO]=null,E[l.AUDIOVIDEO]=null},p(n,[{key:"decryptdata",get:function(){var E=this.levelkeys;if(!E&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var f=this.levelkeys.identity;if(f)this._decryptdata=f.getDecryptData(this.sn);else{var S=Object.keys(this.levelkeys);if(S.length===1)return this._decryptdata=this.levelkeys[S[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!(0,k.isFiniteNumber)(this.programDateTime))return null;var E=(0,k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;if((E=this._decryptdata)!==null&&E!==void 0&&E.encrypted)return!0;if(this.levelkeys){var f=Object.keys(this.levelkeys),S=f.length;if(S>1||S===1&&this.levelkeys[f[0]].encrypted)return!0}return!1}}]),n}(g),o=function(s){I(n,s);function n(r,v,E,f,S){var L;L=s.call(this,E)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new e.LoadStats,L.duration=r.decimalFloatingPoint("DURATION"),L.gap=r.bool("GAP"),L.independent=r.bool("INDEPENDENT"),L.relurl=r.enumeratedString("URI"),L.fragment=v,L.index=f;var A=r.enumeratedString("BYTERANGE");return A&&L.setByteRange(A,S),S&&(L.fragOffset=S.fragOffset+S.duration),L}return p(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),n}(g)},"./src/loader/key-loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>B});var k=C("./src/errors.ts"),O=C("./src/loader/fragment-loader.ts"),B=function(){function e(w){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=w}var I=e.prototype;return I.abort=function(){for(var u in this.keyUriToKeyInfo){var p=this.keyUriToKeyInfo[u].loader;p&&p.abort()}},I.detach=function(){for(var u in this.keyUriToKeyInfo){var p=this.keyUriToKeyInfo[u];(p.mediaKeySessionContext||p.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[u]}},I.destroy=function(){this.detach();for(var u in this.keyUriToKeyInfo){var p=this.keyUriToKeyInfo[u].loader;p&&p.destroy()}this.keyUriToKeyInfo={}},I.createKeyLoadError=function(u,p,c,m){return p===void 0&&(p=k.ErrorDetails.KEY_LOAD_ERROR),new O.LoadError({type:k.ErrorTypes.NETWORK_ERROR,details:p,fatal:!1,frag:u,networkDetails:c})},I.loadClear=function(u,p){var c=this;if(this.emeController&&this.config.emeEnabled)for(var m=u.sn,l=u.cc,g=function(n){var r=p[n];if(l<=r.cc&&(m==="initSegment"||m<r.sn))return c.emeController.selectKeySystemFormat(r).then(function(v){r.setKeyFormat(v)}),"break"},_=0;_<p.length;_++){var o=g(_);if(o==="break")break}},I.load=function(u){var p=this;return!u.decryptdata&&u.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(u).then(function(c){return p.loadInternal(u,c)}):this.loadInternal(u)},I.loadInternal=function(u,p){var c,m;p&&u.setKeyFormat(p);var l=u.decryptdata;if(!l){var g=p?"Expected frag.decryptdata to be defined after setting format "+p:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(u,k.ErrorDetails.KEY_LOAD_ERROR,null,g))}var _=l.uri;if(!_)return Promise.reject(this.createKeyLoadError(u,k.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+_+'"'));var o=this.keyUriToKeyInfo[_];if((c=o)!==null&&c!==void 0&&c.decryptdata.key)return l.key=o.decryptdata.key,Promise.resolve({frag:u,keyInfo:o});if((m=o)!==null&&m!==void 0&&m.keyLoadPromise){var s;switch((s=o.mediaKeySessionContext)===null||s===void 0?void 0:s.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(function(n){return l.key=n.keyInfo.decryptdata.key,{frag:u,keyInfo:o}})}}switch(o=this.keyUriToKeyInfo[_]={decryptdata:l,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},l.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return l.keyFormat==="identity"?this.loadKeyHTTP(o,u):this.loadKeyEME(o,u);case"AES-128":return this.loadKeyHTTP(o,u);default:return Promise.reject(this.createKeyLoadError(u,k.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+l.method+'"'))}},I.loadKeyEME=function(u,p){var c={frag:p,keyInfo:u};if(this.emeController&&this.config.emeEnabled){var m=this.emeController.loadKey(c);if(m)return(u.keyLoadPromise=m.then(function(l){return u.mediaKeySessionContext=l,c})).catch(function(l){throw u.keyLoadPromise=null,l})}return Promise.resolve(c)},I.loadKeyHTTP=function(u,p){var c=this,m=this.config,l=m.loader,g=new l(m);return p.keyLoader=u.loader=g,u.keyLoadPromise=new Promise(function(_,o){var s={keyInfo:u,frag:p,responseType:"arraybuffer",url:u.decryptdata.uri},n={timeout:m.fragLoadingTimeOut,maxRetry:0,retryDelay:m.fragLoadingRetryDelay,maxRetryDelay:m.fragLoadingMaxRetryTimeout,highWaterMark:0},r={onSuccess:function(E,f,S,L){var A=S.frag,D=S.keyInfo,a=S.url;if(!A.decryptdata||D!==c.keyUriToKeyInfo[a])return o(c.createKeyLoadError(A,k.ErrorDetails.KEY_LOAD_ERROR,L,"after key load, decryptdata unset or changed"));D.decryptdata.key=A.decryptdata.key=new Uint8Array(E.data),A.keyLoader=null,D.loader=null,_({frag:A,keyInfo:D})},onError:function(E,f,S){c.resetLoader(f),o(c.createKeyLoadError(p,k.ErrorDetails.KEY_LOAD_ERROR,S))},onTimeout:function(E,f,S){c.resetLoader(f),o(c.createKeyLoadError(p,k.ErrorDetails.KEY_LOAD_TIMEOUT,S))},onAbort:function(E,f,S){c.resetLoader(f),o(c.createKeyLoadError(p,k.ErrorDetails.INTERNAL_ABORTED,S))}};g.load(s,n,r)})},I.resetLoader=function(u){var p=u.frag,c=u.keyInfo,m=u.url,l=c.loader;p.keyLoader===l&&(p.keyLoader=null,c.loader=null),delete this.keyUriToKeyInfo[m],l&&l.destroy()},e}()},"./src/loader/level-details.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{LevelDetails:()=>u});var k=C("./src/polyfills/number.ts");function O(p,c){for(var m=0;m<c.length;m++){var l=c[m];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,e(l.key),l)}}function B(p,c,m){return c&&O(p.prototype,c),m&&O(p,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function e(p){var c=I(p,"string");return typeof c=="symbol"?c:String(c)}function I(p,c){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var l=m.call(p,c||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(p)}var w=10,u=function(){function p(m){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.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,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.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=m}var c=p.prototype;return c.reloaded=function(l){if(!l){this.advanced=!0,this.updated=!0;return}var g=this.lastPartSn-l.lastPartSn,_=this.lastPartIndex-l.lastPartIndex;this.updated=this.endSN!==l.endSN||!!_||!!g,this.advanced=this.endSN>l.endSN||g>0||g===0&&_>0,this.updated||this.advanced?this.misses=Math.floor(l.misses*.6):this.misses=l.misses+1,this.availabilityDelay=l.availabilityDelay},B(p,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||w}},{key:"drift",get:function(){var l=this.driftEndTime-this.driftStartTime;if(l>0){var g=this.driftEnd-this.driftStart;return g*1e3/l}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var l;return(l=this.fragments)!==null&&l!==void 0&&l.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 l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),p}()},"./src/loader/level-key.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{LevelKey:()=>u});var k=C("./src/utils/keysystem-util.ts"),O=C("./src/utils/mediakeys-helper.ts"),B=C("./src/utils/mp4-tools.ts"),e=C("./src/utils/logger.ts"),I=C("./src/utils/numeric-encoding-utils.ts"),w={},u=function(){c.clearKeyUriToKeyIdMap=function(){w={}};function c(l,g,_,o,s){o===void 0&&(o=[1]),s===void 0&&(s=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=l,this.uri=g,this.keyFormat=_,this.keyFormatVersions=o,this.iv=s,this.encrypted=l?l!=="NONE":!1,this.isCommonEncryption=this.encrypted&&l!=="AES-128"}var m=c.prototype;return m.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case O.KeySystemFormats.FAIRPLAY:case O.KeySystemFormats.WIDEVINE:case O.KeySystemFormats.PLAYREADY:case O.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},m.getDecryptData=function(g){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof g!="number"&&(this.method==="AES-128"&&!this.iv&&e.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),g=0);var _=p(g),o=new c(this.method,this.uri,"identity",this.keyFormatVersions,_);return o}var s=(0,k.convertDataUriToArrayBytes)(this.uri);if(s)switch(this.keyFormat){case O.KeySystemFormats.WIDEVINE:this.pssh=s,s.length>=22&&(this.keyId=s.subarray(s.length-22,s.length-6));break;case O.KeySystemFormats.PLAYREADY:{var n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,B.mp4pssh)(n,null,s);var r=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),v=String.fromCharCode.apply(null,Array.from(r)),E=v.substring(v.indexOf("<"),v.length),f=new DOMParser,S=f.parseFromString(E,"text/xml"),L=S.getElementsByTagName("KID")[0];if(L){var A=L.childNodes[0]?L.childNodes[0].nodeValue:L.getAttribute("VALUE");if(A){var D=(0,I.base64Decode)(A).subarray(0,16);(0,k.changeEndianness)(D),this.keyId=D}}break}default:{var a=s.subarray(0,16);if(a.length!==16){var i=new Uint8Array(16);i.set(a,16-a.length),a=i}this.keyId=a;break}}if(!this.keyId||this.keyId.byteLength!==16){var t=w[this.uri];if(!t){var h=Object.keys(w).length%Number.MAX_SAFE_INTEGER;t=new Uint8Array(16);var b=new DataView(t.buffer,12,4);b.setUint32(0,h),w[this.uri]=t}this.keyId=t}return this},c}();function p(c){for(var m=new Uint8Array(16),l=12;l<16;l++)m[l]=c>>8*(15-l)&255;return m}},"./src/loader/load-stats.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{LoadStats:()=>k});var k=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":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>n});var k=C("./src/polyfills/number.ts"),O=C("./node_modules/url-toolkit/src/url-toolkit.js"),B=C.n(O),e=C("./src/loader/date-range.ts"),I=C("./src/loader/fragment.ts"),w=C("./src/loader/level-details.ts"),u=C("./src/loader/level-key.ts"),p=C("./src/utils/attr-list.ts"),c=C("./src/utils/logger.ts"),m=C("./src/utils/codecs.ts");function l(){return l=Object.assign?Object.assign.bind():function(D){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(D[t]=i[t])}return D},l.apply(this,arguments)}var g=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,_=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),n=function(){function D(){}return D.findGroup=function(i,t){for(var h=0;h<i.length;h++){var b=i[h];if(b.id===t)return b}},D.convertAVC1ToAVCOTI=function(i){var t=i.split(".");if(t.length>2){var h=t.shift()+".";return h+=parseInt(t.shift()).toString(16),h+=("000"+parseInt(t.shift()).toString(16)).slice(-4),h}return i},D.resolve=function(i,t){return(0,O.buildAbsoluteURL)(t,i,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(i,t){var h=[],b=[],T={},y=[],d=!1;g.lastIndex=0;for(var R;(R=g.exec(i))!=null;)if(R[1]){var M,F=new p.AttrList(R[1]),U={attrs:F,bitrate:F.decimalInteger("AVERAGE-BANDWIDTH")||F.decimalInteger("BANDWIDTH"),name:F.NAME,url:D.resolve(R[2],t)},V=F.decimalResolution("RESOLUTION");V&&(U.width=V.width,U.height=V.height),v((F.CODECS||"").split(/[ ,]+/).filter(function(_e){return _e}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=D.convertAVC1ToAVCOTI(U.videoCodec)),(M=U.unknownCodecs)!==null&&M!==void 0&&M.length||b.push(U),h.push(U)}else if(R[3]){var re=new p.AttrList(R[3]);re["DATA-ID"]&&(d=!0,T[re["DATA-ID"]]=re)}else if(R[4]){var $=R[4],le=r($,t);le.encrypted&&le.isSupported()?y.push(le):c.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+$+'"')}var te=b.length>0&&b.length<h.length;return{levels:te?b:h,sessionData:d?T:null,sessionKeys:y.length?y:null}},D.parseMasterPlaylistMedia=function(i,t,h,b){b===void 0&&(b=[]);var T,y=[],d=0;for(_.lastIndex=0;(T=_.exec(i))!==null;){var R=new p.AttrList(T[1]);if(R.TYPE===h){var M={attrs:R,bitrate:0,id:d++,groupId:R["GROUP-ID"],instreamId:R["INSTREAM-ID"],name:R.NAME||R.LANGUAGE||"",type:h,default:R.bool("DEFAULT"),autoselect:R.bool("AUTOSELECT"),forced:R.bool("FORCED"),lang:R.LANGUAGE,url:R.URI?D.resolve(R.URI,t):""};if(b.length){var F=D.findGroup(b,M.groupId)||b[0];E(M,F,"audioCodec"),E(M,F,"textCodec")}y.push(M)}}return y},D.parseLevelPlaylist=function(i,t,h,b,T){var y=new w.LevelDetails(t),d=y.fragments,R=null,M=0,F=0,U=0,V=0,re=null,$=new I.Fragment(b,t),le,te,_e,fe=-1,me=!1;for(o.lastIndex=0,y.m3u8=i;(le=o.exec(i))!==null;){me&&(me=!1,$=new I.Fragment(b,t),$.start=U,$.sn=M,$.cc=V,$.level=h,R&&($.initSegment=R,$.rawProgramDateTime=R.rawProgramDateTime,R.rawProgramDateTime=null));var Ae=le[1];if(Ae){$.duration=parseFloat(Ae);var Be=(" "+le[2]).slice(1);$.title=Be||null,$.tagList.push(Be?["INF",Ae,Be]:["INF",Ae])}else if(le[3])(0,k.isFiniteNumber)($.duration)&&($.start=U,_e&&A($,_e,y),$.sn=M,$.level=h,$.cc=V,$.urlId=T,d.push($),$.relurl=(" "+le[3]).slice(1),S($,re),re=$,U+=$.duration,M++,F=0,me=!0);else if(le[4]){var Le=(" "+le[4]).slice(1);re?$.setByteRange(Le,re):$.setByteRange(Le)}else if(le[5])$.rawProgramDateTime=(" "+le[5]).slice(1),$.tagList.push(["PROGRAM-DATE-TIME",$.rawProgramDateTime]),fe===-1&&(fe=d.length);else{if(le=le[0].match(s),!le){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(te=1;te<le.length&&typeof le[te]=="undefined";te++);var Ie=(" "+le[te]).slice(1),pe=(" "+le[te+1]).slice(1),Ke=le[te+2]?(" "+le[te+2]).slice(1):"";switch(Ie){case"PLAYLIST-TYPE":y.type=pe.toUpperCase();break;case"MEDIA-SEQUENCE":M=y.startSN=parseInt(pe);break;case"SKIP":{var Ce=new p.AttrList(pe),ie=Ce.decimalInteger("SKIPPED-SEGMENTS");if((0,k.isFiniteNumber)(ie)){y.skippedSegments=ie;for(var X=ie;X--;)d.unshift(null);M+=ie}var q=Ce.enumeratedString("RECENTLY-REMOVED-DATERANGES");q&&(y.recentlyRemovedDateranges=q.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(pe);break;case"VERSION":y.version=parseInt(pe);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(pe||Ke)&&$.tagList.push(Ke?[pe,Ke]:[pe]);break;case"DISCONTINUITY":V++,$.tagList.push(["DIS"]);break;case"GAP":$.tagList.push([Ie]);break;case"BITRATE":$.tagList.push([Ie,pe]);break;case"DATERANGE":{var ue=new p.AttrList(pe),ee=new e.DateRange(ue,y.dateRanges[ue.ID]);ee.isValid||y.skippedSegments?y.dateRanges[ee.id]=ee:c.logger.warn('Ignoring invalid DATERANGE tag: "'+pe+'"'),$.tagList.push(["EXT-X-DATERANGE",pe]);break}case"DISCONTINUITY-SEQUENCE":V=parseInt(pe);break;case"KEY":{var z=r(pe,t);if(z.isSupported()){if(z.method==="NONE"){_e=void 0;break}_e||(_e={}),_e[z.keyFormat]&&(_e=l({},_e)),_e[z.keyFormat]=z}else c.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+pe+'"');break}case"START":{var ne=new p.AttrList(pe),ce=ne.decimalFloatingPoint("TIME-OFFSET");(0,k.isFiniteNumber)(ce)&&(y.startTimeOffset=ce);break}case"MAP":{var ge=new p.AttrList(pe);if($.duration){var ke=new I.Fragment(b,t);L(ke,ge,h,_e),R=ke,$.initSegment=R,R.rawProgramDateTime&&!$.rawProgramDateTime&&($.rawProgramDateTime=R.rawProgramDateTime)}else L($,ge,h,_e),R=$,me=!0;break}case"SERVER-CONTROL":{var $e=new p.AttrList(pe);y.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),y.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ft=new p.AttrList(pe);y.partTarget=ft.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ne=y.partList;Ne||(Ne=y.partList=[]);var Re=F>0?Ne[Ne.length-1]:void 0,xe=F++,Ue=new I.Part(new p.AttrList(pe),$,t,xe,Re);Ne.push(Ue),$.duration+=Ue.duration;break}case"PRELOAD-HINT":{var ye=new p.AttrList(pe);y.preloadHint=ye;break}case"RENDITION-REPORT":{var it=new p.AttrList(pe);y.renditionReports=y.renditionReports||[],y.renditionReports.push(it);break}default:c.logger.warn("line parsed but not handled: "+le);break}}}re&&!re.relurl?(d.pop(),U-=re.duration,y.partList&&(y.fragmentHint=re)):y.partList&&(S($,re),$.cc=V,y.fragmentHint=$,_e&&A($,_e,y));var rt=d.length,tt=d[0],We=d[rt-1];if(U+=y.skippedSegments*y.targetduration,U>0&&rt&&We){y.averagetargetduration=U/rt;var ot=We.sn;y.endSN=ot!=="initSegment"?ot:0,y.live||(We.endList=!0),tt&&(y.startCC=tt.cc)}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(U+=y.fragmentHint.duration),y.totalduration=U,y.endCC=V,fe>0&&f(d,fe),y},D}();function r(D,a){var i,t,h=new p.AttrList(D),b=(i=h.enumeratedString("METHOD"))!=null?i:"",T=h.URI,y=h.hexadecimalInteger("IV"),d=h.enumeratedString("KEYFORMATVERSIONS"),R=(t=h.enumeratedString("KEYFORMAT"))!=null?t:"identity";T&&h.IV&&!y&&c.logger.error("Invalid IV: "+h.IV);var M=T?n.resolve(T,a):"",F=(d||"1").split("/").map(Number).filter(Number.isFinite);return new u.LevelKey(b,M,R,F,y)}function v(D,a){["video","audio","text"].forEach(function(i){var t=D.filter(function(b){return(0,m.isCodecType)(b,i)});if(t.length){var h=t.filter(function(b){return b.lastIndexOf("avc1",0)===0||b.lastIndexOf("mp4a",0)===0});a[i+"Codec"]=h.length>0?h[0]:t[0],D=D.filter(function(b){return t.indexOf(b)===-1})}}),a.unknownCodecs=D}function E(D,a,i){var t=a[i];t&&(D[i]=t)}function f(D,a){for(var i=D[a],t=a;t--;){var h=D[t];if(!h)return;h.programDateTime=i.programDateTime-h.duration*1e3,i=h}}function S(D,a){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):a!=null&&a.programDateTime&&(D.programDateTime=a.endProgramDateTime),(0,k.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}function L(D,a,i,t){D.relurl=a.URI,a.BYTERANGE&&D.setByteRange(a.BYTERANGE),D.level=i,D.sn="initSegment",t&&(D.levelkeys=t),D.initSegment=null}function A(D,a,i){D.levelkeys=a;var t=i.encryptedFragments;(!t.length||t[t.length-1].levelkeys!==a)&&Object.keys(a).some(function(h){return a[h].isCommonEncryption})&&t.push(D)}},"./src/loader/playlist-loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>l});var k=C("./src/polyfills/number.ts"),O=C("./src/events.ts"),B=C("./src/errors.ts"),e=C("./src/utils/logger.ts"),I=C("./src/loader/m3u8-parser.ts"),w=C("./src/types/loader.ts"),u=C("./src/utils/attr-list.ts");function p(g){var _=g.type;switch(_){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function c(g,_){var o=g.url;return(o===void 0||o.indexOf("data:")===0)&&(o=_.url),o}var m=function(){function g(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var _=g.prototype;return _.startLoad=function(s){},_.stopLoad=function(){this.destroyInternalLoaders()},_.registerListeners=function(){var s=this.hls;s.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(O.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},_.unregisterListeners=function(){var s=this.hls;s.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(O.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},_.createInternalLoader=function(s){var n=this.hls.config,r=n.pLoader,v=n.loader,E=r||v,f=new E(n);return s.loader=f,this.loaders[s.type]=f,f},_.getInternalLoader=function(s){return this.loaders[s.type]},_.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},_.destroyInternalLoaders=function(){for(var s in this.loaders){var n=this.loaders[s];n&&n.destroy(),this.resetInternalLoader(s)}},_.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},_.onManifestLoading=function(s,n){var r=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},_.onLevelLoading=function(s,n){var r=n.id,v=n.level,E=n.url,f=n.deliveryDirectives;this.load({id:r,groupId:null,level:v,responseType:"text",type:w.PlaylistContextType.LEVEL,url:E,deliveryDirectives:f})},_.onAudioTrackLoading=function(s,n){var r=n.id,v=n.groupId,E=n.url,f=n.deliveryDirectives;this.load({id:r,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:f})},_.onSubtitleTrackLoading=function(s,n){var r=n.id,v=n.groupId,E=n.url,f=n.deliveryDirectives;this.load({id:r,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:f})},_.load=function(s){var n,r=this.hls.config,v=this.getInternalLoader(s);if(v){var E=v.context;if(E&&E.url===s.url){e.logger.trace("[playlist-loader]: playlist request ongoing");return}e.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),v.abort()}var f,S,L,A;switch(s.type){case w.PlaylistContextType.MANIFEST:f=r.manifestLoadingMaxRetry,S=r.manifestLoadingTimeOut,L=r.manifestLoadingRetryDelay,A=r.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:f=0,S=r.levelLoadingTimeOut;break;default:f=r.levelLoadingMaxRetry,S=r.levelLoadingTimeOut,L=r.levelLoadingRetryDelay,A=r.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(s),(n=s.deliveryDirectives)!==null&&n!==void 0&&n.part){var D;if(s.type===w.PlaylistContextType.LEVEL&&s.level!==null?D=this.hls.levels[s.level].details:s.type===w.PlaylistContextType.AUDIO_TRACK&&s.id!==null?D=this.hls.audioTracks[s.id].details:s.type===w.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(D=this.hls.subtitleTracks[s.id].details),D){var a=D.partTarget,i=D.targetduration;a&&i&&(S=Math.min(Math.max(a*3,i*.8)*1e3,S))}}var t={timeout:S,maxRetry:f,retryDelay:L,maxRetryDelay:A,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(s,t,h)},_.loadsuccess=function(s,n,r,v){v===void 0&&(v=null),this.resetInternalLoader(r.type);var E=s.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,r,"no EXTM3U delimiter",v);return}n.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,n,r,v):this.handleMasterPlaylist(s,n,r,v)},_.loaderror=function(s,n,r){r===void 0&&(r=null),this.handleNetworkError(n,r,!1,s)},_.loadtimeout=function(s,n,r){r===void 0&&(r=null),this.handleNetworkError(n,r,!0)},_.handleMasterPlaylist=function(s,n,r,v){var E=this.hls,f=s.data,S=c(s,r),L=I.default.parseMasterPlaylist(f,S),A=L.levels,D=L.sessionData,a=L.sessionKeys;if(!A.length){this.handleManifestParsingError(s,r,"no level found in manifest",v);return}var i=A.map(function(d){return{id:d.attrs.AUDIO,audioCodec:d.audioCodec}}),t=A.map(function(d){return{id:d.attrs.SUBTITLES,textCodec:d.textCodec}}),h=I.default.parseMasterPlaylistMedia(f,S,"AUDIO",i),b=I.default.parseMasterPlaylistMedia(f,S,"SUBTITLES",t),T=I.default.parseMasterPlaylistMedia(f,S,"CLOSED-CAPTIONS");if(h.length){var y=h.some(function(d){return!d.url});!y&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(e.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),h.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))}E.trigger(O.Events.MANIFEST_LOADED,{levels:A,audioTracks:h,subtitles:b,captions:T,url:S,stats:n,networkDetails:v,sessionData:D,sessionKeys:a})},_.handleTrackOrLevelPlaylist=function(s,n,r,v){var E=this.hls,f=r.id,S=r.level,L=r.type,A=c(s,r),D=(0,k.isFiniteNumber)(f)?f:0,a=(0,k.isFiniteNumber)(S)?S:D,i=p(r),t=I.default.parseLevelPlaylist(s.data,A,a,i,D);if(!t.fragments.length){E.trigger(O.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof r.level=="number"?r.level:void 0});return}if(L===w.PlaylistContextType.MANIFEST){var h={attrs:new u.AttrList({}),bitrate:0,details:t,name:"",url:A};E.trigger(O.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:A,stats:n,networkDetails:v,sessionData:null,sessionKeys:null})}n.parsing.end=performance.now(),r.levelDetails=t,this.handlePlaylistLoaded(s,n,r,v)},_.handleManifestParsingError=function(s,n,r,v){this.hls.trigger(O.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===w.PlaylistContextType.MANIFEST,url:s.url,reason:r,response:s,context:n,networkDetails:v})},_.handleNetworkError=function(s,n,r,v){r===void 0&&(r=!1),e.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var E=B.ErrorDetails.UNKNOWN,f=!1,S=this.getInternalLoader(s);switch(s.type){case w.PlaylistContextType.MANIFEST:E=r?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case w.PlaylistContextType.LEVEL:E=r?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case w.PlaylistContextType.AUDIO_TRACK:E=r?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:E=r?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}S&&this.resetInternalLoader(s.type);var L={type:B.ErrorTypes.NETWORK_ERROR,details:E,fatal:f,url:s.url,loader:S,context:s,networkDetails:n};v&&(L.response=v),this.hls.trigger(O.Events.ERROR,L)},_.handlePlaylistLoaded=function(s,n,r,v){var E=r.type,f=r.level,S=r.id,L=r.groupId,A=r.loader,D=r.levelDetails,a=r.deliveryDirectives;if(!(D!=null&&D.targetduration)){this.handleManifestParsingError(s,r,"invalid target duration",v);return}if(A)switch(D.live&&(A.getCacheAge&&(D.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(D.ageHeader))&&(D.ageHeader=0)),E){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(O.Events.LEVEL_LOADED,{details:D,level:f||0,id:S||0,stats:n,networkDetails:v,deliveryDirectives:a});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(O.Events.AUDIO_TRACK_LOADED,{details:D,id:S||0,groupId:L||"",stats:n,networkDetails:v,deliveryDirectives:a});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(O.Events.SUBTITLE_TRACK_LOADED,{details:D,id:S||0,groupId:L||"",stats:n,networkDetails:v,deliveryDirectives:a});break}},g}();const l=m},"./src/polyfills/number.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{MAX_SAFE_INTEGER:()=>O,isFiniteNumber:()=>k});var k=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},O=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k=function(){function B(){}return B.getSilentFrame=function(I,w){switch(I){case"mp4a.40.2":if(w===1)return new Uint8Array([0,200,0,128,35,128]);if(w===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(w===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(w===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(w===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(w===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(w===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(w===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(w===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}},B}();const O=k},"./src/remux/mp4-generator.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>B});var k=Math.pow(2,32)-1,O=function(){function e(){}return e.init=function(){e.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 w;for(w in e.types)e.types.hasOwnProperty(w)&&(e.types[w]=[w.charCodeAt(0),w.charCodeAt(1),w.charCodeAt(2),w.charCodeAt(3)]);var u=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]),p=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]);e.HDLR_TYPES={video:u,audio:p};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=m,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var l=new Uint8Array([105,115,111,109]),g=new Uint8Array([97,118,99,49]),_=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,l,_,l,g),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,c))},e.box=function(w){for(var u=8,p=arguments.length,c=new Array(p>1?p-1:0),m=1;m<p;m++)c[m-1]=arguments[m];for(var l=c.length,g=l;l--;)u+=c[l].byteLength;var _=new Uint8Array(u);for(_[0]=u>>24&255,_[1]=u>>16&255,_[2]=u>>8&255,_[3]=u&255,_.set(w,4),l=0,u=8;l<g;l++)_.set(c[l],u),u+=c[l].byteLength;return _},e.hdlr=function(w){return e.box(e.types.hdlr,e.HDLR_TYPES[w])},e.mdat=function(w){return e.box(e.types.mdat,w)},e.mdhd=function(w,u){u*=w;var p=Math.floor(u/(k+1)),c=Math.floor(u%(k+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},e.mdia=function(w){return e.box(e.types.mdia,e.mdhd(w.timescale,w.duration),e.hdlr(w.type),e.minf(w))},e.mfhd=function(w){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255]))},e.minf=function(w){return w.type==="audio"?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(w)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(w))},e.moof=function(w,u,p){return e.box(e.types.moof,e.mfhd(w),e.traf(p,u))},e.moov=function(w){for(var u=w.length,p=[];u--;)p[u]=e.trak(w[u]);return e.box.apply(null,[e.types.moov,e.mvhd(w[0].timescale,w[0].duration)].concat(p).concat(e.mvex(w)))},e.mvex=function(w){for(var u=w.length,p=[];u--;)p[u]=e.trex(w[u]);return e.box.apply(null,[e.types.mvex].concat(p))},e.mvhd=function(w,u){u*=w;var p=Math.floor(u/(k+1)),c=Math.floor(u%(k+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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 e.box(e.types.mvhd,m)},e.sdtp=function(w){var u=w.samples||[],p=new Uint8Array(4+u.length),c,m;for(c=0;c<u.length;c++)m=u[c].flags,p[c+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return e.box(e.types.sdtp,p)},e.stbl=function(w){return e.box(e.types.stbl,e.stsd(w),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(w){var u=[],p=[],c,m,l;for(c=0;c<w.sps.length;c++)m=w.sps[c],l=m.byteLength,u.push(l>>>8&255),u.push(l&255),u=u.concat(Array.prototype.slice.call(m));for(c=0;c<w.pps.length;c++)m=w.pps[c],l=m.byteLength,p.push(l>>>8&255),p.push(l&255),p=p.concat(Array.prototype.slice.call(m));var g=e.box(e.types.avcC,new Uint8Array([1,u[3],u[4],u[5],255,224|w.sps.length].concat(u).concat([w.pps.length]).concat(p))),_=w.width,o=w.height,s=w.pixelRatio[0],n=w.pixelRatio[1];return e.box(e.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,_>>8&255,_&255,o>>8&255,o&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),g,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])))},e.esds=function(w){var u=w.config.length;return new Uint8Array([0,0,0,0,3,23+u,0,1,0,4,15+u,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([u]).concat(w.config).concat([6,1,2]))},e.mp4a=function(w){var u=w.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,u>>8&255,u&255,0,0]),e.box(e.types.esds,e.esds(w)))},e.mp3=function(w){var u=w.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,u>>8&255,u&255,0,0]))},e.stsd=function(w){return w.type==="audio"?w.segmentCodec==="mp3"&&w.codec==="mp3"?e.box(e.types.stsd,e.STSD,e.mp3(w)):e.box(e.types.stsd,e.STSD,e.mp4a(w)):e.box(e.types.stsd,e.STSD,e.avc1(w))},e.tkhd=function(w){var u=w.id,p=w.duration*w.timescale,c=w.width,m=w.height,l=Math.floor(p/(k+1)),g=Math.floor(p%(k+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,u>>24&255,u>>16&255,u>>8&255,u&255,0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,g>>24,g>>16&255,g>>8&255,g&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,c>>8&255,c&255,0,0,m>>8&255,m&255,0,0]))},e.traf=function(w,u){var p=e.sdtp(w),c=w.id,m=Math.floor(u/(k+1)),l=Math.floor(u%(k+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,l>>24,l>>16&255,l>>8&255,l&255])),e.trun(w,p.length+16+20+8+16+8+8),p)},e.trak=function(w){return w.duration=w.duration||4294967295,e.box(e.types.trak,e.tkhd(w),e.mdia(w))},e.trex=function(w){var u=w.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(w,u){var p=w.samples||[],c=p.length,m=12+16*c,l=new Uint8Array(m),g,_,o,s,n,r;for(u+=8+m,l.set([w.type==="video"?1:0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255],0),g=0;g<c;g++)_=p[g],o=_.duration,s=_.size,n=_.flags,r=_.cts,l.set([o>>>24&255,o>>>16&255,o>>>8&255,o&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&61440,n.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*g);return e.box(e.types.trun,l)},e.initSegment=function(w){e.types||e.init();var u=e.moov(w),p=new Uint8Array(e.FTYP.byteLength+u.byteLength);return p.set(e.FTYP),p.set(u,e.FTYP.byteLength),p},e}();O.types=void 0,O.HDLR_TYPES=void 0,O.STTS=void 0,O.STSC=void 0,O.STCO=void 0,O.STSZ=void 0,O.VMHD=void 0,O.SMHD=void 0,O.STSD=void 0,O.FTYP=void 0,O.DINF=void 0;const B=O},"./src/remux/mp4-remuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>s,flushTextTrackMetadataCueSamples:()=>v,flushTextTrackUserdataCueSamples:()=>E,normalizePts:()=>n});var k=C("./src/polyfills/number.ts"),O=C("./src/remux/aac-helper.ts"),B=C("./src/remux/mp4-generator.ts"),e=C("./src/events.ts"),I=C("./src/errors.ts"),w=C("./src/utils/logger.ts"),u=C("./src/types/loader.ts"),p=C("./src/utils/timescale-conversion.ts");function c(){return c=Object.assign?Object.assign.bind():function(L){for(var A=1;A<arguments.length;A++){var D=arguments[A];for(var a in D)Object.prototype.hasOwnProperty.call(D,a)&&(L[a]=D[a])}return L},c.apply(this,arguments)}var m=10*1e3,l=1024,g=1152,_=null,o=null,s=function(){function L(D,a,i,t){if(t===void 0&&(t=""),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.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=D,this.config=a,this.typeSupported=i,this.ISGenerated=!1,_===null){var h=navigator.userAgent||"",b=h.match(/Chrome\/(\d+)/i);_=b?parseInt(b[1]):0}if(o===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);o=T?parseInt(T[1]):0}}var A=L.prototype;return A.destroy=function(){},A.resetTimeStamp=function(a){w.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=a},A.resetNextTimestamp=function(){w.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){w.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(a){var i=!1,t=a.reduce(function(h,b){var T=b.pts-h;return T<-4294967296?(i=!0,n(h,b.pts)):T>0?h:b.pts},a[0].pts);return i&&w.logger.debug("PTS rollover detected"),t},A.remux=function(a,i,t,h,b,T,y,d){var R,M,F,U,V,re,$=b,le=b,te=a.pid>-1,_e=i.pid>-1,fe=i.samples.length,me=a.samples.length>0,Ae=y&&fe>0||fe>1,Be=(!te||me)&&(!_e||Ae)||this.ISGenerated||y;if(Be){this.ISGenerated||(F=this.generateIS(a,i,b));var Le=this.isVideoContiguous,Ie=-1,pe;if(Ae&&(Ie=r(i.samples),!Le&&this.config.forceKeyFrameOnDiscontinuity))if(re=!0,Ie>0){w.logger.warn("[mp4-remuxer]: Dropped "+Ie+" out of "+fe+" video samples due to a missing keyframe");var Ke=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(Ie),i.dropped+=Ie,le+=(i.samples[0].pts-Ke)/i.inputTimeScale,pe=le}else Ie===-1&&(w.logger.warn("[mp4-remuxer]: No keyframe found out of "+fe+" video samples"),re=!1);if(this.ISGenerated){if(me&&Ae){var Ce=this.getVideoStartPts(i.samples),ie=n(a.samples[0].pts,Ce)-Ce,X=ie/i.inputTimeScale;$+=Math.max(0,X),le+=Math.max(0,-X)}if(me){if(a.samplerate||(w.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(a,i,b)),M=this.remuxAudio(a,$,this.isAudioContiguous,T,_e||Ae||d===u.PlaylistLevelType.AUDIO?le:void 0),Ae){var q=M?M.endPTS-M.startPTS:0;i.inputTimeScale||(w.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(a,i,b)),R=this.remuxVideo(i,le,Le,q)}}else Ae&&(R=this.remuxVideo(i,le,Le,0));R&&(R.firstKeyFrame=Ie,R.independent=Ie!==-1,R.firstKeyFramePTS=pe)}}return this.ISGenerated&&(t.samples.length&&(V=v(t,b,this._initPTS,this._initDTS)),h.samples.length&&(U=E(h,b,this._initPTS))),{audio:M,video:R,initSegment:F,independent:re,text:U,id3:V}},A.generateIS=function(a,i,t){var h=a.samples,b=i.samples,T=this.typeSupported,y={},d=!(0,k.isFiniteNumber)(this._initPTS),R="audio/mp4",M,F,U;if(d&&(M=F=1/0),a.config&&h.length){switch(a.timescale=a.samplerate,a.segmentCodec){case"mp3":T.mpeg?(R="audio/mpeg",a.codec=""):T.mp3&&(a.codec="mp3");break}y.audio={id:"audio",container:R,codec:a.codec,initSegment:a.segmentCodec==="mp3"&&T.mpeg?new Uint8Array(0):B.default.initSegment([a]),metadata:{channelCount:a.channelCount}},d&&(U=a.inputTimeScale,M=F=h[0].pts-Math.round(U*t))}if(i.sps&&i.pps&&b.length&&(i.timescale=i.inputTimeScale,y.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:B.default.initSegment([i]),metadata:{width:i.width,height:i.height}},d)){U=i.inputTimeScale;var V=this.getVideoStartPts(b),re=Math.round(U*t);F=Math.min(F,n(b[0].dts,V)-re),M=Math.min(M,V-re)}if(Object.keys(y).length)return this.ISGenerated=!0,d&&(this._initPTS=M,this._initDTS=F),{tracks:y,initPTS:M,timescale:U}},A.remuxVideo=function(a,i,t,h){var b=a.inputTimeScale,T=a.samples,y=[],d=T.length,R=this._initPTS,M=this.nextAvcDts,F=8,U=this.videoSampleDuration,V,re,$=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,te=!1;if(!t||M===null){var _e=i*b,fe=T[0].pts-n(T[0].dts,T[0].pts);M=_e-fe}for(var me=0;me<d;me++){var Ae=T[me];Ae.pts=n(Ae.pts-R,M),Ae.dts=n(Ae.dts-R,M),Ae.dts<T[me>0?me-1:me].dts&&(te=!0)}te&&T.sort(function(N,W){var H=N.dts-W.dts,oe=N.pts-W.pts;return H||oe}),V=T[0].dts,re=T[T.length-1].dts;var Be=re-V,Le=Be?Math.round(Be/(d-1)):U||a.inputTimeScale/30;if(t){var Ie=V-M,pe=Ie>Le,Ke=Ie<-1;if((pe||Ke)&&(pe?w.logger.warn("AVC: "+(0,p.toMsFromMpegTsClock)(Ie,!0)+" ms ("+Ie+"dts) hole between fragments detected, filling it"):w.logger.warn("AVC: "+(0,p.toMsFromMpegTsClock)(-Ie,!0)+" ms ("+Ie+"dts) overlapping between fragments detected"),!Ke||M>T[0].pts)){V=M;var Ce=T[0].pts-Ie;T[0].dts=V,T[0].pts=Ce,w.logger.log("Video: First PTS/DTS adjusted: "+(0,p.toMsFromMpegTsClock)(Ce,!0)+"/"+(0,p.toMsFromMpegTsClock)(V,!0)+", delta: "+(0,p.toMsFromMpegTsClock)(Ie,!0)+" ms")}}V=Math.max(0,V);for(var ie=0,X=0,q=0;q<d;q++){for(var ue=T[q],ee=ue.units,z=ee.length,ne=0,ce=0;ce<z;ce++)ne+=ee[ce].data.length;X+=ne,ie+=z,ue.length=ne,ue.dts=Math.max(ue.dts,V),$=Math.min(ue.pts,$),le=Math.max(ue.pts,le)}re=T[d-1].dts;var ge=X+4*ie+8,ke;try{ke=new Uint8Array(ge)}catch(N){this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating video mdat "+ge});return}var $e=new DataView(ke.buffer);$e.setUint32(0,ge),ke.set(B.default.types.mdat,4);for(var ft=!1,Ne=Number.POSITIVE_INFINITY,Re=Number.POSITIVE_INFINITY,xe=Number.NEGATIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,ye=0;ye<d;ye++){for(var it=T[ye],rt=it.units,tt=0,We=0,ot=rt.length;We<ot;We++){var _t=rt[We],St=_t.data,gt=_t.data.byteLength;$e.setUint32(F,gt),F+=4,ke.set(St,F),F+=gt,tt+=4+gt}var wt=void 0;if(ye<d-1)U=T[ye+1].dts-it.dts,wt=T[ye+1].pts-it.pts;else{var mt=this.config,Ct=ye>0?it.dts-T[ye-1].dts:Le;if(wt=ye>0?it.pts-T[ye-1].pts:Le,mt.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ge=Math.floor(mt.maxBufferHole*b),he=(h?$+h*b:this.nextAudioPts)-it.pts;he>Ge?(U=he-Ct,U<0?U=Ct:ft=!0,w.logger.log("[mp4-remuxer]: It is approximately "+he/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=Ct}else U=Ct}var De=Math.round(it.pts-it.dts);Ne=Math.min(Ne,U),xe=Math.max(xe,U),Re=Math.min(Re,wt),Ue=Math.max(Ue,wt),y.push(new f(it.key,U,tt,De))}if(y.length){if(_){if(_<70){var be=y[0].flags;be.dependsOn=2,be.isNonSync=0}}else if(o&&Ue-Re<xe-Ne&&Le/xe<.025&&y[0].cts===0){w.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var Ee=V,je=0,Je=y.length;je<Je;je++){var Qe=Ee+y[je].duration,Xe=Ee+y[je].cts;if(je<Je-1){var He=Qe+y[je+1].cts;y[je].duration=He-Xe}else y[je].duration=je?y[je-1].duration:Le;y[je].cts=0,Ee=Qe}}}console.assert(U!==null,"mp4SampleDuration must be computed"),U=ft||!U?Le:U,this.nextAvcDts=M=re+U,this.videoSampleDuration=U,this.isVideoContiguous=!0;var Se=B.default.moof(a.sequenceNumber++,V,c({},a,{samples:y})),x="video",P={data1:Se,data2:ke,startPTS:$/b,endPTS:(le+U)/b,startDTS:V/b,endDTS:M/b,type:x,hasAudio:!1,hasVideo:!0,nb:y.length,dropped:a.dropped};return a.samples=[],a.dropped=0,console.assert(ke.length,"MDAT length must not be zero"),P},A.remuxAudio=function(a,i,t,h,b){var T=a.inputTimeScale,y=a.samplerate?a.samplerate:T,d=T/y,R=a.segmentCodec==="aac"?l:g,M=R*d,F=this._initPTS,U=a.segmentCodec==="mp3"&&this.typeSupported.mpeg,V=[],re=b!==void 0,$=a.samples,le=U?0:8,te=this.nextAudioPts||-1,_e=i*T;if(this.isAudioContiguous=t=t||$.length&&te>0&&(h&&Math.abs(_e-te)<9e3||Math.abs(n($[0].pts-F,_e)-te)<20*M),$.forEach(function(_t){_t.pts=n(_t.pts-F,_e)}),!t||te<0){if($=$.filter(function(_t){return _t.pts>=0}),!$.length)return;b===0?te=0:h&&!re?te=Math.max(0,_e):te=$[0].pts}if(a.segmentCodec==="aac")for(var fe=this.config.maxAudioFramesDrift,me=0,Ae=te;me<$.length;me++){var Be=$[me],Le=Be.pts,Ie=Le-Ae,pe=Math.abs(1e3*Ie/T);if(Ie<=-fe*M&&re)me===0&&(w.logger.warn("Audio frame @ "+(Le/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ie/T)+" ms."),this.nextAudioPts=te=Ae=Le);else if(Ie>=fe*M&&pe<m&&re){var Ke=Math.round(Ie/M);Ae=Le-Ke*M,Ae<0&&(Ke--,Ae+=M),me===0&&(this.nextAudioPts=te=Ae),w.logger.warn("[mp4-remuxer]: Injecting "+Ke+" audio frame @ "+(Ae/T).toFixed(3)+"s due to "+Math.round(1e3*Ie/T)+" ms gap.");for(var Ce=0;Ce<Ke;Ce++){var ie=Math.max(Ae,0),X=O.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);X||(w.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),X=Be.unit.subarray()),$.splice(me,0,{unit:X,pts:ie}),Ae+=M,me++}}Be.pts=Ae,Ae+=M}for(var q=null,ue=null,ee,z=0,ne=$.length;ne--;)z+=$[ne].unit.byteLength;for(var ce=0,ge=$.length;ce<ge;ce++){var ke=$[ce],$e=ke.unit,ft=ke.pts;if(ue!==null){var Ne=V[ce-1];Ne.duration=Math.round((ft-ue)/d)}else if(t&&a.segmentCodec==="aac"&&(ft=te),q=ft,z>0){z+=le;try{ee=new Uint8Array(z)}catch(_t){this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:z,reason:"fail allocating audio mdat "+z});return}if(!U){var Re=new DataView(ee.buffer);Re.setUint32(0,z),ee.set(B.default.types.mdat,4)}}else return;ee.set($e,le);var xe=$e.byteLength;le+=xe,V.push(new f(!0,R,xe,0)),ue=ft}var Ue=V.length;if(Ue){var ye=V[V.length-1];this.nextAudioPts=te=ue+d*ye.duration;var it=U?new Uint8Array(0):B.default.moof(a.sequenceNumber++,q/d,c({},a,{samples:V}));a.samples=[];var rt=q/T,tt=te/T,We="audio",ot={data1:it,data2:ee,startPTS:rt,endPTS:tt,startDTS:rt,endDTS:tt,type:We,hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,console.assert(ee.length,"MDAT length must not be zero"),ot}},A.remuxEmptyAudio=function(a,i,t,h){var b=a.inputTimeScale,T=a.samplerate?a.samplerate:b,y=b/T,d=this.nextAudioPts,R=(d!==null?d:h.startDTS*b)+this._initDTS,M=h.endDTS*b+this._initDTS,F=y*l,U=Math.ceil((M-R)/F),V=O.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);if(w.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){w.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var re=[],$=0;$<U;$++){var le=R+$*F;re.push({unit:V,pts:le,dts:le})}return a.samples=re,this.remuxAudio(a,i,t,!1)},L}();function n(L,A){var D;if(A===null)return L;for(A<L?D=-8589934592:D=8589934592;Math.abs(L-A)>4294967296;)L+=D;return L}function r(L){for(var A=0;A<L.length;A++)if(L[A].key)return A;return-1}function v(L,A,D,a){var i=L.samples.length;if(i){for(var t=L.inputTimeScale,h=0;h<i;h++){var b=L.samples[h];b.pts=n(b.pts-D,A*t)/t,b.dts=n(b.dts-a,A*t)/t}var T=L.samples;return L.samples=[],{samples:T}}}function E(L,A,D){var a=L.samples.length;if(a){for(var i=L.inputTimeScale,t=0;t<a;t++){var h=L.samples[t];h.pts=n(h.pts-D,A*i)/i}L.samples.sort(function(T,y){return T.pts-y.pts});var b=L.samples;return L.samples=[],{samples:b}}}var f=function(A,D,a,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=D,this.size=a,this.cts=i,this.flags=new S(A)},S=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>p});var k=C("./src/polyfills/number.ts"),O=C("./src/remux/mp4-remuxer.ts"),B=C("./src/utils/mp4-tools.ts"),e=C("./src/loader/fragment.ts"),I=C("./src/utils/logger.ts"),w=function(){function c(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var m=c.prototype;return m.destroy=function(){},m.resetTimeStamp=function(g){this.initPTS=g,this.lastEndTime=null},m.resetNextTimestamp=function(){this.lastEndTime=null},m.resetInitSegment=function(g,_,o,s){this.audioCodec=_,this.videoCodec=o,this.generateInitSegment((0,B.patchEncyptionData)(g,s)),this.emitInitSegment=!0},m.generateInitSegment=function(g){var _=this.audioCodec,o=this.videoCodec;if(!g||!g.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=(0,B.parseInitSegment)(g);_||(_=u(s.audio,e.ElementaryStreamTypes.AUDIO)),o||(o=u(s.video,e.ElementaryStreamTypes.VIDEO));var n={};s.audio&&s.video?n.audiovideo={container:"video/mp4",codec:_+","+o,initSegment:g,id:"main"}:s.audio?n.audio={container:"audio/mp4",codec:_,initSegment:g,id:"audio"}:s.video?n.video={container:"video/mp4",codec:o,initSegment:g,id:"main"}:I.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},m.remux=function(g,_,o,s,n){var r,v=this.initPTS,E=this.lastEndTime,f={audio:void 0,video:void 0,text:s,id3:o,initSegment:void 0};(0,k.isFiniteNumber)(E)||(E=this.lastEndTime=n||0);var S=_.samples;if(!S||!S.length)return f;var L={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(S),A=this.initData),!A||!A.length)return I.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(L.tracks=this.initTracks,this.emitInitSegment=!1);var D=(0,B.getStartDTS)(A,S);(0,k.isFiniteNumber)(v)||(this.initPTS=L.initPTS=v=D-n);var a=(0,B.getDuration)(S,A),i=g?D-v:E,t=i+a;(0,B.offsetStartDTS)(A,S,v),a>0?this.lastEndTime=t:(I.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!A.audio,b=!!A.video,T="";h&&(T+="audio"),b&&(T+="video");var y={data1:S,startPTS:i,startDTS:i,endPTS:t,endDTS:t,type:T,hasAudio:h,hasVideo:b,nb:1,dropped:0};f.audio=y.type==="audio"?y:void 0,f.video=y.type!=="audio"?y:void 0,f.initSegment=L;var d=(r=this.initPTS)!=null?r:0;return f.id3=(0,O.flushTextTrackMetadataCueSamples)(o,n,d,d),s.samples.length&&(f.text=(0,O.flushTextTrackUserdataCueSamples)(s,n,d)),f},c}();function u(c,m){var l=c==null?void 0:c.codec;return l&&l.length>4?l:l==="hvc1"||l==="hev1"?"hvc1.1.c.L120.90":l==="av01"?"av01.0.04M.08":l==="avc1"||m===e.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const p=w},"./src/task-loop.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});var k=function(){function O(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=O.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},O}()},"./src/types/cmcd.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{CMCDObjectType:()=>O,CMCDStreamType:()=>e,CMCDStreamingFormat:()=>B,CMCDVersion:()=>k});var k=1,O;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(O||(O={}));var B;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(B||(B={}));var e;(function(I){I.VOD="v",I.LIVE="l"})(e||(e={}))},"./src/types/demuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{MetadataSchema:()=>k});var k;(function(O){O.audioId3="org.id3",O.dateRange="com.apple.quicktime.HLS",O.emsg="https://aomedia.org/emsg/ID3"})(k||(k={}))},"./src/types/level.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{HdcpLevels:()=>I,HlsSkip:()=>w,HlsUrlParameters:()=>p,Level:()=>c,getSkipValue:()=>u});function k(m,l){for(var g=0;g<l.length;g++){var _=l[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,B(_.key),_)}}function O(m,l,g){return l&&k(m.prototype,l),g&&k(m,g),Object.defineProperty(m,"prototype",{writable:!1}),m}function B(m){var l=e(m,"string");return typeof l=="symbol"?l:String(l)}function e(m,l){if(typeof m!="object"||m===null)return m;var g=m[Symbol.toPrimitive];if(g!==void 0){var _=g.call(m,l||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(m)}var I=["NONE","TYPE-0","TYPE-1","TYPE-2",null],w;(function(m){m.No="",m.Yes="YES",m.v2="v2"})(w||(w={}));function u(m,l){var g=m.canSkipUntil,_=m.canSkipDateRanges,o=m.endSN,s=l!==void 0?l-o:0;return g&&s<g?_?w.v2:w.Yes:w.No}var p=function(){function m(g,_,o){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=_,this.skip=o}var l=m.prototype;return l.addDirectives=function(_){var o=new self.URL(_);return this.msn!==void 0&&o.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&o.searchParams.set("_HLS_part",this.part.toString()),this.skip&&o.searchParams.set("_HLS_skip",this.skip),o.href},m}(),c=function(){function m(l){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=[l.url],this.attrs=l.attrs,this.bitrate=l.bitrate,l.details&&(this.details=l.details),this.id=l.id||0,this.name=l.name,this.width=l.width||0,this.height=l.height||0,this.audioCodec=l.audioCodec,this.videoCodec=l.videoCodec,this.unknownCodecs=l.unknownCodecs,this.codecSet=[l.videoCodec,l.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return O(m,[{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 _=g%this.url.length;this._urlId!==_&&(this.details=void 0,this._urlId=_)}}]),m}()},"./src/types/loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{PlaylistContextType:()=>k,PlaylistLevelType:()=>O});var k;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var O;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(O||(O={}))},"./src/types/transmuxer.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{ChunkMetadata:()=>k});var k=function(e,I,w,u,p,c){u===void 0&&(u=0),p===void 0&&(p=-1),c===void 0&&(c=!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=O(),this.buffering={audio:O(),video:O(),audiovideo:O()},this.level=e,this.sn=I,this.id=w,this.size=u,this.part=p,this.partial=c};function O(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{AttrList:()=>B});var k=/^(\d+)x(\d+)$/,O=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function e(w){typeof w=="string"&&(w=e.parseAttrList(w));for(var u in w)w.hasOwnProperty(u)&&(this[u]=w[u])}var I=e.prototype;return I.decimalInteger=function(u){var p=parseInt(this[u],10);return p>Number.MAX_SAFE_INTEGER?1/0:p},I.hexadecimalInteger=function(u){if(this[u]){var p=(this[u]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var c=new Uint8Array(p.length/2),m=0;m<p.length/2;m++)c[m]=parseInt(p.slice(m*2,m*2+2),16);return c}else return null},I.hexadecimalIntegerAsNumber=function(u){var p=parseInt(this[u],16);return p>Number.MAX_SAFE_INTEGER?1/0:p},I.decimalFloatingPoint=function(u){return parseFloat(this[u])},I.optionalFloat=function(u,p){var c=this[u];return c?parseFloat(c):p},I.enumeratedString=function(u){return this[u]},I.bool=function(u){return this[u]==="YES"},I.decimalResolution=function(u){var p=k.exec(this[u]);if(p!==null)return{width:parseInt(p[1],10),height:parseInt(p[2],10)}},e.parseAttrList=function(u){var p,c={},m='"';for(O.lastIndex=0;(p=O.exec(u))!==null;){var l=p[2];l.indexOf(m)===0&&l.lastIndexOf(m)===l.length-1&&(l=l.slice(1,-1)),c[p[1]]=l}return c},e}()},"./src/utils/binary-search.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k={search:function(e,I){for(var w=0,u=e.length-1,p=null,c=null;w<=u;){p=(w+u)/2|0,c=e[p];var m=I(c);if(m>0)w=p+1;else if(m<0)u=p-1;else return c}return null}};const O=k},"./src/utils/buffer-helper.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{BufferHelper:()=>B});var k=C("./src/utils/logger.ts"),O={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function e(){}return e.isBuffered=function(w,u){try{if(w){for(var p=e.getBuffered(w),c=0;c<p.length;c++)if(u>=p.start(c)&&u<=p.end(c))return!0}}catch(m){}return!1},e.bufferInfo=function(w,u,p){try{if(w){var c=e.getBuffered(w),m=[],l;for(l=0;l<c.length;l++)m.push({start:c.start(l),end:c.end(l)});return this.bufferedInfo(m,u,p)}}catch(g){}return{len:0,start:u,end:u,nextStart:void 0}},e.bufferedInfo=function(w,u,p){u=Math.max(0,u),w.sort(function(f,S){var L=f.start-S.start;return L||S.end-f.end});var c=[];if(p)for(var m=0;m<w.length;m++){var l=c.length;if(l){var g=c[l-1].end;w[m].start-g<p?w[m].end>g&&(c[l-1].end=w[m].end):c.push(w[m])}else c.push(w[m])}else c=w;for(var _=0,o,s=u,n=u,r=0;r<c.length;r++){var v=c[r].start,E=c[r].end;if(u+p>=v&&u<E)s=v,n=E,_=n-u;else if(u+p<v){o=v;break}}return{len:_,start:s||0,end:n||0,nextStart:o}},e.getBuffered=function(w){try{return w.buffered}catch(u){return k.logger.log("failed to get media.buffered",u),O}},e}()},"./src/utils/cea-608-parser.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{CaptionScreen:()=>r,Row:()=>n,default:()=>A});var k=C("./src/utils/logger.ts"),O={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},B=function(a){var i=a;return O.hasOwnProperty(a)&&(i=O[a]),String.fromCharCode(i)},e=15,I=100,w={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(D){D[D.ERROR=0]="ERROR",D[D.TEXT=1]="TEXT",D[D.WARNING=2]="WARNING",D[D.INFO=2]="INFO",D[D.DEBUG=3]="DEBUG",D[D.DATA=3]="DATA"})(l||(l={}));var g=function(){function D(){this.time=null,this.verboseLevel=l.ERROR}var a=D.prototype;return a.log=function(t,h){if(this.verboseLevel>=t){var b=typeof h=="function"?h():h;k.logger.log(this.time+" ["+t+"] "+b)}},D}(),_=function(a){for(var i=[],t=0;t<a.length;t++)i.push(a[t].toString(16));return i},o=function(){function D(i,t,h,b,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=i||"white",this.underline=t||!1,this.italics=h||!1,this.background=b||"black",this.flash=T||!1}var a=D.prototype;return a.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},a.setStyles=function(t){for(var h=["foreground","underline","italics","background","flash"],b=0;b<h.length;b++){var T=h[b];t.hasOwnProperty(T)&&(this[T]=t[T])}},a.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},a.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},a.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},a.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},D}(),s=function(){function D(i,t,h,b,T,y){this.uchar=void 0,this.penState=void 0,this.uchar=i||" ",this.penState=new o(t,h,b,T,y)}var a=D.prototype;return a.reset=function(){this.uchar=" ",this.penState.reset()},a.setChar=function(t,h){this.uchar=t,this.penState.copy(h)},a.setPenState=function(t){this.penState.copy(t)},a.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},a.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},a.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},D}(),n=function(){function D(i){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<I;t++)this.chars.push(new s);this.logger=i,this.pos=0,this.currPenState=new o}var a=D.prototype;return a.equals=function(t){for(var h=!0,b=0;b<I;b++)if(!this.chars[b].equals(t.chars[b])){h=!1;break}return h},a.copy=function(t){for(var h=0;h<I;h++)this.chars[h].copy(t.chars[h])},a.isEmpty=function(){for(var t=!0,h=0;h<I;h++)if(!this.chars[h].isEmpty()){t=!1;break}return t},a.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},a.moveCursor=function(t){var h=this.pos+t;if(t>1)for(var b=this.pos+1;b<h+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(h)},a.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},a.insertChar=function(t){var h=this;t>=144&&this.backSpace();var b=B(t);if(this.pos>=I){this.logger.log(l.ERROR,function(){return"Cannot insert "+t.toString(16)+" ("+b+") at position "+h.pos+". Skipping it!"});return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},a.clearFromPos=function(t){var h;for(h=t;h<I;h++)this.chars[h].reset()},a.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},a.clearToEndOfRow=function(){this.clearFromPos(this.pos)},a.getTextString=function(){for(var t=[],h=!0,b=0;b<I;b++){var T=this.chars[b].uchar;T!==" "&&(h=!1),t.push(T)}return h?"":t.join("")},a.setPenStyles=function(t){this.currPenState.setStyles(t);var h=this.chars[this.pos];h.setPenState(this.currPenState)},D}(),r=function(){function D(i){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<e;t++)this.rows.push(new n(i));this.logger=i,this.currRow=e-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var a=D.prototype;return a.reset=function(){for(var t=0;t<e;t++)this.rows[t].clear();this.currRow=e-1},a.equals=function(t){for(var h=!0,b=0;b<e;b++)if(!this.rows[b].equals(t.rows[b])){h=!1;break}return h},a.copy=function(t){for(var h=0;h<e;h++)this.rows[h].copy(t.rows[h])},a.isEmpty=function(){for(var t=!0,h=0;h<e;h++)if(!this.rows[h].isEmpty()){t=!1;break}return t},a.backSpace=function(){var t=this.rows[this.currRow];t.backSpace()},a.clearToEndOfRow=function(){var t=this.rows[this.currRow];t.clearToEndOfRow()},a.insertChar=function(t){var h=this.rows[this.currRow];h.insertChar(t)},a.setPen=function(t){var h=this.rows[this.currRow];h.setPenStyles(t)},a.moveCursor=function(t){var h=this.rows[this.currRow];h.moveCursor(t)},a.setCursor=function(t){this.logger.log(l.INFO,"setCursor: "+t);var h=this.rows[this.currRow];h.setCursor(t)},a.setPAC=function(t){this.logger.log(l.INFO,function(){return"pacData = "+JSON.stringify(t)});var h=t.row-1;if(this.nrRollUpRows&&h<this.nrRollUpRows-1&&(h=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==h){for(var b=0;b<e;b++)this.rows[b].clear();var T=this.currRow+1-this.nrRollUpRows,y=this.lastOutputScreen;if(y){var d=y.rows[T].cueStartTime,R=this.logger.time;if(d&&R!==null&&d<R)for(var M=0;M<this.nrRollUpRows;M++)this.rows[h-this.nrRollUpRows+M+1].copy(y.rows[T+M])}}this.currRow=h;var F=this.rows[this.currRow];if(t.indent!==null){var U=t.indent,V=Math.max(U-1,0);F.setCursor(t.indent),t.color=F.chars[V].penState.foreground}var re={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(re)},a.setBkgData=function(t){this.logger.log(l.INFO,function(){return"bkgData = "+JSON.stringify(t)}),this.backSpace(),this.setPen(t),this.insertChar(32)},a.setRollUpRows=function(t){this.nrRollUpRows=t},a.rollUp=function(){var t=this;if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,function(){return t.getDisplayText()});var h=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(h,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(l.INFO,"Rolling up")},a.getDisplayText=function(t){t=t||!1;for(var h=[],b="",T=-1,y=0;y<e;y++){var d=this.rows[y].getTextString();d&&(T=y+1,t?h.push("Row "+T+": '"+d+"'"):h.push(d.trim()))}return h.length>0&&(t?b="["+h.join(" | ")+"]":b=h.join(`
`)),b},a.getTextAndFormat=function(){return this.rows},D}(),v=function(){function D(i,t,h){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=i,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new r(h),this.nonDisplayedMemory=new r(h),this.lastOutputScreen=new r(h),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=h}var a=D.prototype;return a.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},a.getHandler=function(){return this.outputFilter},a.setHandler=function(t){this.outputFilter=t},a.setPAC=function(t){this.writeScreen.setPAC(t)},a.setBkgData=function(t){this.writeScreen.setBkgData(t)},a.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(l.INFO,function(){return"MODE="+t}),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=t)},a.insertChars=function(t){for(var h=this,b=0;b<t.length;b++)this.writeScreen.insertChar(t[b]);var T=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,function(){return T+": "+h.writeScreen.getDisplayText(!0)}),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,function(){return"DISPLAYED: "+h.displayedMemory.getDisplayText(!0)}),this.outputDataUpdate())},a.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},a.ccBS=function(){this.logger.log(l.INFO,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},a.ccAOF=function(){},a.ccAON=function(){},a.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},a.ccRU=function(t){this.logger.log(l.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},a.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},a.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},a.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},a.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},a.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},a.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},a.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},a.ccEOC=function(){var t=this;if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,function(){return"DISP: "+t.displayedMemory.getDisplayText()})}this.outputDataUpdate(!0)},a.ccTO=function(t){this.logger.log(l.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},a.ccMIDROW=function(t){var h={flash:!1};if(h.underline=t%2===1,h.italics=t>=46,h.italics)h.foreground="white";else{var b=Math.floor(t/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];h.foreground=T[b]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(h)),this.writeScreen.setPen(h)},a.outputDataUpdate=function(t){t===void 0&&(t=!1);var h=this.logger.time;h!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=h:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,h,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:h),this.lastOutputScreen.copy(this.displayedMemory))},a.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},D}(),E=function(){function D(i,t,h){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new g;this.channels=[null,new v(i,t,b),new v(i+1,h,b)],this.cmdHistory=L(),this.logger=b}var a=D.prototype;return a.getHandler=function(t){return this.channels[t].getHandler()},a.setHandler=function(t,h){this.channels[t].setHandler(h)},a.addData=function(t,h){var b,T,y,d=!1;this.logger.time=t;for(var R=0;R<h.length;R+=2)if(T=h[R]&127,y=h[R+1]&127,!(T===0&&y===0)){if(this.logger.log(l.DATA,"["+_([h[R],h[R+1]])+"] -> ("+_([T,y])+")"),b=this.parseCmd(T,y),b||(b=this.parseMidrow(T,y)),b||(b=this.parsePAC(T,y)),b||(b=this.parseBackgroundAttributes(T,y)),!b&&(d=this.parseChars(T,y),d)){var M=this.currentChannel;if(M&&M>0){var F=this.channels[M];F.insertChars(d)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!d&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+_([T,y])+" orig: "+_([h[R],h[R+1]]))}},a.parseCmd=function(t,h){var b=this.cmdHistory,T=(t===20||t===28||t===21||t===29)&&h>=32&&h<=47,y=(t===23||t===31)&&h>=33&&h<=35;if(!(T||y))return!1;if(S(t,h,b))return f(null,null,b),this.logger.log(l.DEBUG,"Repeated command ("+_([t,h])+") is dropped"),!0;var d=t===20||t===21||t===23?1:2,R=this.channels[d];return t===20||t===21||t===28||t===29?h===32?R.ccRCL():h===33?R.ccBS():h===34?R.ccAOF():h===35?R.ccAON():h===36?R.ccDER():h===37?R.ccRU(2):h===38?R.ccRU(3):h===39?R.ccRU(4):h===40?R.ccFON():h===41?R.ccRDC():h===42?R.ccTR():h===43?R.ccRTD():h===44?R.ccEDM():h===45?R.ccCR():h===46?R.ccENM():h===47&&R.ccEOC():R.ccTO(h-32),f(t,h,b),this.currentChannel=d,!0},a.parseMidrow=function(t,h){var b=0;if((t===17||t===25)&&h>=32&&h<=47){if(t===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[b];return T?(T.ccMIDROW(h),this.logger.log(l.DEBUG,"MIDROW ("+_([t,h])+")"),!0):!1}return!1},a.parsePAC=function(t,h){var b,T=this.cmdHistory,y=(t>=17&&t<=23||t>=25&&t<=31)&&h>=64&&h<=127,d=(t===16||t===24)&&h>=64&&h<=95;if(!(y||d))return!1;if(S(t,h,T))return f(null,null,T),!0;var R=t<=23?1:2;h>=64&&h<=95?b=R===1?w[t]:p[t]:b=R===1?u[t]:c[t];var M=this.channels[R];return M?(M.setPAC(this.interpretPAC(b,h)),f(t,h,T),this.currentChannel=R,!0):!1},a.interpretPAC=function(t,h){var b,T={color:null,italics:!1,indent:null,underline:!1,row:t};return h>95?b=h-96:b=h-64,T.underline=(b&1)===1,b<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((b-16)/2)*4,T},a.parseChars=function(t,h){var b,T=null,y=null;if(t>=25?(b=2,y=t-8):(b=1,y=t),y>=17&&y<=19){var d;y===17?d=h+80:y===18?d=h+112:d=h+144,this.logger.log(l.INFO,"Special char '"+B(d)+"' in channel "+b),T=[d]}else t>=32&&t<=127&&(T=h===0?[t]:[t,h]);if(T){var R=_(T);this.logger.log(l.DEBUG,"Char codes = "+R.join(",")),f(t,h,this.cmdHistory)}return T},a.parseBackgroundAttributes=function(t,h){var b=(t===16||t===24)&&h>=32&&h<=47,T=(t===23||t===31)&&h>=45&&h<=47;if(!(b||T))return!1;var y,d={};t===16||t===24?(y=Math.floor((h-32)/2),d.background=m[y],h%2===1&&(d.background=d.background+"_semi")):h===45?d.background="transparent":(d.foreground="black",h===47&&(d.underline=!0));var R=t<=23?1:2,M=this.channels[R];return M.setBkgData(d),f(t,h,this.cmdHistory),!0},a.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var h=this.channels[t];h&&h.reset()}this.cmdHistory=L()},a.cueSplitAtTime=function(t){for(var h=0;h<this.channels.length;h++){var b=this.channels[h];b&&b.cueSplitAtTime(t)}},D}();function f(D,a,i){i.a=D,i.b=a}function S(D,a,i){return i.a===D&&i.b===a}function L(){return{a:null,b:null}}const A=E},"./src/utils/codecs.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{isCodecSupportedInMp4:()=>B,isCodecType:()=>O});var k={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,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,dva1:!0,dvav:!0,dvh1:!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 O(e,I){var w=k[I];return!!w&&w[e.slice(0,4)]===!0}function B(e,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>w});var k=C("./src/utils/vttparser.ts"),O=C("./src/utils/webvtt-parser.ts"),B=C("./src/utils/texttrack-utils.ts"),e=/\s/,I={newCue:function(p,c,m,l){for(var g=[],_,o,s,n,r,v=self.VTTCue||self.TextTrackCue,E=0;E<l.rows.length;E++)if(_=l.rows[E],s=!0,n=0,r="",!_.isEmpty()){for(var f=0;f<_.chars.length;f++)e.test(_.chars[f].uchar)&&s?n++:(r+=_.chars[f].uchar,s=!1);_.cueStartTime=c,c===m&&(m+=1e-4),n>=16?n--:n++;var S=(0,k.fixLineBreaks)(r.trim()),L=(0,O.generateCueId)(c,m,S);(!p||!p.cues||!p.cues.getCueById(L))&&(o=new v(c,m,S),o.id=L,o.line=E+1,o.align="left",o.position=10+Math.min(80,Math.floor(n*8/32)*10),g.push(o))}return p&&g.length&&(g.sort(function(A,D){return A.line==="auto"||D.line==="auto"?0:A.line>8&&D.line>8?D.line-A.line:A.line-D.line}),g.forEach(function(A){return(0,B.addCueToTrack)(p,A)})),g}};const w=I},"./src/utils/discontinuities.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{adjustSlidingStart:()=>p,alignMediaPlaylistByPDT:()=>g,alignPDT:()=>l,alignStream:()=>c,findDiscontinuousReferenceFrag:()=>w,findFirstFragWithCC:()=>e,shouldAlignOnDiscontinuities:()=>I});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/logger.ts"),B=C("./src/controller/level-helper.ts");function e(_,o){for(var s=null,n=0,r=_.length;n<r;n++){var v=_[n];if(v&&v.cc===o){s=v;break}}return s}function I(_,o,s){return!!(o.details&&(s.endCC>s.startCC||_&&_.cc<s.startCC))}function w(_,o,s){s===void 0&&(s=0);var n=_.fragments,r=o.fragments;if(!r.length||!n.length){O.logger.log("No fragments to align");return}var v=e(n,r[0].cc);if(!v||v&&!v.startPTS){O.logger.log("No frag in previous level to align on");return}return v}function u(_,o){if(_){var s=_.start+o;_.start=_.startPTS=s,_.endPTS=s+_.duration}}function p(_,o){for(var s=o.fragments,n=0,r=s.length;n<r;n++)u(s[n],_);o.fragmentHint&&u(o.fragmentHint,_),o.alignedSliding=!0}function c(_,o,s){o&&(m(_,s,o),!s.alignedSliding&&o.details&&l(s,o.details),!s.alignedSliding&&o.details&&!s.skippedSegments&&(0,B.adjustSliding)(o.details,s))}function m(_,o,s){if(I(_,s,o)){var n=w(s.details,o);n&&(0,k.isFiniteNumber)(n.start)&&(O.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),p(n.start,o))}}function l(_,o){if(!(!o.fragments.length||!_.hasProgramDateTime||!o.hasProgramDateTime)){var s=o.fragments[0].programDateTime,n=_.fragments[0].programDateTime,r=(n-s)/1e3+o.fragments[0].start;r&&(0,k.isFiniteNumber)(r)&&(O.logger.log("Adjusting PTS using programDateTime delta "+(n-s)+"ms, sliding:"+r.toFixed(3)+" "+_.url+" "),p(r,_))}}function g(_,o){if(!(!_.hasProgramDateTime||!o.hasProgramDateTime)){var s=_.fragments,n=o.fragments;if(!(!s.length||!n.length)){var r=Math.round(n.length/2)-1,v=n[r],E=e(s,v.cc)||s[Math.round(s.length/2)-1],f=v.programDateTime,S=E.programDateTime;if(!(f===null||S===null)){var L=(S-f)/1e3-(E.start-v.start);p(L,_)}}}}},"./src/utils/ewma-bandwidth-estimator.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>B});var k=C("./src/utils/ewma.ts"),O=function(){function e(w,u,p){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=p,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(w),this.fast_=new k.default(u)}var I=e.prototype;return I.update=function(u,p){var c=this.slow_,m=this.fast_;this.slow_.halfLife!==u&&(this.slow_=new k.default(u,c.getEstimate(),c.getTotalWeight())),this.fast_.halfLife!==p&&(this.fast_=new k.default(p,m.getEstimate(),m.getTotalWeight()))},I.sample=function(u,p){u=Math.max(u,this.minDelayMs_);var c=8*p,m=u/1e3,l=c/m;this.fast_.sample(m,l),this.slow_.sample(m,l)},I.canEstimate=function(){var u=this.fast_;return u&&u.getTotalWeight()>=this.minWeight_},I.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},I.destroy=function(){},e}();const B=O},"./src/utils/ewma.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k=function(){function B(I,w,u){w===void 0&&(w=0),u===void 0&&(u=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=I,this.alpha_=I?Math.exp(Math.log(.5)/I):0,this.estimate_=w,this.totalWeight_=u}var e=B.prototype;return e.sample=function(w,u){var p=Math.pow(this.alpha_,w);this.estimate_=u*(1-p)+p*this.estimate_,this.totalWeight_+=w},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var w=1-Math.pow(this.alpha_,this.totalWeight_);if(w)return this.estimate_/w}return this.estimate_},B}();const O=k},"./src/utils/fetch-loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>r,fetchSupported:()=>g});var k=C("./src/polyfills/number.ts"),O=C("./src/loader/load-stats.ts"),B=C("./src/demux/chunk-cache.ts");function e(v,E){v.prototype=Object.create(E.prototype),v.prototype.constructor=v,c(v,E)}function I(v){var E=typeof Map=="function"?new Map:void 0;return I=function(S){if(S===null||!p(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(S))return E.get(S);E.set(S,L)}function L(){return w(S,arguments,m(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),c(L,S)},I(v)}function w(v,E,f){return u()?w=Reflect.construct.bind():w=function(L,A,D){var a=[null];a.push.apply(a,A);var i=Function.bind.apply(L,a),t=new i;return D&&c(t,D.prototype),t},w.apply(null,arguments)}function u(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(v){return!1}}function p(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function c(v,E){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,L){return S.__proto__=L,S},c(v,E)}function m(v){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},m(v)}function l(){return l=Object.assign?Object.assign.bind():function(v){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var S in f)Object.prototype.hasOwnProperty.call(f,S)&&(v[S]=f[S])}return v},l.apply(this,arguments)}function g(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(v){}return!1}var _=function(){function v(f){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=f.fetchSetup||s,this.controller=new self.AbortController,this.stats=new O.LoadStats}var E=v.prototype;return E.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},E.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},E.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},E.load=function(S,L,A){var D=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var i=o(S,this.controller.signal),t=A.onProgress,h=S.responseType==="arraybuffer",b=h?"byteLength":"length";this.context=S,this.config=L,this.callbacks=A,this.request=this.fetchSetup(S,i),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){D.abortInternal(),A.onTimeout(a,S,D.response)},L.timeout),self.fetch(this.request).then(function(T){if(D.response=D.loader=T,!T.ok){var y=T.status,d=T.statusText;throw new n(d||"fetch, bad network response",y,T)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(T.headers.get("Content-Length")||"0"),t&&(0,k.isFiniteNumber)(L.highWaterMark)?D.loadProgressively(T,a,S,L.highWaterMark,t):h?T.arrayBuffer():T.text()}).then(function(T){var y=D.response;self.clearTimeout(D.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first);var d=T[b];d&&(a.loaded=a.total=d);var R={url:y.url,data:T};t&&!(0,k.isFiniteNumber)(L.highWaterMark)&&t(a,S,T,y),A.onSuccess(R,a,S,y)}).catch(function(T){if(self.clearTimeout(D.requestTimeout),!a.aborted){var y=T&&T.code||0,d=T?T.message:null;A.onError({code:y,text:d},S,T?T.details:null)}})},E.getCacheAge=function(){var S=null;if(this.response){var L=this.response.headers.get("age");S=L?parseFloat(L):null}return S},E.loadProgressively=function(S,L,A,D,a){D===void 0&&(D=0);var i=new B.default,t=S.body.getReader(),h=function b(){return t.read().then(function(T){if(T.done)return i.dataLength&&a(L,A,i.flush(),S),Promise.resolve(new ArrayBuffer(0));var y=T.value,d=y.length;return L.loaded+=d,d<D||i.dataLength?(i.push(y),i.dataLength>=D&&a(L,A,i.flush(),S)):a(L,A,y,S),b()}).catch(function(){return Promise.reject()})};return h()},v}();function o(v,E){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(l({},v.headers))};return v.rangeEnd&&f.headers.set("Range","bytes="+v.rangeStart+"-"+String(v.rangeEnd-1)),f}function s(v,E){return new self.Request(v.url,E)}var n=function(v){e(E,v);function E(f,S,L){var A;return A=v.call(this,f)||this,A.code=void 0,A.details=void 0,A.code=S,A.details=L,A}return E}(I(Error));const r=_},"./src/utils/hex.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k={hexDump:function(e){for(var I="",w=0;w<e.length;w++){var u=e[w].toString(16);u.length<2&&(u="0"+u),I+=u}return I}};const O=k},"./src/utils/imsc1-ttml-parser.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{IMSC1_CODEC:()=>p,parseIMSC1:()=>g});var k=C("./src/utils/mp4-tools.ts"),O=C("./src/utils/vttparser.ts"),B=C("./src/utils/vttcue.ts"),e=C("./src/demux/id3.ts"),I=C("./src/utils/timescale-conversion.ts"),w=C("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign?Object.assign.bind():function(A){for(var D=1;D<arguments.length;D++){var a=arguments[D];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(A[i]=a[i])}return A},u.apply(this,arguments)}var p="stpp.ttml.im1t",c=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function g(A,D,a,i,t){var h=(0,k.findBox)(new Uint8Array(A),["mdat"]);if(h.length===0){t(new Error("Could not parse IMSC1 mdat"));return}var b=h.map(function(y){return(0,e.utf8ArrayToStr)(y)}),T=(0,I.toTimescaleFromScale)(D,1,a);try{b.forEach(function(y){return i(_(y,T))})}catch(y){t(y)}}function _(A,D){var a=new DOMParser,i=a.parseFromString(A,"text/xml"),t=i.getElementsByTagName("tt")[0];if(!t)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(h).reduce(function(M,F){return M[F]=t.getAttribute("ttp:"+F)||h[F],M},{}),T=t.getAttribute("xml:space")!=="preserve",y=s(o(t,"styling","style")),d=s(o(t,"layout","region")),R=o(t,"body","[begin]");return[].map.call(R,function(M){var F=n(M,T);if(!F||!M.hasAttribute("begin"))return null;var U=f(M.getAttribute("begin"),b),V=f(M.getAttribute("dur"),b),re=f(M.getAttribute("end"),b);if(U===null)throw E(M);if(re===null){if(V===null)throw E(M);re=U+V}var $=new B.default(U-D,re-D,F);$.id=(0,w.generateCueId)($.startTime,$.endTime,$.text);var le=d[M.getAttribute("region")],te=y[M.getAttribute("style")],_e=r(le,te,y),fe=_e.textAlign;if(fe){var me=l[fe];me&&($.lineAlign=me),$.align=fe}return u($,_e),$}).filter(function(M){return M!==null})}function o(A,D,a){var i=A.getElementsByTagName(D)[0];return i?[].slice.call(i.querySelectorAll(a)):[]}function s(A){return A.reduce(function(D,a){var i=a.getAttribute("xml:id");return i&&(D[i]=a),D},{})}function n(A,D){return[].slice.call(A.childNodes).reduce(function(a,i,t){var h;return i.nodeName==="br"&&t?a+`
`:(h=i.childNodes)!==null&&h!==void 0&&h.length?n(i,D):D?a+i.textContent.trim().replace(/\s+/g," "):a+i.textContent},"")}function r(A,D,a){var i="http://www.w3.org/ns/ttml#styling",t=null,h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],b=A!=null&&A.hasAttribute("style")?A.getAttribute("style"):null;return b&&a.hasOwnProperty(b)&&(t=a[b]),h.reduce(function(T,y){var d=v(D,i,y)||v(A,i,y)||v(t,i,y);return d&&(T[y]=d),T},{})}function v(A,D,a){return A&&A.hasAttributeNS(D,a)?A.getAttributeNS(D,a):null}function E(A){return new Error("Could not parse ttml timestamp "+A)}function f(A,D){if(!A)return null;var a=(0,O.parseTimeStamp)(A);return a===null&&(c.test(A)?a=S(A,D):m.test(A)&&(a=L(A,D))),a}function S(A,D){var a=c.exec(A),i=(a[4]|0)+(a[5]|0)/D.subFrameRate;return(a[1]|0)*3600+(a[2]|0)*60+(a[3]|0)+i/D.frameRate}function L(A,D){var a=m.exec(A),i=Number(a[1]),t=a[2];switch(t){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/D.frameRate;case"t":return i/D.tickRate}return i}},"./src/utils/keysystem-util.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{changeEndianness:()=>B,convertDataUriToArrayBytes:()=>e,strToUtf8array:()=>I});var k=C("./src/utils/numeric-encoding-utils.ts");function O(w){var u=I(w).subarray(0,16),p=new Uint8Array(16);return p.set(u,16-u.length),p}function B(w){var u=function(c,m,l){var g=c[m];c[m]=c[l],c[l]=g};u(w,0,3),u(w,1,2),u(w,4,5),u(w,6,7)}function e(w){var u=w.split(":"),p=null;if(u[0]==="data"&&u.length===2){var c=u[1].split(";"),m=c[c.length-1].split(",");if(m.length===2){var l=m[0]==="base64",g=m[1];l?(c.splice(-1,1),p=(0,k.base64Decode)(g)):p=O(g)}}return p}function I(w){return Uint8Array.from(unescape(encodeURIComponent(w)),function(u){return u.charCodeAt(0)})}},"./src/utils/logger.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{enableLogs:()=>w,logger:()=>u});var k=function(){},O={trace:k,debug:k,log:k,warn:k,info:k,error:k},B=O;function e(p){var c=self.console[p];return c?c.bind(self.console,"["+p+"] >"):k}function I(p){for(var c=arguments.length,m=new Array(c>1?c-1:0),l=1;l<c;l++)m[l-1]=arguments[l];m.forEach(function(g){B[g]=p[g]?p[g].bind(p):e(g)})}function w(p,c){if(self.console&&p===!0||typeof p=="object"){I(p,"debug","log","info","warn","error");try{B.log('Debug logs enabled for "'+c+'"')}catch(m){B=O}}else B=O}var u=B},"./src/utils/mediakeys-helper.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{KeySystemFormats:()=>O,KeySystemIds:()=>e,KeySystems:()=>k,getKeySystemsForConfig:()=>u,getSupportedMediaKeySystemConfigurations:()=>c,keySystemDomainToKeySystemFormat:()=>w,keySystemFormatToKeySystemDomain:()=>B,keySystemIdToKeySystemDomain:()=>I,requestMediaKeySystemAccess:()=>p});var k;(function(l){l.CLEARKEY="org.w3.clearkey",l.FAIRPLAY="com.apple.fps",l.PLAYREADY="com.microsoft.playready",l.WIDEVINE="com.widevine.alpha"})(k||(k={}));var O;(function(l){l.CLEARKEY="org.w3.clearkey",l.FAIRPLAY="com.apple.streamingkeydelivery",l.PLAYREADY="com.microsoft.playready",l.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(O||(O={}));function B(l){switch(l){case O.FAIRPLAY:return k.FAIRPLAY;case O.PLAYREADY:return k.PLAYREADY;case O.WIDEVINE:return k.WIDEVINE;case O.CLEARKEY:return k.CLEARKEY}}var e;(function(l){l.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(e||(e={}));function I(l){if(l===e.WIDEVINE)return k.WIDEVINE}function w(l){switch(l){case k.FAIRPLAY:return O.FAIRPLAY;case k.PLAYREADY:return O.PLAYREADY;case k.WIDEVINE:return O.WIDEVINE;case k.CLEARKEY:return O.CLEARKEY}}function u(l){var g=l.drmSystems,_=l.widevineLicenseUrl,o=g?[k.FAIRPLAY,k.WIDEVINE,k.PLAYREADY,k.CLEARKEY].filter(function(s){return!!g[s]}):[];return!o[k.WIDEVINE]&&_&&o.push(k.WIDEVINE),o}var p=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function c(l,g,_,o){var s;switch(l){case k.FAIRPLAY:s=["cenc","sinf"];break;case k.WIDEVINE:case k.PLAYREADY:s=["cenc"];break;case k.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+l)}return m(s,g,_,o)}function m(l,g,_,o){var s={initDataTypes:l,persistentState:o.persistentState||"not-allowed",distinctiveIdentifier:o.distinctiveIdentifier||"not-allowed",sessionTypes:o.sessionTypes||[o.sessionType||"temporary"],audioCapabilities:g.map(function(n){return{contentType:'audio/mp4; codecs="'+n+'"',robustness:o.audioRobustness||"",encryptionScheme:o.audioEncryptionScheme||null}}),videoCapabilities:_.map(function(n){return{contentType:'video/mp4; codecs="'+n+'"',robustness:o.videoRobustness||"",encryptionScheme:o.videoEncryptionScheme||null}})};return[s]}},"./src/utils/mediasource-helper.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{getMediaSource:()=>k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{RemuxerTrackIdConfig:()=>p,appendUint8Array:()=>D,bin2str:()=>c,computeRawDurationFromSamples:()=>S,discardEPB:()=>b,findBox:()=>o,getDuration:()=>f,getStartDTS:()=>E,mp4Box:()=>y,mp4pssh:()=>d,offsetStartDTS:()=>L,parseEmsg:()=>T,parseInitSegment:()=>n,parsePssh:()=>R,parseSEIMessageFromNALu:()=>h,parseSamples:()=>a,parseSegmentIndex:()=>s,parseSinf:()=>v,patchEncyptionData:()=>r,readSint32:()=>g,readUint16:()=>m,readUint32:()=>l,segmentValidRange:()=>A,writeUint32:()=>_});var k=C("./src/loader/fragment.ts"),O=C("./src/utils/typed-array.ts"),B=C("./src/demux/id3.ts"),e=C("./src/utils/logger.ts"),I=C("./src/utils/hex.ts"),w=Math.pow(2,32)-1,u=[].push,p={video:1,audio:2,id3:3,text:4};function c(M){return String.fromCharCode.apply(null,M)}function m(M,F){var U=M[F]<<8|M[F+1];return U<0?65536+U:U}function l(M,F){var U=g(M,F);return U<0?4294967296+U:U}function g(M,F){return M[F]<<24|M[F+1]<<16|M[F+2]<<8|M[F+3]}function _(M,F,U){M[F]=U>>24,M[F+1]=U>>16&255,M[F+2]=U>>8&255,M[F+3]=U&255}function o(M,F){var U=[];if(!F.length)return U;for(var V=M.byteLength,re=0;re<V;){var $=l(M,re),le=c(M.subarray(re+4,re+8)),te=$>1?re+$:V;if(le===F[0])if(F.length===1)U.push(M.subarray(re+8,te));else{var _e=o(M.subarray(re+8,te),F.slice(1));_e.length&&u.apply(U,_e)}re=te}return U}function s(M){var F=[],U=M[0],V=8,re=l(M,V);V+=4;var $=0,le=0;U===0?V+=8:V+=16,V+=2;var te=M.length+le,_e=m(M,V);V+=2;for(var fe=0;fe<_e;fe++){var me=V,Ae=l(M,me);me+=4;var Be=Ae&2147483647,Le=(Ae&2147483648)>>>31;if(Le===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Ie=l(M,me);me+=4,F.push({referenceSize:Be,subsegmentDuration:Ie,info:{duration:Ie/re,start:te,end:te+Be-1}}),te+=Be,me+=4,V=me}return{earliestPresentationTime:$,timescale:re,version:U,referencesCount:_e,references:F}}function n(M){for(var F=[],U=o(M,["moov","trak"]),V=0;V<U.length;V++){var re=U[V],$=o(re,["tkhd"])[0];if($){var le=$[0],te=le===0?12:20,_e=l($,te),fe=o(re,["mdia","mdhd"])[0];if(fe){le=fe[0],te=le===0?12:20;var me=l(fe,te),Ae=o(re,["mdia","hdlr"])[0];if(Ae){var Be=c(Ae.subarray(8,12)),Le={soun:k.ElementaryStreamTypes.AUDIO,vide:k.ElementaryStreamTypes.VIDEO}[Be];if(Le){var Ie=o(re,["mdia","minf","stbl","stsd"])[0],pe=void 0;Ie&&(pe=c(Ie.subarray(12,16))),F[_e]={timescale:me,type:Le},F[Le]={timescale:me,id:_e,codec:pe}}}}}}var Ke=o(M,["moov","mvex","trex"]);return Ke.forEach(function(Ce){var ie=l(Ce,4),X=F[ie];X&&(X.default={duration:l(Ce,12),flags:l(Ce,20)})}),F}function r(M,F){if(!M||!F)return M;var U=F.keyId;if(U&&F.isCommonEncryption){var V=o(M,["moov","trak"]);V.forEach(function(re){var $=o(re,["mdia","minf","stbl","stsd"])[0],le=$.subarray(8),te=o(le,["enca"]),_e=te.length>0;_e||(te=o(le,["encv"])),te.forEach(function(fe){var me=_e?fe.subarray(28):fe.subarray(78),Ae=o(me,["sinf"]);Ae.forEach(function(Be){var Le=v(Be);if(Le){var Ie=Le.subarray(8,24);Ie.some(function(pe){return pe!==0})||(e.logger.log("[eme] Patching keyId in 'enc"+(_e?"a":"v")+">sinf>>tenc' box: "+I.default.hexDump(Ie)+" -> "+I.default.hexDump(U)),Le.set(U,8))}})})})}return M}function v(M){var F=o(M,["schm"])[0];if(F){var U=c(F.subarray(4,8));if(U==="cbcs"||U==="cenc")return o(M,["schi","tenc"])[0]}return e.logger.error("[eme] missing 'schm' box"),null}function E(M,F){return o(F,["moof","traf"]).reduce(function(U,V){var re=o(V,["tfdt"])[0],$=re[0],le=o(V,["tfhd"]).reduce(function(te,_e){var fe=l(_e,4),me=M[fe];if(me){var Ae=l(re,4);$===1&&(Ae*=Math.pow(2,32),Ae+=l(re,8));var Be=me.timescale||9e4,Le=Ae/Be;if(isFinite(Le)&&(te===null||Le<te))return Le}return te},null);return le!==null&&isFinite(le)&&(U===null||le<U)?le:U},null)||0}function f(M,F){for(var U=0,V=0,re=0,$=o(M,["moof","traf"]),le=0;le<$.length;le++){var te=$[le],_e=o(te,["tfhd"])[0],fe=l(_e,4),me=F[fe];if(me){var Ae=me.default,Be=l(_e,0)|(Ae==null?void 0:Ae.flags),Le=Ae==null?void 0:Ae.duration;Be&8&&(Be&2?Le=l(_e,12):Le=l(_e,8));for(var Ie=me.timescale||9e4,pe=o(te,["trun"]),Ke=0;Ke<pe.length;Ke++){if(U=S(pe[Ke]),!U&&Le){var Ce=l(pe[Ke],4);U=Le*Ce}me.type===k.ElementaryStreamTypes.VIDEO?V+=U/Ie:me.type===k.ElementaryStreamTypes.AUDIO&&(re+=U/Ie)}}}if(V===0&&re===0){for(var ie=0,X=o(M,["sidx"]),q=0;q<X.length;q++){var ue=s(X[q]);ue!=null&&ue.references&&(ie+=ue.references.reduce(function(ee,z){return ee+z.info.duration||0},0))}return ie}return V||re}function S(M){var F=l(M,0),U=8;F&1&&(U+=4),F&4&&(U+=4);for(var V=0,re=l(M,4),$=0;$<re;$++){if(F&256){var le=l(M,U);V+=le,U+=4}F&512&&(U+=4),F&1024&&(U+=4),F&2048&&(U+=4)}return V}function L(M,F,U){o(F,["moof","traf"]).forEach(function(V){o(V,["tfhd"]).forEach(function(re){var $=l(re,4),le=M[$];if(le){var te=le.timescale||9e4;o(V,["tfdt"]).forEach(function(_e){var fe=_e[0],me=l(_e,4);if(fe===0)me-=U*te,me=Math.max(me,0),_(_e,4,me);else{me*=Math.pow(2,32),me+=l(_e,8),me-=U*te,me=Math.max(me,0);var Ae=Math.floor(me/(w+1)),Be=Math.floor(me%(w+1));_(_e,4,Ae),_(_e,8,Be)}})}})})}function A(M){var F={valid:null,remainder:null},U=o(M,["moof"]);if(U){if(U.length<2)return F.remainder=M,F}else return F;var V=U[U.length-1];return F.valid=(0,O.sliceUint8)(M,0,V.byteOffset-8),F.remainder=(0,O.sliceUint8)(M,V.byteOffset-8),F}function D(M,F){var U=new Uint8Array(M.length+F.length);return U.set(M),U.set(F,M.length),U}function a(M,F){var U=[],V=F.samples,re=F.timescale,$=F.id,le=!1,te=o(V,["moof"]);return te.map(function(_e){var fe=_e.byteOffset-8,me=o(_e,["traf"]);me.map(function(Ae){var Be=o(Ae,["tfdt"]).map(function(Le){var Ie=Le[0],pe=l(Le,4);return Ie===1&&(pe*=Math.pow(2,32),pe+=l(Le,8)),pe/re})[0];return Be!==void 0&&(M=Be),o(Ae,["tfhd"]).map(function(Le){var Ie=l(Le,4),pe=l(Le,0)&16777215,Ke=(pe&1)!==0,Ce=(pe&2)!==0,ie=(pe&8)!==0,X=0,q=(pe&16)!==0,ue=0,ee=(pe&32)!==0,z=8;Ie===$&&(Ke&&(z+=8),Ce&&(z+=4),ie&&(X=l(Le,z),z+=4),q&&(ue=l(Le,z),z+=4),ee&&(z+=4),F.type==="video"&&(le=i(F.codec)),o(Ae,["trun"]).map(function(ne){var ce=ne[0],ge=l(ne,0)&16777215,ke=(ge&1)!==0,$e=0,ft=(ge&4)!==0,Ne=(ge&256)!==0,Re=0,xe=(ge&512)!==0,Ue=0,ye=(ge&1024)!==0,it=(ge&2048)!==0,rt=0,tt=l(ne,4),We=8;ke&&($e=l(ne,We),We+=4),ft&&(We+=4);for(var ot=$e+fe,_t=0;_t<tt;_t++){if(Ne?(Re=l(ne,We),We+=4):Re=X,xe?(Ue=l(ne,We),We+=4):Ue=ue,ye&&(We+=4),it&&(ce===0?rt=l(ne,We):rt=g(ne,We),We+=4),F.type===k.ElementaryStreamTypes.VIDEO)for(var St=0;St<Ue;){var gt=l(V,ot);if(ot+=4,t(le,V[ot])){var wt=V.subarray(ot,ot+gt);h(wt,le?2:1,M+rt/re,U)}ot+=gt,St+=gt+4}M+=Re/re}}))})})}),U}function i(M){if(!M)return!1;var F=M.indexOf("."),U=F<0?M:M.substring(0,F);return U==="hvc1"||U==="hev1"||U==="dvh1"||U==="dvhe"}function t(M,F){if(M){var U=F>>1&63;return U===39||U===40}else{var V=F&31;return V===6}}function h(M,F,U,V){var re=b(M),$=0;$+=F;for(var le=0,te=0,_e=!1,fe=0;$<re.length;){le=0;do{if($>=re.length)break;fe=re[$++],le+=fe}while(fe===255);te=0;do{if($>=re.length)break;fe=re[$++],te+=fe}while(fe===255);var me=re.length-$;if(!_e&&le===4&&$<re.length){_e=!0;var Ae=re[$++];if(Ae===181){var Be=m(re,$);if($+=2,Be===49){var Le=l(re,$);if($+=4,Le===1195456820){var Ie=re[$++];if(Ie===3){var pe=re[$++],Ke=31&pe,Ce=64&pe,ie=Ce?2+Ke*3:0,X=new Uint8Array(ie);if(Ce){X[0]=pe;for(var q=1;q<ie;q++)X[q]=re[$++]}V.push({type:Ie,payloadType:le,pts:U,bytes:X})}}}}}else if(le===5&&te<me){if(_e=!0,te>16){for(var ue=[],ee=0;ee<16;ee++){var z=re[$++].toString(16);ue.push(z.length==1?"0"+z:z),(ee===3||ee===5||ee===7||ee===9)&&ue.push("-")}for(var ne=te-16,ce=new Uint8Array(ne),ge=0;ge<ne;ge++)ce[ge]=re[$++];V.push({payloadType:le,pts:U,uuid:ue.join(""),userData:(0,B.utf8ArrayToStr)(ce),userDataBytes:ce})}}else if(te<me)$+=te;else if(te>me)break}}function b(M){for(var F=M.byteLength,U=[],V=1;V<F-2;)M[V]===0&&M[V+1]===0&&M[V+2]===3?(U.push(V+2),V+=2):V++;if(U.length===0)return M;var re=F-U.length,$=new Uint8Array(re),le=0;for(V=0;V<re;le++,V++)le===U[0]&&(le++,U.shift()),$[V]=M[le];return $}function T(M){var F=M[0],U="",V="",re=0,$=0,le=0,te=0,_e=0,fe=0;if(F===0){for(;c(M.subarray(fe,fe+1))!=="\0";)U+=c(M.subarray(fe,fe+1)),fe+=1;for(U+=c(M.subarray(fe,fe+1)),fe+=1;c(M.subarray(fe,fe+1))!=="\0";)V+=c(M.subarray(fe,fe+1)),fe+=1;V+=c(M.subarray(fe,fe+1)),fe+=1,re=l(M,12),$=l(M,16),te=l(M,20),_e=l(M,24),fe=28}else if(F===1){fe+=4,re=l(M,fe),fe+=4;var me=l(M,fe);fe+=4;var Ae=l(M,fe);for(fe+=4,le=Math.pow(2,32)*me+Ae,Number.isSafeInteger(le)||(le=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),te=l(M,fe),fe+=4,_e=l(M,fe),fe+=4;c(M.subarray(fe,fe+1))!=="\0";)U+=c(M.subarray(fe,fe+1)),fe+=1;for(U+=c(M.subarray(fe,fe+1)),fe+=1;c(M.subarray(fe,fe+1))!=="\0";)V+=c(M.subarray(fe,fe+1)),fe+=1;V+=c(M.subarray(fe,fe+1)),fe+=1}var Be=M.subarray(fe,M.byteLength);return{schemeIdUri:U,value:V,timeScale:re,presentationTime:le,presentationTimeDelta:$,eventDuration:te,id:_e,payload:Be}}function y(M){for(var F=arguments.length,U=new Array(F>1?F-1:0),V=1;V<F;V++)U[V-1]=arguments[V];for(var re=U.length,$=8,le=re;le--;)$+=U[le].byteLength;var te=new Uint8Array($);for(te[0]=$>>24&255,te[1]=$>>16&255,te[2]=$>>8&255,te[3]=$&255,te.set(M,4),le=0,$=8;le<re;le++)te.set(U[le],$),$+=U[le].byteLength;return te}function d(M,F,U){if(M.byteLength!==16)throw new RangeError("Invalid system id");var V,re;if(F){V=1,re=new Uint8Array(F.length*16);for(var $=0;$<F.length;$++){var le=F[$];if(le.byteLength!==16)throw new RangeError("Invalid key");re.set(le,$*16)}}else V=0,re=new Uint8Array;var te;V>0?(te=new Uint8Array(4),F.length>0&&new DataView(te.buffer).setUint32(0,F.length,!1)):te=new Uint8Array;var _e=new Uint8Array(4);return U&&U.byteLength>0&&new DataView(_e.buffer).setUint32(0,U.byteLength,!1),y([112,115,115,104],new Uint8Array([V,0,0,0]),M,te,re,_e,U||new Uint8Array)}function R(M){if(!(M instanceof ArrayBuffer)||M.byteLength<32)return null;var F={version:0,systemId:"",kids:null,data:null},U=new DataView(M),V=U.getUint32(0);if(M.byteLength!==V&&V>44)return null;var re=U.getUint32(4);if(re!==1886614376||(F.version=U.getUint32(8)>>>24,F.version>1))return null;F.systemId=I.default.hexDump(new Uint8Array(M,12,16));var $=U.getUint32(28);if(F.version===0){if(V-32<$)return null;F.data=new Uint8Array(M,32,$)}else if(F.version===1){F.kids=[];for(var le=0;le<$;le++)F.kids.push(new Uint8Array(M,32+le*16,16))}return F}},"./src/utils/numeric-encoding-utils.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{base64Decode:()=>w,base64DecodeToStr:()=>B,base64Encode:()=>e,base64ToBase64Url:()=>k,base64UrlEncode:()=>I,strToBase64Encode:()=>O});function k(u){return u.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function O(u){return btoa(u)}function B(u){return atob(u)}function e(u){return btoa(String.fromCharCode.apply(String,u))}function I(u){return k(e(u))}function w(u){return Uint8Array.from(atob(u),function(p){return p.charCodeAt(0)})}},"./src/utils/output-filter.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});var k=function(){function O(e,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=I}var B=O.prototype;return B.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},B.newCue=function(I,w,u){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=w,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[],this.startTime=null},O}()},"./src/utils/texttrack-utils.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{addCueToTrack:()=>B,clearCurrentCues:()=>e,getCuesInRange:()=>u,removeCuesInRange:()=>I,sendAddTrackEvent:()=>O});var k=C("./src/utils/logger.ts");function O(p,c){var m;try{m=new Event("addtrack")}catch(l){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=p,c.dispatchEvent(m)}function B(p,c){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(c.id))try{if(p.addCue(c),!p.cues.getCueById(c.id))throw new Error("addCue is failed for: "+c)}catch(g){k.logger.debug("[texttrack-utils]: "+g);var l=new self.TextTrackCue(c.startTime,c.endTime,c.text);l.id=c.id,p.addCue(l)}m==="disabled"&&(p.mode=m)}function e(p){var c=p.mode;if(c==="disabled"&&(p.mode="hidden"),p.cues)for(var m=p.cues.length;m--;)p.removeCue(p.cues[m]);c==="disabled"&&(p.mode=c)}function I(p,c,m,l){var g=p.mode;if(g==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var _=u(p.cues,c,m),o=0;o<_.length;o++)(!l||l(_[o]))&&p.removeCue(_[o]);g==="disabled"&&(p.mode=g)}function w(p,c){if(c<p[0].startTime)return 0;var m=p.length-1;if(c>p[m].endTime)return-1;for(var l=0,g=m;l<=g;){var _=Math.floor((g+l)/2);if(c<p[_].startTime)g=_-1;else if(c>p[_].startTime&&l<m)l=_+1;else return _}return p[l].startTime-c<c-p[g].startTime?l:g}function u(p,c,m){var l=[],g=w(p,c);if(g>-1)for(var _=g,o=p.length;_<o;_++){var s=p[_];if(s.startTime>=c&&s.endTime<=m)l.push(s);else if(s.startTime>m)return l}return l}},"./src/utils/time-ranges.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>O});var k={toString:function(e){for(var I="",w=e.length,u=0;u<w;u++)I+="["+e.start(u).toFixed(3)+"-"+e.end(u).toFixed(3)+"]";return I}};const O=k},"./src/utils/timescale-conversion.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{toMpegTsClockFromTimescale:()=>I,toMsFromMpegTsClock:()=>e,toTimescaleFromBase:()=>O,toTimescaleFromScale:()=>B});var k=9e4;function O(w,u,p,c){p===void 0&&(p=1),c===void 0&&(c=!1);var m=w*u*p;return c?Math.round(m):m}function B(w,u,p,c){return p===void 0&&(p=1),c===void 0&&(c=!1),O(w,u,1/p,c)}function e(w,u){return u===void 0&&(u=!1),O(w,1e3,1/k,u)}function I(w,u){return u===void 0&&(u=1),O(w,k,1/u)}},"./src/utils/typed-array.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{sliceUint8:()=>k});function k(O,B,e){return Uint8Array.prototype.slice?O.slice(B,e):new Uint8Array(Array.prototype.slice.call(O,B,e))}},"./src/utils/vttcue.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>k});const k=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var O=["","lr","rl"],B=["start","middle","end","left","right"];function e(c,m){if(typeof m!="string"||!Array.isArray(c))return!1;var l=m.toLowerCase();return~c.indexOf(l)?l:!1}function I(c){return e(O,c)}function w(c){return e(B,c)}function u(c){for(var m=arguments.length,l=new Array(m>1?m-1:0),g=1;g<m;g++)l[g-1]=arguments[g];for(var _=1;_<arguments.length;_++){var o=arguments[_];for(var s in o)c[s]=o[s]}return c}function p(c,m,l){var g=this,_={enumerable:!0};g.hasBeenReset=!1;var o="",s=!1,n=c,r=m,v=l,E=null,f="",S=!0,L="auto",A="start",D=50,a="middle",i=50,t="middle";Object.defineProperty(g,"id",u({},_,{get:function(){return o},set:function(b){o=""+b}})),Object.defineProperty(g,"pauseOnExit",u({},_,{get:function(){return s},set:function(b){s=!!b}})),Object.defineProperty(g,"startTime",u({},_,{get:function(){return n},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");n=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"endTime",u({},_,{get:function(){return r},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"text",u({},_,{get:function(){return v},set:function(b){v=""+b,this.hasBeenReset=!0}})),Object.defineProperty(g,"region",u({},_,{get:function(){return E},set:function(b){E=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"vertical",u({},_,{get:function(){return f},set:function(b){var T=I(b);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=T,this.hasBeenReset=!0}})),Object.defineProperty(g,"snapToLines",u({},_,{get:function(){return S},set:function(b){S=!!b,this.hasBeenReset=!0}})),Object.defineProperty(g,"line",u({},_,{get:function(){return L},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"lineAlign",u({},_,{get:function(){return A},set:function(b){var T=w(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");A=T,this.hasBeenReset=!0}})),Object.defineProperty(g,"position",u({},_,{get:function(){return D},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"positionAlign",u({},_,{get:function(){return a},set:function(b){var T=w(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");a=T,this.hasBeenReset=!0}})),Object.defineProperty(g,"size",u({},_,{get:function(){return i},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");i=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"align",u({},_,{get:function(){return t},set:function(b){var T=w(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");t=T,this.hasBeenReset=!0}})),g.displayState=void 0}return p.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{VTTParser:()=>m,fixLineBreaks:()=>c,parseTimeStamp:()=>B});var k=C("./src/utils/vttcue.ts"),O=function(){function l(){}var g=l.prototype;return g.decode=function(o,s){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},l}();function B(l){function g(o,s,n,r){return(o|0)*3600+(s|0)*60+(n|0)+parseFloat(r||0)}var _=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return _?parseFloat(_[2])>59?g(_[2],_[3],0,_[4]):g(_[1],_[2],_[3],_[4]):null}var e=function(){function l(){this.values=Object.create(null)}var g=l.prototype;return g.set=function(o,s){!this.get(o)&&s!==""&&(this.values[o]=s)},g.get=function(o,s,n){return n?this.has(o)?this.values[o]:s[n]:this.has(o)?this.values[o]:s},g.has=function(o){return o in this.values},g.alt=function(o,s,n){for(var r=0;r<n.length;++r)if(s===n[r]){this.set(o,s);break}},g.integer=function(o,s){/^-?\d+$/.test(s)&&this.set(o,parseInt(s,10))},g.percent=function(o,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var n=parseFloat(s);if(n>=0&&n<=100)return this.set(o,n),!0}return!1},l}();function I(l,g,_,o){var s=o?l.split(o):[l];for(var n in s)if(typeof s[n]=="string"){var r=s[n].split(_);if(r.length===2){var v=r[0],E=r[1];g(v,E)}}}var w=new k.default(0,0,""),u=w.align==="middle"?"middle":"center";function p(l,g,_){var o=l;function s(){var v=B(l);if(v===null)throw new Error("Malformed timestamp: "+o);return l=l.replace(/^[^\sa-zA-Z-]+/,""),v}function n(v,E){var f=new e;I(v,function(A,D){var a;switch(A){case"region":for(var i=_.length-1;i>=0;i--)if(_[i].id===D){f.set(A,_[i].region);break}break;case"vertical":f.alt(A,D,["rl","lr"]);break;case"line":a=D.split(","),f.integer(A,a[0]),f.percent(A,a[0])&&f.set("snapToLines",!1),f.alt(A,a[0],["auto"]),a.length===2&&f.alt("lineAlign",a[1],["start",u,"end"]);break;case"position":a=D.split(","),f.percent(A,a[0]),a.length===2&&f.alt("positionAlign",a[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":f.percent(A,D);break;case"align":f.alt(A,D,["start",u,"end","left","right"]);break}},/:/,/\s/),E.region=f.get("region",null),E.vertical=f.get("vertical","");var S=f.get("line","auto");S==="auto"&&w.line===-1&&(S=-1),E.line=S,E.lineAlign=f.get("lineAlign","start"),E.snapToLines=f.get("snapToLines",!0),E.size=f.get("size",100),E.align=f.get("align",u);var L=f.get("position","auto");L==="auto"&&w.position===50&&(L=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=L}function r(){l=l.replace(/^\s+/,"")}if(r(),g.startTime=s(),r(),l.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);l=l.slice(3),r(),g.endTime=s(),r(),n(l,g)}function c(l){return l.replace(/<br(?: \/)?>/gi,`
`)}var m=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new O,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var g=l.prototype;return g.parse=function(o){var s=this;o&&(s.buffer+=s.decoder.decode(o,{stream:!0}));function n(){var L=s.buffer,A=0;for(L=c(L);A<L.length&&L[A]!=="\r"&&L[A]!==`
`;)++A;var D=L.slice(0,A);return L[A]==="\r"&&++A,L[A]===`
`&&++A,s.buffer=L.slice(A),D}function r(L){I(L,function(A,D){},/:/)}try{var v="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;v=n();var E=v.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var f=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;switch(f?f=!1:v=n(),s.state){case"HEADER":/:/.test(v)?r(v):v||(s.state="ID");continue;case"NOTE":v||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){s.state="NOTE";break}if(!v)continue;if(s.cue=new k.default(0,0,""),s.state="CUE",v.indexOf("-->")===-1){s.cue.id=v;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{p(v,s.cue,s.regionList)}catch(L){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var S=v.indexOf("-->")!==-1;if(!v||S&&(f=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
`),s.cue.text+=v}continue;case"BADCUE":v||(s.state="ID")}}}catch(L){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},g.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){o.onparsingerror&&o.onparsingerror(s)}return o.onflush&&o.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{generateCueId:()=>m,parseWebVTT:()=>g});var k=C("./src/polyfills/number.ts"),O=C("./src/utils/vttparser.ts"),B=C("./src/demux/id3.ts"),e=C("./src/utils/timescale-conversion.ts"),I=C("./src/remux/mp4-remuxer.ts"),w=/\r\n|\n\r|\n|\r/g,u=function(o,s,n){return n===void 0&&(n=0),o.slice(n,n+s.length)===s},p=function(o){var s=parseInt(o.slice(-3)),n=parseInt(o.slice(-6,-4)),r=parseInt(o.slice(-9,-7)),v=o.length>9?parseInt(o.substring(0,o.indexOf(":"))):0;if(!(0,k.isFiniteNumber)(s)||!(0,k.isFiniteNumber)(n)||!(0,k.isFiniteNumber)(r)||!(0,k.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return s+=1e3*n,s+=60*1e3*r,s+=60*60*1e3*v,s},c=function(o){for(var s=5381,n=o.length;n;)s=s*33^o.charCodeAt(--n);return(s>>>0).toString()};function m(_,o,s){return c(_.toString())+c(o.toString())+c(s)}var l=function(o,s,n){var r=o[s],v=o[r.prevCC];if(!v||!v.new&&r.new){o.ccOffset=o.presentationOffset=r.start,r.new=!1;return}for(;(E=v)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=r.start-v.start,r.new=!1,r=v,v=o[r.prevCC]}o.presentationOffset=n};function g(_,o,s,n,r,v,E,f){var S=new O.VTTParser,L=(0,B.utf8ArrayToStr)(new Uint8Array(_)).trim().replace(w,`
`).split(`
`),A=[],D=(0,e.toMpegTsClockFromTimescale)(o,s),a="00:00.000",i=0,t=0,h,b=!0;S.oncue=function(T){var y=n[r],d=n.ccOffset,R=(i-D)/9e4;y!=null&&y.new&&(t!==void 0?d=n.ccOffset=y.start:l(n,r,R)),R&&(d=R-n.presentationOffset);var M=T.endTime-T.startTime,F=(0,I.normalizePts)((T.startTime+d-t)*9e4,v*9e4)/9e4;T.startTime=Math.max(F,0),T.endTime=Math.max(F+M,0);var U=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(U)),T.id||(T.id=m(T.startTime,T.endTime,U)),T.endTime>0&&A.push(T)},S.onparsingerror=function(T){h=T},S.onflush=function(){if(h){f(h);return}E(A)},L.forEach(function(T){if(b)if(u(T,"X-TIMESTAMP-MAP=")){b=!1,T.slice(16).split(",").forEach(function(y){u(y,"LOCAL:")?a=y.slice(6):u(y,"MPEGTS:")&&(i=parseInt(y.slice(7)))});try{t=p(a)/1e3}catch(y){h=y}return}else T===""&&(b=!1);S.parse(T+`
`)}),S.flush()}},"./src/utils/xhr-loader.ts":(Q,K,C)=>{"use strict";C.r(K),C.d(K,{default:()=>I});var k=C("./src/utils/logger.ts"),O=C("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,e=function(){function w(p){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=p?p.xhrSetup:null,this.stats=new O.LoadStats,this.retryDelay=0}var u=w.prototype;return u.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},u.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},u.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},u.load=function(c,m,l){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=m,this.callbacks=l,this.retryDelay=m.retryDelay,this.loadInternal()},u.loadInternal=function(){var c=this.config,m=this.context;if(c){var l=this.loader=new self.XMLHttpRequest,g=this.stats;g.loading.first=0,g.loaded=0;var _=this.xhrSetup;try{if(_)try{_(l,m.url)}catch(n){l.open("GET",m.url,!0),_(l,m.url)}l.readyState||l.open("GET",m.url,!0);var o=this.context.headers;if(o)for(var s in o)l.setRequestHeader(s,o[s])}catch(n){this.callbacks.onError({code:l.status,text:n.message},m,l);return}m.rangeEnd&&l.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),l.onreadystatechange=this.readystatechange.bind(this),l.onprogress=this.loadprogress.bind(this),l.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),l.send()}},u.readystatechange=function(){var c=this.context,m=this.loader,l=this.stats;if(!(!c||!m)){var g=m.readyState,_=this.config;if(!l.aborted&&g>=2)if(self.clearTimeout(this.requestTimeout),l.loading.first===0&&(l.loading.first=Math.max(self.performance.now(),l.loading.start)),g===4){m.onreadystatechange=null,m.onprogress=null;var o=m.status,s=m.responseType==="arraybuffer";if(o>=200&&o<300&&(s&&m.response||m.responseText!==null)){l.loading.end=Math.max(self.performance.now(),l.loading.first);var n,r;if(s?(n=m.response,r=n.byteLength):(n=m.responseText,r=n.length),l.loaded=l.total=r,!this.callbacks)return;var v=this.callbacks.onProgress;if(v&&v(l,c,n,m),!this.callbacks)return;var E={url:m.responseURL,data:n};this.callbacks.onSuccess(E,l,c,m)}else l.retry>=_.maxRetry||o>=400&&o<499?(k.logger.error(o+" while loading "+c.url),this.callbacks.onError({code:o,text:m.statusText},c,m)):(k.logger.warn(o+" while loading "+c.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,_.maxRetryDelay),l.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout)}},u.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},u.loadprogress=function(c){var m=this.stats;m.loaded=c.loaded,c.lengthComputable&&(m.total=c.total)},u.getCacheAge=function(){var c=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");c=m?parseFloat(m):null}return c},w}();const I=e},"./node_modules/eventemitter3/index.js":Q=>{"use strict";var K=Object.prototype.hasOwnProperty,C="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(C=!1));function O(w,u,p){this.fn=w,this.context=u,this.once=p||!1}function B(w,u,p,c,m){if(typeof p!="function")throw new TypeError("The listener must be a function");var l=new O(p,c||w,m),g=C?C+u:u;return w._events[g]?w._events[g].fn?w._events[g]=[w._events[g],l]:w._events[g].push(l):(w._events[g]=l,w._eventsCount++),w}function e(w,u){--w._eventsCount===0?w._events=new k:delete w._events[u]}function I(){this._events=new k,this._eventsCount=0}I.prototype.eventNames=function(){var u=[],p,c;if(this._eventsCount===0)return u;for(c in p=this._events)K.call(p,c)&&u.push(C?c.slice(1):c);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},I.prototype.listeners=function(u){var p=C?C+u:u,c=this._events[p];if(!c)return[];if(c.fn)return[c.fn];for(var m=0,l=c.length,g=new Array(l);m<l;m++)g[m]=c[m].fn;return g},I.prototype.listenerCount=function(u){var p=C?C+u:u,c=this._events[p];return c?c.fn?1:c.length:0},I.prototype.emit=function(u,p,c,m,l,g){var _=C?C+u:u;if(!this._events[_])return!1;var o=this._events[_],s=arguments.length,n,r;if(o.fn){switch(o.once&&this.removeListener(u,o.fn,void 0,!0),s){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,p),!0;case 3:return o.fn.call(o.context,p,c),!0;case 4:return o.fn.call(o.context,p,c,m),!0;case 5:return o.fn.call(o.context,p,c,m,l),!0;case 6:return o.fn.call(o.context,p,c,m,l,g),!0}for(r=1,n=new Array(s-1);r<s;r++)n[r-1]=arguments[r];o.fn.apply(o.context,n)}else{var v=o.length,E;for(r=0;r<v;r++)switch(o[r].once&&this.removeListener(u,o[r].fn,void 0,!0),s){case 1:o[r].fn.call(o[r].context);break;case 2:o[r].fn.call(o[r].context,p);break;case 3:o[r].fn.call(o[r].context,p,c);break;case 4:o[r].fn.call(o[r].context,p,c,m);break;default:if(!n)for(E=1,n=new Array(s-1);E<s;E++)n[E-1]=arguments[E];o[r].fn.apply(o[r].context,n)}}return!0},I.prototype.on=function(u,p,c){return B(this,u,p,c,!1)},I.prototype.once=function(u,p,c){return B(this,u,p,c,!0)},I.prototype.removeListener=function(u,p,c,m){var l=C?C+u:u;if(!this._events[l])return this;if(!p)return e(this,l),this;var g=this._events[l];if(g.fn)g.fn===p&&(!m||g.once)&&(!c||g.context===c)&&e(this,l);else{for(var _=0,o=[],s=g.length;_<s;_++)(g[_].fn!==p||m&&!g[_].once||c&&g[_].context!==c)&&o.push(g[_]);o.length?this._events[l]=o.length===1?o[0]:o:e(this,l)}return this},I.prototype.removeAllListeners=function(u){var p;return u?(p=C?C+u:u,this._events[p]&&e(this,p)):(this._events=new k,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=C,I.EventEmitter=I,Q.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q){(function(K){var C=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,k=/^(?=([^\/?#]*))\1([^]*)$/,O=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(I,w,u){if(u=u||{},I=I.trim(),w=w.trim(),!w){if(!u.alwaysNormalize)return I;var p=e.parseURL(I);if(!p)throw new Error("Error trying to parse base URL.");return p.path=e.normalizePath(p.path),e.buildURLFromParts(p)}var c=e.parseURL(w);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return u.alwaysNormalize?(c.path=e.normalizePath(c.path),e.buildURLFromParts(c)):w;var m=e.parseURL(I);if(!m)throw new Error("Error trying to parse base URL.");if(!m.netLoc&&m.path&&m.path[0]!=="/"){var l=k.exec(m.path);m.netLoc=l[1],m.path=l[2]}m.netLoc&&!m.path&&(m.path="/");var g={scheme:m.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(g.netLoc=m.netLoc,c.path[0]!=="/"))if(!c.path)g.path=m.path,c.params||(g.params=m.params,c.query||(g.query=m.query));else{var _=m.path,o=_.substring(0,_.lastIndexOf("/")+1)+c.path;g.path=e.normalizePath(o)}return g.path===null&&(g.path=u.alwaysNormalize?e.normalizePath(c.path):c.path),e.buildURLFromParts(g)},parseURL:function(I){var w=C.exec(I);return w?{scheme:w[1]||"",netLoc:w[2]||"",path:w[3]||"",params:w[4]||"",query:w[5]||"",fragment:w[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(O,"");I.length!==(I=I.replace(B,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};Q.exports=e})(this)}},j={};function Z(Q){var K=j[Q];if(K!==void 0)return K.exports;var C=j[Q]={exports:{}};return Fe[Q].call(C.exports,C,C.exports,Z),C.exports}Z.m=Fe,Z.n=Q=>{var K=Q&&Q.__esModule?()=>Q.default:()=>Q;return Z.d(K,{a:K}),K},Z.d=(Q,K)=>{for(var C in K)Z.o(K,C)&&!Z.o(Q,C)&&Object.defineProperty(Q,C,{enumerable:!0,get:K[C]})},Z.o=(Q,K)=>Object.prototype.hasOwnProperty.call(Q,K),Z.r=Q=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})};var ae=Z("./src/hls.ts");return ae=ae.default,ae})())},19575:function(Et,Fe,j){var Z,ae;(function(Q,K){Et.exports=K(Q)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof j.g!="undefined"?j.g:this,function(Q){"use strict";Q=Q||{};var K=Q.Base64,C="2.6.4",k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=function(i){for(var t={},h=0,b=i.length;h<b;h++)t[i.charAt(h)]=h;return t}(k),B=String.fromCharCode,e=function(i){if(i.length<2){var t=i.charCodeAt(0);return t<128?i:t<2048?B(192|t>>>6)+B(128|t&63):B(224|t>>>12&15)+B(128|t>>>6&63)+B(128|t&63)}else{var t=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return B(240|t>>>18&7)+B(128|t>>>12&63)+B(128|t>>>6&63)+B(128|t&63)}},I=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=function(i){return i.replace(I,e)},u=function(i){var t=[0,2,1][i.length%3],h=i.charCodeAt(0)<<16|(i.length>1?i.charCodeAt(1):0)<<8|(i.length>2?i.charCodeAt(2):0),b=[k.charAt(h>>>18),k.charAt(h>>>12&63),t>=2?"=":k.charAt(h>>>6&63),t>=1?"=":k.charAt(h&63)];return b.join("")},p=Q.btoa&&typeof Q.btoa=="function"?function(i){return Q.btoa(i)}:function(i){if(i.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return i.replace(/[\s\S]{1,3}/g,u)},c=function(i){return p(w(String(i)))},m=function(i){return i.replace(/[+\/]/g,function(t){return t=="+"?"-":"_"}).replace(/=/g,"")},l=function(i,t){return t?m(c(i)):c(i)},g=function(i){return l(i,!0)},_;Q.Uint8Array&&(_=function(i,t){for(var h="",b=0,T=i.length;b<T;b+=3){var y=i[b],d=i[b+1],R=i[b+2],M=y<<16|d<<8|R;h+=k.charAt(M>>>18)+k.charAt(M>>>12&63)+(typeof d!="undefined"?k.charAt(M>>>6&63):"=")+(typeof R!="undefined"?k.charAt(M&63):"=")}return t?m(h):h});var o=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,s=function(i){switch(i.length){case 4:var t=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),h=t-65536;return B((h>>>10)+55296)+B((h&1023)+56320);case 3:return B((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return B((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},n=function(i){return i.replace(o,s)},r=function(i){var t=i.length,h=t%4,b=(t>0?O[i.charAt(0)]<<18:0)|(t>1?O[i.charAt(1)]<<12:0)|(t>2?O[i.charAt(2)]<<6:0)|(t>3?O[i.charAt(3)]:0),T=[B(b>>>16),B(b>>>8&255),B(b&255)];return T.length-=[0,0,2,1][h],T.join("")},v=Q.atob&&typeof Q.atob=="function"?function(i){return Q.atob(i)}:function(i){return i.replace(/\S{1,4}/g,r)},E=function(i){return v(String(i).replace(/[^A-Za-z0-9\+\/]/g,""))},f=function(i){return n(v(i))},S=function(i){return String(i).replace(/[-_]/g,function(t){return t=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},L=function(i){return f(S(i))},A;Q.Uint8Array&&(A=function(i){return Uint8Array.from(E(S(i)),function(t){return t.charCodeAt(0)})});var D=function(){var i=Q.Base64;return Q.Base64=K,i};if(Q.Base64={VERSION:C,atob:E,btoa:p,fromBase64:L,toBase64:l,utob:w,encode:l,encodeURI:g,btou:n,decode:L,noConflict:D,fromUint8Array:_,toUint8Array:A},typeof Object.defineProperty=="function"){var a=function(i){return{value:i,enumerable:!1,writable:!0,configurable:!0}};Q.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",a(function(){return L(this)})),Object.defineProperty(String.prototype,"toBase64",a(function(i){return l(this,i)})),Object.defineProperty(String.prototype,"toBase64URI",a(function(){return l(this,!0)}))}}return Q.Meteor&&(Base64=Q.Base64),Et.exports?Et.exports.Base64=Q.Base64:(Z=[],ae=function(){return Q.Base64}.apply(Fe,Z),ae!==void 0&&(Et.exports=ae)),{Base64:Q.Base64}})},84204:function(Et,Fe,j){"use strict";var Z,ae;function Q(K,C,k){var O=function(B,e){return K.js_beautify(B,e)};return O.js=K.js_beautify,O.css=C.css_beautify,O.html=k.html_beautify,O.js_beautify=K.js_beautify,O.css_beautify=C.css_beautify,O.html_beautify=k.html_beautify,O}Z=[j(77937),j(85040),j(3566)],ae=function(K,C,k){return Q(K,C,k)}.apply(Fe,Z),ae!==void 0&&(Et.exports=ae)},85040:function(Et,Fe){var j,Z;(function(){var ae;(function(){"use strict";var K=[,,function(B){function e(u){this.__parent=u,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=[]}e.prototype.clone_empty=function(){var u=new e(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},e.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},e.prototype.has_match=function(u){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(u))return!0;return!1},e.prototype.set_indent=function(u,p){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(u){this.__items.push(u);var p=u.lastIndexOf(`
`);p!==-1?this.__character_count=u.length-p:this.__character_count+=u.length},e.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function I(u,p){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),p=p||"",u.indent_level>0&&(p=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}I.prototype.get_indent_size=function(u,p){var c=this.__base_string_length;return p=p||0,u<0&&(c=0),c+=u*this.__indent_size,c+=p,c},I.prototype.get_indent_string=function(u,p){var c=this.__base_string;return p=p||0,u<0&&(u=0,c=""),p+=u*this.__indent_size,this.__ensure_cache(p),c+=this.__cache[p],c},I.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},I.prototype.__add_column=function(){var u=this.__cache.length,p=0,c="";this.__indent_size&&u>=this.__indent_size&&(p=Math.floor(u/this.__indent_size),u-=p*this.__indent_size,c=new Array(p+1).join(this.__indent_string)),u&&(c+=new Array(u+1).join(" ")),this.__cache.push(c)};function w(u,p){this.__indent_cache=new I(u,p),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}w.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},w.prototype.get_line_number=function(){return this.__lines.length},w.prototype.get_indent_string=function(u,p){return this.__indent_cache.get_indent_string(u,p)},w.prototype.get_indent_size=function(u,p){return this.__indent_cache.get_indent_size(u,p)},w.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},w.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},w.prototype.get_code=function(u){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return u!==`
`&&(c=c.replace(/[\n]/g,u)),c},w.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},w.prototype.set_indent=function(u,p){return u=u||0,p=p||0,this.next_line.set_indent(u,p),this.__lines.length>1?(this.current_line.set_indent(u,p),!0):(this.current_line.set_indent(),!1)},w.prototype.add_raw_token=function(u){for(var p=0;p<u.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},w.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},w.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(" "))},w.prototype.remove_indent=function(u){for(var p=this.__lines.length;u<p;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},w.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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},w.prototype.just_added_newline=function(){return this.current_line.is_empty()},w.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},w.prototype.ensure_empty_line_above=function(u,p){for(var c=this.__lines.length-2;c>=0;){var m=this.__lines[c];if(m.is_empty())break;if(m.item(0).indexOf(u)!==0&&m.item(-1)!==p){this.__lines.splice(c+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},B.exports.Output=w},,,,function(B){function e(u,p){this.raw_options=I(u,p),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"])}e.prototype._get_array=function(u,p){var c=this.raw_options[u],m=p||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(m=c.concat()):typeof c=="string"&&(m=c.split(/[^a-zA-Z0-9_\/\-]+/)),m},e.prototype._get_boolean=function(u,p){var c=this.raw_options[u],m=c===void 0?!!p:!!c;return m},e.prototype._get_characters=function(u,p){var c=this.raw_options[u],m=p||"";return typeof c=="string"&&(m=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),m},e.prototype._get_number=function(u,p){var c=this.raw_options[u];p=parseInt(p,10),isNaN(p)&&(p=0);var m=parseInt(c,10);return isNaN(m)&&(m=p),m},e.prototype._get_selection=function(u,p,c){var m=this._get_selection_list(u,p,c);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[u]+"'");return m[0]},e.prototype._get_selection_list=function(u,p,c){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[p[0]],!this._is_valid_selection(c,p))throw new Error("Invalid Default Value!");var m=this._get_array(u,c);if(!this._is_valid_selection(m,p))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[u]+"'");return m},e.prototype._is_valid_selection=function(u,p){return u.length&&p.length&&!u.some(function(c){return p.indexOf(c)===-1})};function I(u,p){var c={};u=w(u);var m;for(m in u)m!==p&&(c[m]=u[m]);if(p&&u[p])for(m in u[p])c[m]=u[p][m];return c}function w(u){var p={},c;for(c in u){var m=c.replace(/-/g,"_");p[m]=u[c]}return p}B.exports.Options=e,B.exports.normalizeOpts=w,B.exports.mergeOpts=I},,function(B){var e=RegExp.prototype.hasOwnProperty("sticky");function I(w){this.__input=w||"",this.__input_length=this.__input.length,this.__position=0}I.prototype.restart=function(){this.__position=0},I.prototype.back=function(){this.__position>0&&(this.__position-=1)},I.prototype.hasNext=function(){return this.__position<this.__input_length},I.prototype.next=function(){var w=null;return this.hasNext()&&(w=this.__input.charAt(this.__position),this.__position+=1),w},I.prototype.peek=function(w){var u=null;return w=w||0,w+=this.__position,w>=0&&w<this.__input_length&&(u=this.__input.charAt(w)),u},I.prototype.__match=function(w,u){w.lastIndex=u;var p=w.exec(this.__input);return p&&!(e&&w.sticky)&&p.index!==u&&(p=null),p},I.prototype.test=function(w,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(w,u):!1},I.prototype.testChar=function(w,u){var p=this.peek(u);return w.lastIndex=0,p!==null&&w.test(p)},I.prototype.match=function(w){var u=this.__match(w,this.__position);return u?this.__position+=u[0].length:u=null,u},I.prototype.read=function(w,u,p){var c="",m;return w&&(m=this.match(w),m&&(c+=m[0])),u&&(m||!w)&&(c+=this.readUntil(u,p)),c},I.prototype.readUntil=function(w,u){var p="",c=this.__position;w.lastIndex=this.__position;var m=w.exec(this.__input);return m?(c=m.index,u&&(c+=m[0].length)):c=this.__input_length,p=this.__input.substring(this.__position,c),this.__position=c,p},I.prototype.readUntilAfter=function(w){return this.readUntil(w,!0)},I.prototype.get_regexp=function(w,u){var p=null,c="g";return u&&e&&(c="y"),typeof w=="string"&&w!==""?p=new RegExp(w,c):w&&(p=new RegExp(w.source,c)),p},I.prototype.get_literal_regexp=function(w){return RegExp(w.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},I.prototype.peekUntilAfter=function(w){var u=this.__position,p=this.readUntilAfter(w);return this.__position=u,p},I.prototype.lookBack=function(w){var u=this.__position-1;return u>=w.length&&this.__input.substring(u-w.length,u).toLowerCase()===w},B.exports.InputScanner=I},,,,,function(B){function e(I,w){I=typeof I=="string"?I:I.source,w=typeof w=="string"?w:w.source,this.__directives_block_pattern=new RegExp(I+/ beautify( \w+[:]\w+)+ /.source+w,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(I+/\sbeautify\signore:end\s/.source+w,"g")}e.prototype.get_directives=function(I){if(!I.match(this.__directives_block_pattern))return null;var w={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(I);u;)w[u[1]]=u[2],u=this.__directive_pattern.exec(I);return w},e.prototype.readIgnored=function(I){return I.readUntilAfter(this.__directives_end_ignore_pattern)},B.exports.Directives=e},,function(B,e,I){var w=I(16).Beautifier,u=I(17).Options;function p(c,m){var l=new w(c,m);return l.beautify()}B.exports=p,B.exports.defaultOptions=function(){return new u}},function(B,e,I){var w=I(17).Options,u=I(2).Output,p=I(8).InputScanner,c=I(13).Directives,m=new c(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,g=/\r\n|[\r\n]/g,_=/\s/,o=/(?:\s|\n)+/g,s=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,n=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function r(v,E){this._source_text=v||"",this._options=new w(E),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"]}r.prototype.eatString=function(v){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(v.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return E},r.prototype.eatWhitespace=function(v){for(var E=_.test(this._input.peek()),f=0;_.test(this._input.peek());)this._ch=this._input.next(),v&&this._ch===`
`&&(f===0||f<this._options.max_preserve_newlines)&&(f++,this._output.add_new_line(!0));return E},r.prototype.foundNestedPseudoClass=function(){for(var v=0,E=1,f=this._input.peek(E);f;){if(f==="{")return!0;if(f==="(")v+=1;else if(f===")"){if(v===0)return!1;v-=1}else if(f===";"||f==="}")return!1;E++,f=this._input.peek(E)}return!1},r.prototype.print_string=function(v){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(v)},r.prototype.preserveSingleSpace=function(v){v&&(this._output.space_before_token=!0)},r.prototype.indent=function(){this._indentLevel++},r.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},r.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,E=this._options.eol;E==="auto"&&(E=`
`,v&&l.test(v||"")&&(E=v.match(l)[0])),v=v.replace(g,`
`);var f=v.match(/^[\t ]*/)[0];this._output=new u(this._options,f),this._input=new p(v),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var S=0,L=!1,A=!1,D=!1,a=!1,i=!1,t=!1,h=this._ch,b=!1,T,y,d;T=this._input.read(o),y=T!=="",d=h,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),h=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var R=this._input.read(s),M=m.get_directives(R);M&&M.ignore==="start"&&(R+=m.readIgnored(this._input)),this.print_string(R),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(n)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(y),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var F=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);F.match(/[ :]$/)&&(F=this.eatString(": ").replace(/\s$/,""),this.print_string(F),this._output.space_before_token=!0),F=F.replace(/\s$/,""),F==="extend"?a=!0:F==="import"&&(i=!0),F in this.NESTED_AT_RULE?(this._nestedLevel+=1,F in this.CONDITIONAL_GROUP_RULE&&(D=!0)):!L&&S===0&&F.indexOf(":")!==-1&&(A=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")A&&(A=!1,this.outdent()),D?(D=!1,L=this._indentLevel>=this._nestedLevel):L=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&L&&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)):(d==="("?this._output.space_before_token=!1:d!==","&&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(),d==="{"&&this._output.trim(!0),i=!1,a=!1,A&&(this.outdent(),A=!1),this.print_string(this._ch),L=!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 U=0;U<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;U++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[U])){b=!0;break}(L||D)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!a&&S===0?(this.print_string(":"),A||(A=!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 V=d==='"'||d==="'";this.preserveSingleSpace(V||y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")b=!1,S===0?(A&&(this.outdent(),A=!1),a=!1,i=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),S++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),S&&(S--,this.outdent()));else{var re=!1;this._input.lookBack("with")&&(re=!0),this.preserveSingleSpace(y||re),this.print_string(this._ch),A&&d==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),t=!0):(this.eatWhitespace(),S++,this.indent())}else if(this._ch===")")S&&(S--,this.outdent()),t&&this._input.peek()===";"&&this._options.selector_separator_newline&&(t=!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&&(!A||t)&&S===0&&!i&&!a?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!A&&S===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&_.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),_.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 $=d==='"'||d==="'";this.preserveSingleSpace($||y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&b&&this._output.add_new_line()}var le=this._output.get_code(E);return le},B.exports.Beautifier=r},function(B,e,I){var w=I(6).Options;function u(p){w.call(this,p,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var c=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||c;var m=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<m.length;l++)m[l]!=="expand"?this.brace_style="collapse":this.brace_style=m[l]}u.prototype=new w,B.exports.Options=u}],C={};function k(B){var e=C[B];if(e!==void 0)return e.exports;var I=C[B]={exports:{}};return K[B](I,I.exports,k),I.exports}var O=k(15);ae=O})();var Q=ae;j=[],Z=function(){return{css_beautify:Q}}.apply(Fe,j),Z!==void 0&&(Et.exports=Z)})()},3566:function(Et,Fe,j){var Z,ae;(function(){var Q;(function(){"use strict";var O=[,,function(w){function u(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}u.prototype.clone_empty=function(){var m=new u(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},u.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},u.prototype.has_match=function(m){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(m))return!0;return!1},u.prototype.set_indent=function(m,l){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},u.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(m){this.__items.push(m);var l=m.lastIndexOf(`
`);l!==-1?this.__character_count=m.length-l:this.__character_count+=m.length},u.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function p(m,l){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),l=l||"",m.indent_level>0&&(l=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}p.prototype.get_indent_size=function(m,l){var g=this.__base_string_length;return l=l||0,m<0&&(g=0),g+=m*this.__indent_size,g+=l,g},p.prototype.get_indent_string=function(m,l){var g=this.__base_string;return l=l||0,m<0&&(m=0,g=""),l+=m*this.__indent_size,this.__ensure_cache(l),g+=this.__cache[l],g},p.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var m=this.__cache.length,l=0,g="";this.__indent_size&&m>=this.__indent_size&&(l=Math.floor(m/this.__indent_size),m-=l*this.__indent_size,g=new Array(l+1).join(this.__indent_string)),m&&(g+=new Array(m+1).join(" ")),this.__cache.push(g)};function c(m,l){this.__indent_cache=new p(m,l),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(m,l){return this.__indent_cache.get_indent_string(m,l)},c.prototype.get_indent_size=function(m,l){return this.__indent_cache.get_indent_size(m,l)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(m){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(`
`);return m!==`
`&&(g=g.replace(/[\n]/g,m)),g},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(m,l){return m=m||0,l=l||0,this.next_line.set_indent(m,l),this.__lines.length>1?(this.current_line.set_indent(m,l),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(m){for(var l=0;l<m.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(m){for(var l=this.__lines.length;m<l;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(m,l){for(var g=this.__lines.length-2;g>=0;){var _=this.__lines[g];if(_.is_empty())break;if(_.item(0).indexOf(m)!==0&&_.item(-1)!==l){this.__lines.splice(g+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},w.exports.Output=c},function(w){function u(p,c,m,l){this.type=p,this.text=c,this.comments_before=null,this.newlines=m||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}w.exports.Token=u},,,function(w){function u(m,l){this.raw_options=p(m,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}u.prototype._get_array=function(m,l){var g=this.raw_options[m],_=l||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(_=g.concat()):typeof g=="string"&&(_=g.split(/[^a-zA-Z0-9_\/\-]+/)),_},u.prototype._get_boolean=function(m,l){var g=this.raw_options[m],_=g===void 0?!!l:!!g;return _},u.prototype._get_characters=function(m,l){var g=this.raw_options[m],_=l||"";return typeof g=="string"&&(_=g.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),_},u.prototype._get_number=function(m,l){var g=this.raw_options[m];l=parseInt(l,10),isNaN(l)&&(l=0);var _=parseInt(g,10);return isNaN(_)&&(_=l),_},u.prototype._get_selection=function(m,l,g){var _=this._get_selection_list(m,l,g);if(_.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return _[0]},u.prototype._get_selection_list=function(m,l,g){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[l[0]],!this._is_valid_selection(g,l))throw new Error("Invalid Default Value!");var _=this._get_array(m,g);if(!this._is_valid_selection(_,l))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return _},u.prototype._is_valid_selection=function(m,l){return m.length&&l.length&&!m.some(function(g){return l.indexOf(g)===-1})};function p(m,l){var g={};m=c(m);var _;for(_ in m)_!==l&&(g[_]=m[_]);if(l&&m[l])for(_ in m[l])g[_]=m[l][_];return g}function c(m){var l={},g;for(g in m){var _=g.replace(/-/g,"_");l[_]=m[g]}return l}w.exports.Options=u,w.exports.normalizeOpts=c,w.exports.mergeOpts=p},,function(w){var u=RegExp.prototype.hasOwnProperty("sticky");function p(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},p.prototype.peek=function(c){var m=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(m=this.__input.charAt(c)),m},p.prototype.__match=function(c,m){c.lastIndex=m;var l=c.exec(this.__input);return l&&!(u&&c.sticky)&&l.index!==m&&(l=null),l},p.prototype.test=function(c,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(c,m):!1},p.prototype.testChar=function(c,m){var l=this.peek(m);return c.lastIndex=0,l!==null&&c.test(l)},p.prototype.match=function(c){var m=this.__match(c,this.__position);return m?this.__position+=m[0].length:m=null,m},p.prototype.read=function(c,m,l){var g="",_;return c&&(_=this.match(c),_&&(g+=_[0])),m&&(_||!c)&&(g+=this.readUntil(m,l)),g},p.prototype.readUntil=function(c,m){var l="",g=this.__position;c.lastIndex=this.__position;var _=c.exec(this.__input);return _?(g=_.index,m&&(g+=_[0].length)):g=this.__input_length,l=this.__input.substring(this.__position,g),this.__position=g,l},p.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},p.prototype.get_regexp=function(c,m){var l=null,g="g";return m&&u&&(g="y"),typeof c=="string"&&c!==""?l=new RegExp(c,g):c&&(l=new RegExp(c.source,g)),l},p.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(c){var m=this.__position,l=this.readUntilAfter(c);return this.__position=m,l},p.prototype.lookBack=function(c){var m=this.__position-1;return m>=c.length&&this.__input.substring(m-c.length,m).toLowerCase()===c},w.exports.InputScanner=p},function(w,u,p){var c=p(8).InputScanner,m=p(3).Token,l=p(10).TokenStream,g=p(11).WhitespacePattern,_={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(s,n){this._input=new c(s),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new g(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var s,n=new m(_.START,""),r=null,v=[],E=new l;n.type!==_.EOF;){for(s=this._get_next_token(n,r);this._is_comment(s);)E.add(s),s=this._get_next_token(n,r);E.isEmpty()||(s.comments_before=E,E=new l),s.parent=r,this._is_opening(s)?(v.push(r),r=s):r&&this._is_closing(s,r)&&(s.opened=r,r.closed=s,r=v.pop(),s.parent=r),s.previous=n,n.next=s,this.__tokens.add(s),n=s}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(s,n){this._readWhitespace();var r=this._input.read(/.+/g);return r?this._create_token(_.RAW,r):this._create_token(_.EOF,"")},o.prototype._is_comment=function(s){return!1},o.prototype._is_opening=function(s){return!1},o.prototype._is_closing=function(s,n){return!1},o.prototype._create_token=function(s,n){var r=new m(s,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return r},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},w.exports.Tokenizer=o,w.exports.TOKEN=_},function(w){function u(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},u.prototype.peek=function(p){var c=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(c=this.__tokens[p]),c},u.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},w.exports.TokenStream=u},function(w,u,p){var c=p(12).Pattern;function m(l,g){c.call(this,l,g),g?this._line_regexp=this._input.get_regexp(g._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new c,m.prototype.__set_whitespace_patterns=function(l,g){l+="\\t ",g+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+g+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+g+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var g=this.__split(this._newline_regexp,l);this.newline_count=g.length-1,this.whitespace_before_token=g[this.newline_count]}return l},m.prototype.matching=function(l,g){var _=this._create();return _.__set_whitespace_patterns(l,g),_._update(),_},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(l,g){l.lastIndex=0;for(var _=0,o=[],s=l.exec(g);s;)o.push(g.substring(_,s.index)),_=s.index+s[0].length,s=l.exec(g);return _<g.length?o.push(g.substring(_,g.length)):o.push(""),o},w.exports.WhitespacePattern=m},function(w){function u(p,c){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}u.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(p){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(p),c._update(),c},u.prototype.until=function(p){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(p),c._update(),c},u.prototype.starting_with=function(p){var c=this._create();return c._starting_pattern=this._input.get_regexp(p,!0),c._update(),c},u.prototype.matching=function(p){var c=this._create();return c._match_pattern=this._input.get_regexp(p,!0),c._update(),c},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},w.exports.Pattern=u},function(w){function u(p,c){p=typeof p=="string"?p:p.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+c,"g")}u.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(p);m;)c[m[1]]=m[2],m=this.__directive_pattern.exec(p);return c},u.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},w.exports.Directives=u},function(w,u,p){var c=p(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(g,_){c.call(this,g,_),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),_&&(this.__template_pattern=this._input.get_regexp(_.__template_pattern),this._excluded=Object.assign(this._excluded,_._excluded),this._disabled=Object.assign(this._disabled,_._disabled));var o=new c(g);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new c,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(g){var _=this._create();return _._disabled[g]=!0,_._update(),_},l.prototype.read_options=function(g){var _=this._create();for(var o in m)_._disabled[o]=g.templating.indexOf(o)===-1;return _._update(),_},l.prototype.exclude=function(g){var _=this._create();return _._excluded[g]=!0,_._update(),_},l.prototype.read=function(){var g="";this._match_pattern?g=this._input.read(this._starting_pattern):g=this._input.read(this._starting_pattern,this.__template_pattern);for(var _=this._read_template();_;)this._match_pattern?_+=this._input.read(this._match_pattern):_+=this._input.readUntil(this.__template_pattern),g+=_,_=this._read_template();return this._until_after&&(g+=this._input.readUntilAfter(this._until_pattern)),g},l.prototype.__set_templated_pattern=function(){var g=[];this._disabled.php||g.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||g.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(g.push(this.__patterns.django._starting_pattern.source),g.push(this.__patterns.django_value._starting_pattern.source),g.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||g.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&g.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+g.join("|")+")")},l.prototype._read_template=function(){var g="",_=this._input.peek();if(_==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(g=g||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(g=g||this.__patterns.erb.read())}else _==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(g=g||this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars_unescaped.read(),g=g||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(g=g||this.__patterns.django_value.read()),this._excluded.django||(g=g||this.__patterns.django_comment.read(),g=g||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(g=g||this.__patterns.smarty_comment.read(),g=g||this.__patterns.smarty_literal.read(),g=g||this.__patterns.smarty.read()));return g},w.exports.TemplatablePattern=l},,,,function(w,u,p){var c=p(19).Beautifier,m=p(20).Options;function l(g,_,o,s){var n=new c(g,_,o,s);return n.beautify()}w.exports=l,w.exports.defaultOptions=function(){return new m}},function(w,u,p){var c=p(20).Options,m=p(2).Output,l=p(21).Tokenizer,g=p(21).TOKEN,_=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(a,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=a.max_preserve_newlines,this.preserve_newlines=a.preserve_newlines,this._output=new m(a,i)};s.prototype.current_line_has_match=function(a){return this._output.current_line.has_match(a)},s.prototype.set_space_before_token=function(a,i){this._output.space_before_token=a,this._output.non_breaking_space=i},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(a){this._output.add_raw_token(a)},s.prototype.print_preserved_newlines=function(a){var i=0;a.type!==g.TEXT&&a.previous.type!==g.TEXT&&(i=a.newlines?1:0),this.preserve_newlines&&(i=a.newlines<this.max_preserve_newlines+1?a.newlines:this.max_preserve_newlines+1);for(var t=0;t<i;t++)this.print_newline(t>0);return i!==0},s.prototype.traverse_whitespace=function(a){return a.whitespace_before||a.newlines?(this.print_preserved_newlines(a)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(a){this._output.add_new_line(a)},s.prototype.print_token=function(a){a.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(a.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(a){return a=this.indent_level+(a||0),a<1?"":this._output.get_indent_string(a)};var n=function(a){for(var i=null,t=a.next;t.type!==g.EOF&&a.closed!==t;){if(t.type===g.ATTRIBUTE&&t.text==="type"){t.next&&t.next.type===g.EQUALS&&t.next.next&&t.next.next.type===g.VALUE&&(i=t.next.next.text);break}t=t.next}return i},r=function(a,i){var t=null,h=null;return i.closed?(a==="script"?t="text/javascript":a==="style"&&(t="text/css"),t=n(i)||t,t.search("text/css")>-1?h="css":t.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?h="javascript":t.search(/(text|application|dojo)\/(x-)?(html)/)>-1?h="html":t.search(/test\/null/)>-1&&(h="null"),h):null};function v(a,i){return i.indexOf(a)!==-1}function E(a,i,t){this.parent=a||null,this.tag=i?i.tag_name:"",this.indent_level=t||0,this.parser_token=i||null}function f(a){this._printer=a,this._current_frame=null}f.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},f.prototype.record_tag=function(a){var i=new E(this._current_frame,a,this._printer.indent_level);this._current_frame=i},f.prototype._try_pop_frame=function(a){var i=null;return a&&(i=a.parser_token,this._printer.indent_level=a.indent_level,this._current_frame=a.parent),i},f.prototype._get_frame=function(a,i){for(var t=this._current_frame;t&&a.indexOf(t.tag)===-1;){if(i&&i.indexOf(t.tag)!==-1){t=null;break}t=t.parent}return t},f.prototype.try_pop=function(a,i){var t=this._get_frame([a],i);return this._try_pop_frame(t)},f.prototype.indent_to_tag=function(a){var i=this._get_frame(a);i&&(this._printer.indent_level=i.indent_level)};function S(a,i,t,h){this._source_text=a||"",i=i||{},this._js_beautify=t,this._css_beautify=h,this._tag_stack=null;var b=new c(i,"html");this._options=b,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="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,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var a=this._source_text,i=this._options.eol;this._options.eol==="auto"&&(i=`
`,a&&_.test(a)&&(i=a.match(_)[0])),a=a.replace(o,`
`);var t=a.match(/^[\t ]*/)[0],h={text:"",type:""},b=new L,T=new s(this._options,t),y=new l(a,this._options).tokenize();this._tag_stack=new f(T);for(var d=null,R=y.next();R.type!==g.EOF;)R.type===g.TAG_OPEN||R.type===g.COMMENT?(d=this._handle_tag_open(T,R,b,h),b=d):R.type===g.ATTRIBUTE||R.type===g.EQUALS||R.type===g.VALUE||R.type===g.TEXT&&!b.tag_complete?d=this._handle_inside_tag(T,R,b,y):R.type===g.TAG_CLOSE?d=this._handle_tag_close(T,R,b):R.type===g.TEXT?d=this._handle_text(T,R,b):T.add_raw_token(R),h=d,R=y.next();var M=T._output.get_code(i);return M},S.prototype._handle_tag_close=function(a,i,t){var h={text:i.text,type:i.type};return a.alignment_size=0,t.tag_complete=!0,a.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),t.is_unformatted?a.add_raw_token(i):(t.tag_start_char==="<"&&(a.set_space_before_token(i.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&t.has_wrapped_attrs&&a.print_newline(!1)),a.print_token(i)),t.indent_content&&!(t.is_unformatted||t.is_content_unformatted)&&(a.indent(),t.indent_content=!1),!t.is_inline_element&&!(t.is_unformatted||t.is_content_unformatted)&&a.set_wrap_point(),h},S.prototype._handle_inside_tag=function(a,i,t,h){var b=t.has_wrapped_attrs,T={text:i.text,type:i.type};if(a.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),t.is_unformatted)a.add_raw_token(i);else if(t.tag_start_char==="{"&&i.type===g.TEXT)a.print_preserved_newlines(i)?(i.newlines=0,a.add_raw_token(i)):a.print_token(i);else{if(i.type===g.ATTRIBUTE?(a.set_space_before_token(!0),t.attr_count+=1):(i.type===g.EQUALS||i.type===g.VALUE&&i.previous.type===g.EQUALS)&&a.set_space_before_token(!1),i.type===g.ATTRIBUTE&&t.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(a.traverse_whitespace(i),b=b||i.newlines!==0),this._is_wrap_attributes_force)){var y=t.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&t.attr_count===1){var d=!0,R=0,M;do{if(M=h.peek(R),M.type===g.ATTRIBUTE){d=!1;break}R+=1}while(R<4&&M.type!==g.EOF&&M.type!==g.TAG_CLOSE);y=!d}y&&(a.print_newline(!1),b=!0)}a.print_token(i),b=b||a.previous_token_wrapped(),t.has_wrapped_attrs=b}return T},S.prototype._handle_text=function(a,i,t){var h={text:i.text,type:"TK_CONTENT"};return t.custom_beautifier_name?this._print_custom_beatifier_text(a,i,t):t.is_unformatted||t.is_content_unformatted?a.add_raw_token(i):(a.traverse_whitespace(i),a.print_token(i)),h},S.prototype._print_custom_beatifier_text=function(a,i,t){var h=this;if(i.text!==""){var b=i.text,T,y=1,d="",R="";t.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?T=this._js_beautify:t.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?T=this._css_beautify:t.custom_beautifier_name==="html"&&(T=function($,le){var te=new S($,le,h._js_beautify,h._css_beautify);return te.beautify()}),this._options.indent_scripts==="keep"?y=0:this._options.indent_scripts==="separate"&&(y=-a.indent_level);var M=a.get_full_indent(y);if(b=b.replace(/\n[ \t]*$/,""),t.custom_beautifier_name!=="html"&&b[0]==="<"&&b.match(/^(<!--|<!\[CDATA\[)/)){var F=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(b);if(!F){a.add_raw_token(i);return}d=M+F[1]+`
`,b=F[4],F[5]&&(R=M+F[5]),b=b.replace(/\n[ \t]*$/,""),(F[2]||F[3].indexOf(`
`)!==-1)&&(F=F[3].match(/[ \t]+$/),F&&(i.whitespace_before=F[0]))}if(b)if(T){var U=function(){this.eol=`
`};U.prototype=this._options.raw_options;var V=new U;b=T(M+b,V)}else{var re=i.whitespace_before;re&&(b=b.replace(new RegExp(`
(`+re+")?","g"),`
`)),b=M+b.replace(/\n/g,`
`+M)}d&&(b?b=d+b+`
`+R:b=d+R),a.print_newline(!1),b&&(i.text=b,i.whitespace_before="",i.newlines=0,a.add_raw_token(i),a.print_newline(!0))}},S.prototype._handle_tag_open=function(a,i,t,h){var b=this._get_tag_open_token(i);return(t.is_unformatted||t.is_content_unformatted)&&!t.is_empty_element&&i.type===g.TAG_OPEN&&i.text.indexOf("</")===0?(a.add_raw_token(i),b.start_tag_token=this._tag_stack.try_pop(b.tag_name)):(a.traverse_whitespace(i),this._set_tag_position(a,i,b,t,h),b.is_inline_element||a.set_wrap_point(),a.print_token(i)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(b.alignment_size=i.text.length+1),!b.tag_complete&&!b.is_unformatted&&(a.alignment_size=b.alignment_size),b};var L=function(a,i){if(this.parent=a||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="",!i)this.tag_complete=!0;else{var t;this.tag_start_char=i.text[0],this.text=i.text,this.tag_start_char==="<"?(t=i.text.match(/^<([^\s>]*)/),this.tag_check=t?t[1]:""):(t=i.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=t?t[1]:"",(i.text.startsWith("{{#>")||i.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&i.next!==null?this.tag_check=i.next.text.split(" ")[0]:this.tag_check=i.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),i.type===g.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||i.closed&&i.closed.text==="/>";var h=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(h=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(h)))}};S.prototype._get_tag_open_token=function(a){var i=new L(this._tag_stack.get_parser_token(),a);return i.alignment_size=this._options.wrap_attributes_indent_size,i.is_end_tag=i.is_end_tag||v(i.tag_check,this._options.void_elements),i.is_empty_element=i.tag_complete||i.is_start_tag&&i.is_end_tag,i.is_unformatted=!i.tag_complete&&v(i.tag_check,this._options.unformatted),i.is_content_unformatted=!i.is_empty_element&&v(i.tag_check,this._options.content_unformatted),i.is_inline_element=v(i.tag_name,this._options.inline)||i.tag_name.includes("-")||i.tag_start_char==="{",i},S.prototype._set_tag_position=function(a,i,t,h,b){if(t.is_empty_element||(t.is_end_tag?t.start_tag_token=this._tag_stack.try_pop(t.tag_name):(this._do_optional_end_element(t)&&(t.is_inline_element||a.print_newline(!1)),this._tag_stack.record_tag(t),(t.tag_name==="script"||t.tag_name==="style")&&!(t.is_unformatted||t.is_content_unformatted)&&(t.custom_beautifier_name=r(t.tag_check,i)))),v(t.tag_check,this._options.extra_liners)&&(a.print_newline(!1),a._output.just_added_blankline()||a.print_newline(!0)),t.is_empty_element){if(t.tag_start_char==="{"&&t.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),t.indent_content=!0;var T=a.current_line_has_match(/{{#if/);T||a.print_newline(!1)}t.tag_name==="!--"&&b.type===g.TAG_CLOSE&&h.is_end_tag&&t.text.indexOf(`
`)===-1||(t.is_inline_element||t.is_unformatted||a.print_newline(!1),this._calcluate_parent_multiline(a,t))}else if(t.is_end_tag){var y=!1;y=t.start_tag_token&&t.start_tag_token.multiline_content,y=y||!t.is_inline_element&&!(h.is_inline_element||h.is_unformatted)&&!(b.type===g.TAG_CLOSE&&t.start_tag_token===h)&&b.type!=="TK_CONTENT",(t.is_content_unformatted||t.is_unformatted)&&(y=!1),y&&a.print_newline(!1)}else t.indent_content=!t.custom_beautifier_name,t.tag_start_char==="<"&&(t.tag_name==="html"?t.indent_content=this._options.indent_inner_html:t.tag_name==="head"?t.indent_content=this._options.indent_head_inner_html:t.tag_name==="body"&&(t.indent_content=this._options.indent_body_inner_html)),!(t.is_inline_element||t.is_unformatted)&&(b.type!=="TK_CONTENT"||t.is_content_unformatted)&&a.print_newline(!1),this._calcluate_parent_multiline(a,t)},S.prototype._calcluate_parent_multiline=function(a,i){i.parent&&a._output.just_added_newline()&&!((i.is_inline_element||i.is_unformatted)&&i.parent.is_inline_element)&&(i.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"],D=["a","audio","del","ins","map","noscript","video"];S.prototype._do_optional_end_element=function(a){var i=null;if(!(a.is_empty_element||!a.is_start_tag||!a.parent)){if(a.tag_name==="body")i=i||this._tag_stack.try_pop("head");else if(a.tag_name==="li")i=i||this._tag_stack.try_pop("li",["ol","ul"]);else if(a.tag_name==="dd"||a.tag_name==="dt")i=i||this._tag_stack.try_pop("dt",["dl"]),i=i||this._tag_stack.try_pop("dd",["dl"]);else if(a.parent.tag_name==="p"&&A.indexOf(a.tag_name)!==-1){var t=a.parent.parent;(!t||D.indexOf(t.tag_name)===-1)&&(i=i||this._tag_stack.try_pop("p"))}else a.tag_name==="rp"||a.tag_name==="rt"?(i=i||this._tag_stack.try_pop("rt",["ruby","rtc"]),i=i||this._tag_stack.try_pop("rp",["ruby","rtc"])):a.tag_name==="optgroup"?i=i||this._tag_stack.try_pop("optgroup",["select"]):a.tag_name==="option"?i=i||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):a.tag_name==="colgroup"?i=i||this._tag_stack.try_pop("caption",["table"]):a.tag_name==="thead"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"])):a.tag_name==="tbody"||a.tag_name==="tfoot"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("thead",["table"]),i=i||this._tag_stack.try_pop("tbody",["table"])):a.tag_name==="tr"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(a.tag_name==="th"||a.tag_name==="td")&&(i=i||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),i=i||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return a.parent=this._tag_stack.get_parser_token(),i}},w.exports.Beautifier=S},function(w,u,p){var c=p(6).Options;function m(l){c.call(this,l,"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"])}m.prototype=new c,w.exports.Options=m},function(w,u,p){var c=p(9).Tokenizer,m=p(9).TOKEN,l=p(13).Directives,g=p(14).TemplatablePattern,_=p(12).Pattern,o={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:m.START,RAW:m.RAW,EOF:m.EOF},s=new l(/<\!--/,/-->/),n=function(r,v){c.call(this,r,v),this._current_tag_name="";var E=new g(this._input).read_options(this._options),f=new _(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),handlebars_comment:f.starting_with(/{{!--/).until_after(/--}}/),handlebars:f.starting_with(/{{/).until_after(/}}/),handlebars_open:f.until(/[\n\r\t }]/),handlebars_raw_close:f.until(/}}/),comment:f.starting_with(/<!--/).until_after(/-->/),cdata:f.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:f.starting_with(/<!\[/).until_after(/]>/),processing:f.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 S=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=f.matching(S).until_after(S)}};n.prototype=new c,n.prototype._is_comment=function(r){return!1},n.prototype._is_opening=function(r){return r.type===o.TAG_OPEN},n.prototype._is_closing=function(r,v){return r.type===o.TAG_CLOSE&&v&&((r.text===">"||r.text==="/>")&&v.text[0]==="<"||r.text==="}}"&&v.text[0]==="{"&&v.text[1]==="{")},n.prototype._reset=function(){this._current_tag_name=""},n.prototype._get_next_token=function(r,v){var E=null;this._readWhitespace();var f=this._input.peek();return f===null?this._create_token(o.EOF,""):(E=E||this._read_open_handlebars(f,v),E=E||this._read_attribute(f,r,v),E=E||this._read_close(f,v),E=E||this._read_raw_content(f,r,v),E=E||this._read_content_word(f),E=E||this._read_comment_or_cdata(f),E=E||this._read_processing(f),E=E||this._read_open(f,v),E=E||this._create_token(o.UNKNOWN,this._input.next()),E)},n.prototype._read_comment_or_cdata=function(r){var v=null,E=null,f=null;if(r==="<"){var S=this._input.peek(1);S==="!"&&(E=this.__patterns.comment.read(),E?(f=s.get_directives(E),f&&f.ignore==="start"&&(E+=s.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(v=this._create_token(o.COMMENT,E),v.directives=f)}return v},n.prototype._read_processing=function(r){var v=null,E=null,f=null;if(r==="<"){var S=this._input.peek(1);(S==="!"||S==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(v=this._create_token(o.COMMENT,E),v.directives=f)}return v},n.prototype._read_open=function(r,v){var E=null,f=null;return v||r==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),f=this._create_token(o.TAG_OPEN,E)),f},n.prototype._read_open_handlebars=function(r,v){var E=null,f=null;return v||this._options.indent_handlebars&&r==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),f=this._create_token(o.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),f=this._create_token(o.TAG_OPEN,E))),f},n.prototype._read_close=function(r,v){var E=null,f=null;return v&&(v.text[0]==="<"&&(r===">"||r==="/"&&this._input.peek(1)===">")?(E=this._input.next(),r==="/"&&(E+=this._input.next()),f=this._create_token(o.TAG_CLOSE,E)):v.text[0]==="{"&&r==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),f=this._create_token(o.TAG_CLOSE,"}}"))),f},n.prototype._read_attribute=function(r,v,E){var f=null,S="";if(E&&E.text[0]==="<")if(r==="=")f=this._create_token(o.EQUALS,this._input.next());else if(r==='"'||r==="'"){var L=this._input.next();r==='"'?L+=this.__patterns.double_quote.read():L+=this.__patterns.single_quote.read(),f=this._create_token(o.VALUE,L)}else S=this.__patterns.attribute.read(),S&&(v.type===o.EQUALS?f=this._create_token(o.VALUE,S):f=this._create_token(o.ATTRIBUTE,S));return f},n.prototype._is_content_unformatted=function(r){return this._options.void_elements.indexOf(r)===-1&&(this._options.content_unformatted.indexOf(r)!==-1||this._options.unformatted.indexOf(r)!==-1)},n.prototype._read_raw_content=function(r,v,E){var f="";if(E&&E.text[0]==="{")f=this.__patterns.handlebars_raw_close.read();else if(v.type===o.TAG_CLOSE&&v.opened.text[0]==="<"&&v.text[0]!=="/"){var S=v.opened.text.substr(1).toLowerCase();if(S==="script"||S==="style"){var L=this._read_comment_or_cdata(r);if(L)return L.type=o.TEXT,L;f=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(S)&&(f=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig")))}return f?this._create_token(o.TEXT,f):null},n.prototype._read_content_word=function(r){var v="";if(this._options.unformatted_content_delimiter&&r===this._options.unformatted_content_delimiter[0]&&(v=this.__patterns.unformatted_content_delimiter.read()),v||(v=this.__patterns.word.read()),v)return this._create_token(o.TEXT,v)},w.exports.Tokenizer=n,w.exports.TOKEN=o}],B={};function e(w){var u=B[w];if(u!==void 0)return u.exports;var p=B[w]={exports:{}};return O[w](p,p.exports,e),p.exports}var I=e(18);Q=I})();var K=Q;if(1)Z=[j,j(77937),j(85040)],ae=function(O){var B=j(77937),e=j(85040);return{html_beautify:function(I,w){return K(I,w,B.js_beautify,e.css_beautify)}}}.apply(Fe,Z),ae!==void 0&&(Et.exports=ae);else var C,k})()},77937:function(Et,Fe){var j,Z;(function(){var ae;(function(){"use strict";var K=[function(B,e,I){var w=I(1).Beautifier,u=I(5).Options;function p(c,m){var l=new w(c,m);return l.beautify()}B.exports=p,B.exports.defaultOptions=function(){return new u}},function(B,e,I){var w=I(2).Output,u=I(3).Token,p=I(4),c=I(5).Options,m=I(7).Tokenizer,l=I(7).line_starters,g=I(7).positionable_operators,_=I(7).TOKEN;function o(d,R){return R.indexOf(d)!==-1}function s(d){return d.replace(/^\s+/g,"")}function n(d){for(var R={},M=0;M<d.length;M++)R[d[M].replace(/-/g,"_")]=d[M];return R}function r(d,R){return d&&d.type===_.RESERVED&&d.text===R}function v(d,R){return d&&d.type===_.RESERVED&&o(d.text,R)}var E=["case","return","do","if","throw","else","await","break","continue","async"],f=["before-newline","after-newline","preserve-newline"],S=n(f),L=[S.before_newline,S.preserve_newline],A={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function D(d,R){R.multiline_frame||R.mode===A.ForInitializer||R.mode===A.Conditional||d.remove_indent(R.start_line_index)}function a(d){d=d.replace(p.allLineBreaks,`
`);for(var R=[],M=d.indexOf(`
`);M!==-1;)R.push(d.substring(0,M)),d=d.substring(M+1),M=d.indexOf(`
`);return d.length&&R.push(d),R}function i(d){return d===A.ArrayLiteral}function t(d){return o(d,[A.Expression,A.ForInitializer,A.Conditional])}function h(d,R){for(var M=0;M<d.length;M++){var F=d[M].trim();if(F.charAt(0)!==R)return!1}return!0}function b(d,R){for(var M=0,F=d.length,U;M<F;M++)if(U=d[M],U&&U.indexOf(R)!==0)return!1;return!0}function T(d,R){R=R||{},this._source_text=d||"",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 c(R)}T.prototype.create_flags=function(d,R){var M=0;d&&(M=d.indentation_level,!this._output.just_added_newline()&&d.line_indent_level>M&&(M=d.line_indent_level));var F={mode:R,parent:d,last_token:d?d.last_token:new u(_.START_BLOCK,""),last_word:d?d.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:M,alignment:0,line_indent_level:d?d.line_indent_level:M,start_line_index:this._output.get_line_number(),ternary_depth:0};return F},T.prototype._reset=function(d){var R=d.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new w(this._options,R),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(A.BlockStatement);var M=new m(d,this._options);return this._tokens=M.tokenize(),d},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var d,R=this._reset(this._source_text),M=this._options.eol;this._options.eol==="auto"&&(M=`
`,R&&p.lineBreak.test(R||"")&&(M=R.match(p.lineBreak)[0]));for(var F=this._tokens.next();F;)this.handle_token(F),this._last_last_text=this._flags.last_token.text,this._flags.last_token=F,F=this._tokens.next();return d=this._output.get_code(M),d},T.prototype.handle_token=function(d,R){d.type===_.START_EXPR?this.handle_start_expr(d):d.type===_.END_EXPR?this.handle_end_expr(d):d.type===_.START_BLOCK?this.handle_start_block(d):d.type===_.END_BLOCK?this.handle_end_block(d):d.type===_.WORD?this.handle_word(d):d.type===_.RESERVED?this.handle_word(d):d.type===_.SEMICOLON?this.handle_semicolon(d):d.type===_.STRING?this.handle_string(d):d.type===_.EQUALS?this.handle_equals(d):d.type===_.OPERATOR?this.handle_operator(d):d.type===_.COMMA?this.handle_comma(d):d.type===_.BLOCK_COMMENT?this.handle_block_comment(d,R):d.type===_.COMMENT?this.handle_comment(d,R):d.type===_.DOT?this.handle_dot(d):d.type===_.EOF?this.handle_eof(d):d.type===_.UNKNOWN?this.handle_unknown(d,R):this.handle_unknown(d,R)},T.prototype.handle_whitespace_and_comments=function(d,R){var M=d.newlines,F=this._options.keep_array_indentation&&i(this._flags.mode);if(d.comments_before)for(var U=d.comments_before.next();U;)this.handle_whitespace_and_comments(U,R),this.handle_token(U,R),U=d.comments_before.next();if(F)for(var V=0;V<M;V+=1)this.print_newline(V>0,R);else if(this._options.max_preserve_newlines&&M>this._options.max_preserve_newlines&&(M=this._options.max_preserve_newlines),this._options.preserve_newlines&&M>1){this.print_newline(!1,R);for(var re=1;re<M;re+=1)this.print_newline(!0,R)}};var y=["async","break","continue","return","throw","yield"];T.prototype.allow_wrap_or_preserved_newline=function(d,R){if(R=R===void 0?!1:R,!this._output.just_added_newline()){var M=this._options.preserve_newlines&&d.newlines||R,F=o(this._flags.last_token.text,g)||o(d.text,g);if(F){var U=o(this._flags.last_token.text,g)&&o(this._options.operator_position,L)||o(d.text,g);M=M&&U}if(M)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(v(this._flags.last_token,y))return;this._output.set_wrap_point()}}},T.prototype.print_newline=function(d,R){if(!R&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==_.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var M=this._tokens.peek();this._flags.mode===A.Statement&&!(this._flags.if_block&&r(M,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(d)&&(this._flags.multiline_frame=!0)},T.prototype.print_token_line_indentation=function(d){this._output.just_added_newline()&&(this._options.keep_array_indentation&&d.newlines&&(d.text==="["||i(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(d.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))},T.prototype.print_token=function(d){if(this._output.raw){this._output.add_raw_token(d);return}if(this._options.comma_first&&d.previous&&d.previous.type===_.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var R=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(R),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(d),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(d),this._output.non_breaking_space=!0,this._output.add_token(d.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},T.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.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))},T.prototype.set_mode=function(d){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,d),this._flags=this.create_flags(this._previous_flags,d),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},T.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===A.Statement&&D(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},T.prototype.start_of_object_property=function(){return this._flags.parent.mode===A.ObjectLiteral&&this._flags.mode===A.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"]))},T.prototype.start_of_statement=function(d){var R=!1;return R=R||v(this._flags.last_token,["var","let","const"])&&d.type===_.WORD,R=R||r(this._flags.last_token,"do"),R=R||!(this._flags.parent.mode===A.ObjectLiteral&&this._flags.mode===A.Statement)&&v(this._flags.last_token,y)&&!d.newlines,R=R||r(this._flags.last_token,"else")&&!(r(d,"if")&&!d.comments_before),R=R||this._flags.last_token.type===_.END_EXPR&&(this._previous_flags.mode===A.ForInitializer||this._previous_flags.mode===A.Conditional),R=R||this._flags.last_token.type===_.WORD&&this._flags.mode===A.BlockStatement&&!this._flags.in_case&&!(d.text==="--"||d.text==="++")&&this._last_last_text!=="function"&&d.type!==_.WORD&&d.type!==_.RESERVED,R=R||this._flags.mode===A.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"])),R?(this.set_mode(A.Statement),this.indent(),this.handle_whitespace_and_comments(d,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d,v(d,["do","for","if","while"])),!0):!1},T.prototype.handle_start_expr=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d);var R=A.Expression;if(d.text==="["){if(this._flags.last_token.type===_.WORD||this._flags.last_token.text===")"){v(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(d),this.set_mode(R),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}R=A.ArrayLiteral,i(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()),o(this._flags.last_token.type,[_.START_EXPR,_.END_EXPR,_.WORD,_.OPERATOR,_.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===_.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,R=A.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,R=A.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&d.whitespace_before===""?this._output.space_before_token=!1:(o(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===_.EQUALS||this._flags.last_token.type===_.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d);else if(this._flags.last_token.type===_.WORD){this._output.space_before_token=!1;var M=this._tokens.peek(-3);if(this._options.space_after_named_function&&M){var F=this._tokens.peek(-4);v(M,["async","function"])||M.text==="*"&&v(F,["async","function"])?this._output.space_before_token=!0:this._flags.mode===A.ObjectLiteral?(M.text==="{"||M.text===","||M.text==="*"&&(F.text==="{"||F.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(d);(this._flags.last_token.type===_.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===A.ObjectLiteral&&o(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===_.START_BLOCK?this.print_newline():(this._flags.last_token.type===_.END_EXPR||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===_.COMMA)&&this.allow_wrap_or_preserved_newline(d,d.newlines),this.print_token(d),this.set_mode(R),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},T.prototype.handle_end_expr=function(d){for(;this._flags.mode===A.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(d,d.text==="]"&&i(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===_.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(d),this.restore_mode(),D(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===A.Conditional&&(this._previous_flags.mode=A.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},T.prototype.handle_start_block=function(d){this.handle_whitespace_and_comments(d);var R=this._tokens.peek(),M=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===_.END_EXPR?(this.set_mode(A.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(A.BlockStatement):M&&(o(M.text,[":",","])&&o(R.type,[_.STRING,_.WORD,_.RESERVED])||o(R.text,["get","set","..."])&&o(M.type,[_.WORD,_.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(M.text,[":",","])?this.set_mode(A.BlockStatement):this.set_mode(A.ObjectLiteral):this._flags.last_token.type===_.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(A.BlockStatement):o(this._flags.last_token.type,[_.EQUALS,_.START_EXPR,_.COMMA,_.OPERATOR])||v(this._flags.last_token,["return","throw","import","default"])?this.set_mode(A.ObjectLiteral):this.set_mode(A.BlockStatement),this._flags.last_token&&v(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var F=!R.comments_before&&R.text==="}",U=F&&this._flags.last_word==="function"&&this._flags.last_token.type===_.END_EXPR;if(this._options.brace_preserve_inline){var V=0,re=null;this._flags.inline_frame=!0;do if(V+=1,re=this._tokens.peek(V-1),re.newlines){this._flags.inline_frame=!1;break}while(re.type!==_.EOF&&!(re.type===_.END_BLOCK&&re.opened===d))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==_.OPERATOR&&(U||this._flags.last_token.type===_.EQUALS||v(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(i(this._previous_flags.mode)&&(this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.COMMA)&&((this._flags.last_token.type===_.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(d),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==_.OPERATOR&&this._flags.last_token.type!==_.START_EXPR&&(this._flags.last_token.type===_.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(d),this.indent(),!F&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},T.prototype.handle_end_block=function(d){for(this.handle_whitespace_and_comments(d);this._flags.mode===A.Statement;)this.restore_mode();var R=this._flags.last_token.type===_.START_BLOCK;this._flags.inline_frame&&!R?this._output.space_before_token=!0:this._options.brace_style==="expand"?R||this.print_newline():R||(i(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(d)},T.prototype.handle_word=function(d){if(d.type===_.RESERVED){if(o(d.text,["set","get"])&&this._flags.mode!==A.ObjectLiteral)d.type=_.WORD;else if(d.text==="import"&&o(this._tokens.peek().text,["(","."]))d.type=_.WORD;else if(o(d.text,["as","from"])&&!this._flags.import_block)d.type=_.WORD;else if(this._flags.mode===A.ObjectLiteral){var R=this._tokens.peek();R.text===":"&&(d.type=_.WORD)}}if(this.start_of_statement(d)?v(this._flags.last_token,["var","let","const"])&&d.type===_.WORD&&(this._flags.declaration_statement=!0):d.newlines&&!t(this._flags.mode)&&(this._flags.last_token.type!==_.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==_.EQUALS&&(this._options.preserve_newlines||!v(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(d),this.print_newline()):this.handle_whitespace_and_comments(d),this._flags.do_block&&!this._flags.do_while)if(r(d,"while")){this._output.space_before_token=!0,this.print_token(d),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&&r(d,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===A.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&v(d,["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(d),this._flags.in_case=!0;return}if((this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.EQUALS||this._flags.last_token.type===_.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d)),r(d,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===_.OPERATOR))&&!this._output.just_added_blankline()&&!d.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD?v(this._flags.last_token,["get","set","new","export"])||v(this._flags.last_token,y)?this._output.space_before_token=!0:r(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===_.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(t(this._flags.mode)||i(this._flags.mode))||this.print_newline(),this.print_token(d),this._flags.last_word=d.text;return}var M="NONE";if(this._flags.last_token.type===_.END_BLOCK?this._previous_flags.inline_frame?M="SPACE":v(d,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines?M="NEWLINE":(M="SPACE",this._output.space_before_token=!0):M="NEWLINE":this._flags.last_token.type===_.SEMICOLON&&this._flags.mode===A.BlockStatement?M="NEWLINE":this._flags.last_token.type===_.SEMICOLON&&t(this._flags.mode)?M="SPACE":this._flags.last_token.type===_.STRING?M="NEWLINE":this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===A.ObjectLiteral&&o(this._last_last_text,["{",","]))?M="SPACE":this._flags.last_token.type===_.START_BLOCK?this._flags.inline_frame?M="SPACE":M="NEWLINE":this._flags.last_token.type===_.END_EXPR&&(this._output.space_before_token=!0,M="NEWLINE"),v(d,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?M="SPACE":M="NEWLINE"),v(d,["else","catch","finally"]))if((!(this._flags.last_token.type===_.END_BLOCK&&this._previous_flags.mode===A.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var F=this._output.current_line;F.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else M==="NEWLINE"?v(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&v(d,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==_.END_EXPR?(this._flags.last_token.type!==_.START_EXPR||!v(d,["var","let","const"]))&&this._flags.last_token.text!==":"&&(r(d,"if")&&r(d.previous,"else")?this._output.space_before_token=!0:this.print_newline()):v(d,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&i(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():M==="SPACE"&&(this._output.space_before_token=!0);d.previous&&(d.previous.type===_.WORD||d.previous.type===_.RESERVED)&&(this._output.space_before_token=!0),this.print_token(d),this._flags.last_word=d.text,d.type===_.RESERVED&&(d.text==="do"?this._flags.do_block=!0:d.text==="if"?this._flags.if_block=!0:d.text==="import"?this._flags.import_block=!0:this._flags.import_block&&r(d,"from")&&(this._flags.import_block=!1))},T.prototype.handle_semicolon=function(d){this.start_of_statement(d)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(d);for(var R=this._tokens.peek();this._flags.mode===A.Statement&&!(this._flags.if_block&&r(R,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(d)},T.prototype.handle_string=function(d){d.text.startsWith("`")&&d.newlines===0&&d.whitespace_before===""&&(d.previous.text===")"||this._flags.last_token.type===_.WORD)||(this.start_of_statement(d)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(d),this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.EQUALS||this._flags.last_token.type===_.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d):d.text.startsWith("`")&&this._flags.last_token.type===_.END_EXPR&&(d.previous.text==="]"||d.previous.text===")")&&d.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(d)},T.prototype.handle_equals=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0},T.prototype.handle_comma=function(d){this.handle_whitespace_and_comments(d,!0),this.print_token(d),this._output.space_before_token=!0,this._flags.declaration_statement?(t(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(d)):this._flags.mode===A.ObjectLiteral||this._flags.mode===A.Statement&&this._flags.parent.mode===A.ObjectLiteral?(this._flags.mode===A.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(d)},T.prototype.handle_operator=function(d){var R=d.text==="*"&&(v(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[_.START_BLOCK,_.COMMA,_.END_BLOCK,_.SEMICOLON])),M=o(d.text,["-","+"])&&(o(this._flags.last_token.type,[_.START_BLOCK,_.START_EXPR,_.EQUALS,_.OPERATOR])||o(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(d)){var F=!R;this.handle_whitespace_and_comments(d,F)}if(d.text==="*"&&this._flags.last_token.type===_.DOT){this.print_token(d);return}if(d.text==="::"){this.print_token(d);return}if(this._flags.last_token.type===_.OPERATOR&&o(this._options.operator_position,L)&&this.allow_wrap_or_preserved_newline(d),d.text===":"&&this._flags.in_case){this.print_token(d),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==_.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 U=!0,V=!0,re=!1;if(d.text===":"?this._flags.ternary_depth===0?U=!1:(this._flags.ternary_depth-=1,re=!0):d.text==="?"&&(this._flags.ternary_depth+=1),!M&&!R&&this._options.preserve_newlines&&o(d.text,g)){var $=d.text===":",le=$&&re,te=$&&!re;switch(this._options.operator_position){case S.before_newline:this._output.space_before_token=!te,this.print_token(d),(!$||le)&&this.allow_wrap_or_preserved_newline(d),this._output.space_before_token=!0;return;case S.after_newline:this._output.space_before_token=!0,!$||le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(d):this._output.space_before_token=!1,this.print_token(d),this._output.space_before_token=!0;return;case S.preserve_newline:te||this.allow_wrap_or_preserved_newline(d),U=!(this._output.just_added_newline()||te),this._output.space_before_token=U,this.print_token(d),this._output.space_before_token=!0;return}}if(R){this.allow_wrap_or_preserved_newline(d),U=!1;var _e=this._tokens.peek();V=_e&&o(_e.type,[_.WORD,_.RESERVED])}else if(d.text==="...")this.allow_wrap_or_preserved_newline(d),U=this._flags.last_token.type===_.START_BLOCK,V=!1;else if(o(d.text,["--","++","!","~"])||M){if((this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR)&&this.allow_wrap_or_preserved_newline(d),U=!1,V=!1,d.newlines&&(d.text==="--"||d.text==="++"||d.text==="~")){var fe=v(this._flags.last_token,E)&&d.newlines;fe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(fe,!0)}this._flags.last_token.text===";"&&t(this._flags.mode)&&(U=!0),this._flags.last_token.type===_.RESERVED?U=!0:this._flags.last_token.type===_.END_EXPR?U=!(this._flags.last_token.text==="]"&&(d.text==="--"||d.text==="++")):this._flags.last_token.type===_.OPERATOR&&(U=o(d.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(d.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(V=!0)),(this._flags.mode===A.BlockStatement&&!this._flags.inline_frame||this._flags.mode===A.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||U,this.print_token(d),this._output.space_before_token=V},T.prototype.handle_block_comment=function(d,R){if(this._output.raw){this._output.add_raw_token(d),d.directives&&d.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(d.directives){this.print_newline(!1,R),this.print_token(d),d.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!p.newline.test(d.text)&&!d.newlines){this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0;return}else this.print_block_commment(d,R)},T.prototype.print_block_commment=function(d,R){var M=a(d.text),F,U=!1,V=!1,re=d.whitespace_before,$=re.length;if(this.print_newline(!1,R),this.print_token_line_indentation(d),this._output.add_token(M[0]),this.print_newline(!1,R),M.length>1){for(M=M.slice(1),U=h(M,"*"),V=b(M,re),U&&(this._flags.alignment=1),F=0;F<M.length;F++)U?(this.print_token_line_indentation(d),this._output.add_token(s(M[F]))):V&&M[F]?(this.print_token_line_indentation(d),this._output.add_token(M[F].substring($))):(this._output.current_line.set_indent(-1),this._output.add_token(M[F])),this.print_newline(!1,R);this._flags.alignment=0}},T.prototype.handle_comment=function(d,R){d.newlines?this.print_newline(!1,R):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(d),this.print_newline(!1,R)},T.prototype.handle_dot=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),v(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(d,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(d)},T.prototype.handle_unknown=function(d,R){this.print_token(d),d.text[d.text.length-1]===`
`&&this.print_newline(!1,R)},T.prototype.handle_eof=function(d){for(;this._flags.mode===A.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d)},B.exports.Beautifier=T},function(B){function e(u){this.__parent=u,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=[]}e.prototype.clone_empty=function(){var u=new e(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},e.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},e.prototype.has_match=function(u){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(u))return!0;return!1},e.prototype.set_indent=function(u,p){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(u){this.__items.push(u);var p=u.lastIndexOf(`
`);p!==-1?this.__character_count=u.length-p:this.__character_count+=u.length},e.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function I(u,p){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),p=p||"",u.indent_level>0&&(p=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}I.prototype.get_indent_size=function(u,p){var c=this.__base_string_length;return p=p||0,u<0&&(c=0),c+=u*this.__indent_size,c+=p,c},I.prototype.get_indent_string=function(u,p){var c=this.__base_string;return p=p||0,u<0&&(u=0,c=""),p+=u*this.__indent_size,this.__ensure_cache(p),c+=this.__cache[p],c},I.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},I.prototype.__add_column=function(){var u=this.__cache.length,p=0,c="";this.__indent_size&&u>=this.__indent_size&&(p=Math.floor(u/this.__indent_size),u-=p*this.__indent_size,c=new Array(p+1).join(this.__indent_string)),u&&(c+=new Array(u+1).join(" ")),this.__cache.push(c)};function w(u,p){this.__indent_cache=new I(u,p),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}w.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},w.prototype.get_line_number=function(){return this.__lines.length},w.prototype.get_indent_string=function(u,p){return this.__indent_cache.get_indent_string(u,p)},w.prototype.get_indent_size=function(u,p){return this.__indent_cache.get_indent_size(u,p)},w.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},w.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},w.prototype.get_code=function(u){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return u!==`
`&&(c=c.replace(/[\n]/g,u)),c},w.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},w.prototype.set_indent=function(u,p){return u=u||0,p=p||0,this.next_line.set_indent(u,p),this.__lines.length>1?(this.current_line.set_indent(u,p),!0):(this.current_line.set_indent(),!1)},w.prototype.add_raw_token=function(u){for(var p=0;p<u.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},w.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},w.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(" "))},w.prototype.remove_indent=function(u){for(var p=this.__lines.length;u<p;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},w.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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},w.prototype.just_added_newline=function(){return this.current_line.is_empty()},w.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},w.prototype.ensure_empty_line_above=function(u,p){for(var c=this.__lines.length-2;c>=0;){var m=this.__lines[c];if(m.is_empty())break;if(m.item(0).indexOf(u)!==0&&m.item(-1)!==p){this.__lines.splice(c+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},B.exports.Output=w},function(B){function e(I,w,u,p){this.type=I,this.text=w,this.comments_before=null,this.newlines=u||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}B.exports.Token=e},function(B,e){var I="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",w="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\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",p="\\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",c="(?:\\\\u[0-9a-fA-F]{4}|["+I+u+"])",m="(?:\\\\u[0-9a-fA-F]{4}|["+w+u+p+"])*";e.identifier=new RegExp(c+m,"g"),e.identifierStart=new RegExp(c),e.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+w+u+p+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp(`\r
|`+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(B,e,I){var w=I(6).Options,u=["before-newline","after-newline","preserve-newline"];function p(c){w.call(this,c,"js");var m=this.raw_options.brace_style||null;m==="expand-strict"?this.raw_options.brace_style="expand":m==="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 g=0;g<l.length;g++)l[g]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[g];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",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}p.prototype=new w,B.exports.Options=p},function(B){function e(u,p){this.raw_options=I(u,p),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"])}e.prototype._get_array=function(u,p){var c=this.raw_options[u],m=p||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(m=c.concat()):typeof c=="string"&&(m=c.split(/[^a-zA-Z0-9_\/\-]+/)),m},e.prototype._get_boolean=function(u,p){var c=this.raw_options[u],m=c===void 0?!!p:!!c;return m},e.prototype._get_characters=function(u,p){var c=this.raw_options[u],m=p||"";return typeof c=="string"&&(m=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),m},e.prototype._get_number=function(u,p){var c=this.raw_options[u];p=parseInt(p,10),isNaN(p)&&(p=0);var m=parseInt(c,10);return isNaN(m)&&(m=p),m},e.prototype._get_selection=function(u,p,c){var m=this._get_selection_list(u,p,c);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[u]+"'");return m[0]},e.prototype._get_selection_list=function(u,p,c){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[p[0]],!this._is_valid_selection(c,p))throw new Error("Invalid Default Value!");var m=this._get_array(u,c);if(!this._is_valid_selection(m,p))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[u]+"'");return m},e.prototype._is_valid_selection=function(u,p){return u.length&&p.length&&!u.some(function(c){return p.indexOf(c)===-1})};function I(u,p){var c={};u=w(u);var m;for(m in u)m!==p&&(c[m]=u[m]);if(p&&u[p])for(m in u[p])c[m]=u[p][m];return c}function w(u){var p={},c;for(c in u){var m=c.replace(/-/g,"_");p[m]=u[c]}return p}B.exports.Options=e,B.exports.normalizeOpts=w,B.exports.mergeOpts=I},function(B,e,I){var w=I(8).InputScanner,u=I(9).Tokenizer,p=I(9).TOKEN,c=I(13).Directives,m=I(4),l=I(12).Pattern,g=I(14).TemplatablePattern;function _(h,b){return b.indexOf(h)!==-1}var o={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:p.START,RAW:p.RAW,EOF:p.EOF},s=new c(/\/\*/,/\*\//),n=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,r=/[0-9]/,v=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),f="\\?\\.(?!\\d) "+f,f=f.replace(/ /g,"|");var S=new RegExp(f),L="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),A=L.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),D=new RegExp("^(?:"+A.join("|")+")$"),a,i=function(h,b){u.call(this,h,b),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var T=new l(this._input),y=new g(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(m.identifier).matching(m.identifierMatch),number:T.matching(n),punct:T.matching(S),comment:T.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:T.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:T.matching(/<!--/),html_comment_end:T.matching(/-->/),include:T.starting_with(/#include/).until_after(m.lineBreak),shebang:T.starting_with(/#!/).until_after(m.lineBreak),xml:T.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:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};i.prototype=new u,i.prototype._is_comment=function(h){return h.type===o.COMMENT||h.type===o.BLOCK_COMMENT||h.type===o.UNKNOWN},i.prototype._is_opening=function(h){return h.type===o.START_BLOCK||h.type===o.START_EXPR},i.prototype._is_closing=function(h,b){return(h.type===o.END_BLOCK||h.type===o.END_EXPR)&&b&&(h.text==="]"&&b.text==="["||h.text===")"&&b.text==="("||h.text==="}"&&b.text==="{")},i.prototype._reset=function(){a=!1},i.prototype._get_next_token=function(h,b){var T=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(o.EOF,""):(T=T||this._read_non_javascript(y),T=T||this._read_string(y),T=T||this._read_word(h),T=T||this._read_singles(y),T=T||this._read_comment(y),T=T||this._read_regexp(y,h),T=T||this._read_xml(y,h),T=T||this._read_punctuation(),T=T||this._create_token(o.UNKNOWN,this._input.next()),T)},i.prototype._read_word=function(h){var b;if(b=this.__patterns.identifier.read(),b!=="")return b=b.replace(m.allLineBreaks,`
`),!(h.type===o.DOT||h.type===o.RESERVED&&(h.text==="set"||h.text==="get"))&&D.test(b)?(b==="in"||b==="of")&&(h.type===o.WORD||h.type===o.STRING)?this._create_token(o.OPERATOR,b):this._create_token(o.RESERVED,b):this._create_token(o.WORD,b);if(b=this.__patterns.number.read(),b!=="")return this._create_token(o.WORD,b)},i.prototype._read_singles=function(h){var b=null;return h==="("||h==="["?b=this._create_token(o.START_EXPR,h):h===")"||h==="]"?b=this._create_token(o.END_EXPR,h):h==="{"?b=this._create_token(o.START_BLOCK,h):h==="}"?b=this._create_token(o.END_BLOCK,h):h===";"?b=this._create_token(o.SEMICOLON,h):h==="."&&v.test(this._input.peek(1))?b=this._create_token(o.DOT,h):h===","&&(b=this._create_token(o.COMMA,h)),b&&this._input.next(),b},i.prototype._read_punctuation=function(){var h=this.__patterns.punct.read();if(h!=="")return h==="="?this._create_token(o.EQUALS,h):h==="?."?this._create_token(o.DOT,h):this._create_token(o.OPERATOR,h)},i.prototype._read_non_javascript=function(h){var b="";if(h==="#"){if(this._is_first_token()&&(b=this.__patterns.shebang.read(),b))return this._create_token(o.UNKNOWN,b.trim()+`
`);if(b=this.__patterns.include.read(),b)return this._create_token(o.UNKNOWN,b.trim()+`
`);h=this._input.next();var T="#";if(this._input.hasNext()&&this._input.testChar(r)){do h=this._input.next(),T+=h;while(this._input.hasNext()&&h!=="#"&&h!=="=");return h==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(T+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(T+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,T)}this._input.back()}else if(h==="<"&&this._is_first_token()){if(b=this.__patterns.html_comment_start.read(),b){for(;this._input.hasNext()&&!this._input.testChar(m.newline);)b+=this._input.next();return a=!0,this._create_token(o.COMMENT,b)}}else if(a&&h==="-"&&(b=this.__patterns.html_comment_end.read(),b))return a=!1,this._create_token(o.COMMENT,b);return null},i.prototype._read_comment=function(h){var b=null;if(h==="/"){var T="";if(this._input.peek(1)==="*"){T=this.__patterns.block_comment.read();var y=s.get_directives(T);y&&y.ignore==="start"&&(T+=s.readIgnored(this._input)),T=T.replace(m.allLineBreaks,`
`),b=this._create_token(o.BLOCK_COMMENT,T),b.directives=y}else this._input.peek(1)==="/"&&(T=this.__patterns.comment.read(),b=this._create_token(o.COMMENT,T))}return b},i.prototype._read_string=function(h){if(h==="`"||h==="'"||h==='"'){var b=this._input.next();return this.has_char_escapes=!1,h==="`"?b+=this._read_string_recursive("`",!0,"${"):b+=this._read_string_recursive(h),this.has_char_escapes&&this._options.unescape_strings&&(b=t(b)),this._input.peek()===h&&(b+=this._input.next()),b=b.replace(m.allLineBreaks,`
`),this._create_token(o.STRING,b)}return null},i.prototype._allow_regexp_or_xml=function(h){return h.type===o.RESERVED&&_(h.text,["return","case","throw","else","do","typeof","yield"])||h.type===o.END_EXPR&&h.text===")"&&h.opened.previous.type===o.RESERVED&&_(h.opened.previous.text,["if","while","for"])||_(h.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},i.prototype._read_regexp=function(h,b){if(h==="/"&&this._allow_regexp_or_xml(b)){for(var T=this._input.next(),y=!1,d=!1;this._input.hasNext()&&(y||d||this._input.peek()!==h)&&!this._input.testChar(m.newline);)T+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?d=!0:this._input.peek()==="]"&&(d=!1)),this._input.next();return this._input.peek()===h&&(T+=this._input.next(),T+=this._input.read(m.identifier)),this._create_token(o.STRING,T)}return null},i.prototype._read_xml=function(h,b){if(this._options.e4x&&h==="<"&&this._allow_regexp_or_xml(b)){var T="",y=this.__patterns.xml.read_match();if(y){for(var d=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),R=d.indexOf("{")===0,M=0;y;){var F=!!y[1],U=y[2],V=!!y[y.length-1]||U.slice(0,8)==="![CDATA[";if(!V&&(U===d||R&&U.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(F?--M:++M),T+=y[0],M<=0)break;y=this.__patterns.xml.read_match()}return y||(T+=this._input.match(/[\s\S]*/g)[0]),T=T.replace(m.allLineBreaks,`
`),this._create_token(o.STRING,T)}}return null};function t(h){for(var b="",T=0,y=new w(h),d=null;y.hasNext();)if(d=y.match(/([\s]|[^\\]|\\\\)+/g),d&&(b+=d[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")d=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")d=y.match(/u([0-9A-Fa-f]{4})/g);else{b+="\\",y.hasNext()&&(b+=y.next());continue}if(!d||(T=parseInt(d[1],16),T>126&&T<=255&&d[0].indexOf("x")===0))return h;if(T>=0&&T<32){b+="\\"+d[0];continue}else T===34||T===39||T===92?b+="\\"+String.fromCharCode(T):b+=String.fromCharCode(T)}return b}i.prototype._read_string_recursive=function(h,b,T){var y,d;h==="'"?d=this.__patterns.single_quote:h==='"'?d=this.__patterns.double_quote:h==="`"?d=this.__patterns.template_text:h==="}"&&(d=this.__patterns.template_expression);for(var R=d.read(),M="";this._input.hasNext();){if(M=this._input.next(),M===h||!b&&m.newline.test(M)){this._input.back();break}else M==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===`
`&&this._input.next(),M+=this._input.next()):T&&(T==="${"&&M==="$"&&this._input.peek()==="{"&&(M+=this._input.next()),T===M&&(h==="`"?M+=this._read_string_recursive("}",b,"`"):M+=this._read_string_recursive("`",b,"${"),this._input.hasNext()&&(M+=this._input.next())));M+=d.read(),R+=M}return R},B.exports.Tokenizer=i,B.exports.TOKEN=o,B.exports.positionable_operators=E.slice(),B.exports.line_starters=L.slice()},function(B){var e=RegExp.prototype.hasOwnProperty("sticky");function I(w){this.__input=w||"",this.__input_length=this.__input.length,this.__position=0}I.prototype.restart=function(){this.__position=0},I.prototype.back=function(){this.__position>0&&(this.__position-=1)},I.prototype.hasNext=function(){return this.__position<this.__input_length},I.prototype.next=function(){var w=null;return this.hasNext()&&(w=this.__input.charAt(this.__position),this.__position+=1),w},I.prototype.peek=function(w){var u=null;return w=w||0,w+=this.__position,w>=0&&w<this.__input_length&&(u=this.__input.charAt(w)),u},I.prototype.__match=function(w,u){w.lastIndex=u;var p=w.exec(this.__input);return p&&!(e&&w.sticky)&&p.index!==u&&(p=null),p},I.prototype.test=function(w,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(w,u):!1},I.prototype.testChar=function(w,u){var p=this.peek(u);return w.lastIndex=0,p!==null&&w.test(p)},I.prototype.match=function(w){var u=this.__match(w,this.__position);return u?this.__position+=u[0].length:u=null,u},I.prototype.read=function(w,u,p){var c="",m;return w&&(m=this.match(w),m&&(c+=m[0])),u&&(m||!w)&&(c+=this.readUntil(u,p)),c},I.prototype.readUntil=function(w,u){var p="",c=this.__position;w.lastIndex=this.__position;var m=w.exec(this.__input);return m?(c=m.index,u&&(c+=m[0].length)):c=this.__input_length,p=this.__input.substring(this.__position,c),this.__position=c,p},I.prototype.readUntilAfter=function(w){return this.readUntil(w,!0)},I.prototype.get_regexp=function(w,u){var p=null,c="g";return u&&e&&(c="y"),typeof w=="string"&&w!==""?p=new RegExp(w,c):w&&(p=new RegExp(w.source,c)),p},I.prototype.get_literal_regexp=function(w){return RegExp(w.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},I.prototype.peekUntilAfter=function(w){var u=this.__position,p=this.readUntilAfter(w);return this.__position=u,p},I.prototype.lookBack=function(w){var u=this.__position-1;return u>=w.length&&this.__input.substring(u-w.length,u).toLowerCase()===w},B.exports.InputScanner=I},function(B,e,I){var w=I(8).InputScanner,u=I(3).Token,p=I(10).TokenStream,c=I(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(g,_){this._input=new w(g),this._options=_||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var g,_=new u(m.START,""),o=null,s=[],n=new p;_.type!==m.EOF;){for(g=this._get_next_token(_,o);this._is_comment(g);)n.add(g),g=this._get_next_token(_,o);n.isEmpty()||(g.comments_before=n,n=new p),g.parent=o,this._is_opening(g)?(s.push(o),o=g):o&&this._is_closing(g,o)&&(g.opened=o,o.closed=g,o=s.pop(),g.parent=o),g.previous=_,_.next=g,this.__tokens.add(g),_=g}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(g,_){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(m.RAW,o):this._create_token(m.EOF,"")},l.prototype._is_comment=function(g){return!1},l.prototype._is_opening=function(g){return!1},l.prototype._is_closing=function(g,_){return!1},l.prototype._create_token=function(g,_){var o=new u(g,_,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},B.exports.Tokenizer=l,B.exports.TOKEN=m},function(B){function e(I){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=I}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return this.__tokens_length===0},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var I=null;return this.hasNext()&&(I=this.__tokens[this.__position],this.__position+=1),I},e.prototype.peek=function(I){var w=null;return I=I||0,I+=this.__position,I>=0&&I<this.__tokens_length&&(w=this.__tokens[I]),w},e.prototype.add=function(I){this.__parent_token&&(I.parent=this.__parent_token),this.__tokens.push(I),this.__tokens_length+=1},B.exports.TokenStream=e},function(B,e,I){var w=I(12).Pattern;function u(p,c){w.call(this,p,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new w,u.prototype.__set_whitespace_patterns=function(p,c){p+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var c=this.__split(this._newline_regexp,p);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return p},u.prototype.matching=function(p,c){var m=this._create();return m.__set_whitespace_patterns(p,c),m._update(),m},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(p,c){p.lastIndex=0;for(var m=0,l=[],g=p.exec(c);g;)l.push(c.substring(m,g.index)),m=g.index+g[0].length,g=p.exec(c);return m<c.length?l.push(c.substring(m,c.length)):l.push(""),l},B.exports.WhitespacePattern=u},function(B){function e(I,w){this._input=I,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,w&&(this._starting_pattern=this._input.get_regexp(w._starting_pattern,!0),this._match_pattern=this._input.get_regexp(w._match_pattern,!0),this._until_pattern=this._input.get_regexp(w._until_pattern),this._until_after=w._until_after)}e.prototype.read=function(){var I=this._input.read(this._starting_pattern);return(!this._starting_pattern||I)&&(I+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),I},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(I){var w=this._create();return w._until_after=!0,w._until_pattern=this._input.get_regexp(I),w._update(),w},e.prototype.until=function(I){var w=this._create();return w._until_after=!1,w._until_pattern=this._input.get_regexp(I),w._update(),w},e.prototype.starting_with=function(I){var w=this._create();return w._starting_pattern=this._input.get_regexp(I,!0),w._update(),w},e.prototype.matching=function(I){var w=this._create();return w._match_pattern=this._input.get_regexp(I,!0),w._update(),w},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},B.exports.Pattern=e},function(B){function e(I,w){I=typeof I=="string"?I:I.source,w=typeof w=="string"?w:w.source,this.__directives_block_pattern=new RegExp(I+/ beautify( \w+[:]\w+)+ /.source+w,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(I+/\sbeautify\signore:end\s/.source+w,"g")}e.prototype.get_directives=function(I){if(!I.match(this.__directives_block_pattern))return null;var w={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(I);u;)w[u[1]]=u[2],u=this.__directive_pattern.exec(I);return w},e.prototype.readIgnored=function(I){return I.readUntilAfter(this.__directives_end_ignore_pattern)},B.exports.Directives=e},function(B,e,I){var w=I(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(c,m){w.call(this,c,m),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),m&&(this.__template_pattern=this._input.get_regexp(m.__template_pattern),this._excluded=Object.assign(this._excluded,m._excluded),this._disabled=Object.assign(this._disabled,m._disabled));var l=new w(c);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}/)}}p.prototype=new w,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(c){var m=this._create();return m._disabled[c]=!0,m._update(),m},p.prototype.read_options=function(c){var m=this._create();for(var l in u)m._disabled[l]=c.templating.indexOf(l)===-1;return m._update(),m},p.prototype.exclude=function(c){var m=this._create();return m._excluded[c]=!0,m._update(),m},p.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var m=this._read_template();m;)this._match_pattern?m+=this._input.read(this._match_pattern):m+=this._input.readUntil(this.__template_pattern),c+=m,m=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},p.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},p.prototype._read_template=function(){var c="",m=this._input.peek();if(m==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(c=c||this.__patterns.erb.read())}else m==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},B.exports.TemplatablePattern=p}],C={};function k(B){var e=C[B];if(e!==void 0)return e.exports;var I=C[B]={exports:{}};return K[B](I,I.exports,k),I.exports}var O=k(0);ae=O})();var Q=ae;j=[],Z=function(){return{js_beautify:Q}}.apply(Fe,j),Z!==void 0&&(Et.exports=Z)})()},74741:function(Et,Fe,j){"use strict";j.d(Fe,{Wi:function(){return k},Z0:function(){return O},aU:function(){return C},eZ:function(){return e},wY:function(){return B}});var Z=j(4669),ae=j(9917),Q=j(63580),K=function(I,w,u,p){function c(m){return m instanceof u?m:new u(function(l){l(m)})}return new(u||(u=Promise))(function(m,l){function g(s){try{o(p.next(s))}catch(n){l(n)}}function _(s){try{o(p.throw(s))}catch(n){l(n)}}function o(s){s.done?m(s.value):c(s.value).then(g,_)}o((p=p.apply(I,w||[])).next())})};class C extends ae.JT{constructor(w,u="",p="",c=!0,m){super(),this._onDidChange=this._register(new Z.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=u,this._cssClass=p,this._enabled=c,this._actionCallback=m}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,u){return K(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class k extends ae.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new Z.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.Q5),this.onDidRun=this._onDidRun.event}run(w,u){return K(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let p;try{yield this.runAction(w,u)}catch(c){p=c}this._onDidRun.fire({action:w,error:p})})}runAction(w,u){return K(this,void 0,void 0,function*(){yield w.run(u)})}}class O extends C{constructor(w){super(O.ID,w,w?"separator text":"separator"),this.checked=!1,this.enabled=!1}}O.ID="vs.actions.separator";class B{constructor(w,u,p,c){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=u,this.class=c,this._actions=p}get actions(){return this._actions}dispose(){}run(){return K(this,void 0,void 0,function*(){})}}class e extends C{constructor(){super(e.ID,Q.N("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},35146:function(Et,Fe,j){"use strict";j.d(Fe,{ok:function(){return Z}});function Z(ae,Q){if(!ae)throw new Error(Q?`Assertion failed (${Q})`:"Assertion Failed")}},73046:function(Et,Fe,j){"use strict";j.d(Fe,{CM:function(){return C},JL:function(){return k},dT:function(){return B},fK:function(){return K},lA:function(){return O}});var Z=j(4669);class ae{constructor(){this._icons=new Map,this._onDidRegister=new Z.Q5}add(I){const w=this._icons.get(I.id);w?I.description?w.description=I.description:console.error(`Duplicate registration of codicon ${I.id}`):(this._icons.set(I.id,I),this._onDidRegister.fire(I))}get(I){return this._icons.get(I)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Q=new ae,K=Q;function C(e,I){return new O(e,I)}function k(e){return e?e.replace(/\$\((.*?)\)/g,(I,w)=>` ${w} `).trim():""}class O{constructor(I,w,u){this.id=I,this.definition=w,this.description=u,Q.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var B;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function w(c){if(c instanceof O)return["codicon","codicon-"+c.id];const m=I.exec(c.id);if(!m)return w(O.error);let[,l,g]=m;const _=["codicon","codicon-"+l];return g&&_.push("codicon-modifier-"+g.substr(1)),_}e.asClassNameArray=w;function u(c){return w(c).join(" ")}e.asClassName=u;function p(c){return"."+w(c).join(".")}e.asCSSSelector=p})(B||(B={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(O||(O={}))},17301:function(Et,Fe,j){"use strict";j.d(Fe,{B8:function(){return w},Cp:function(){return K},F0:function(){return B},L6:function(){return I},VV:function(){return O},b1:function(){return e},dL:function(){return Q},ri:function(){return C}});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
`+p.stack):p},0)}}emit(p){this.listeners.forEach(c=>{c(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const ae=new Z;function Q(u){O(u)||ae.onUnexpectedError(u)}function K(u){O(u)||ae.onUnexpectedExternalError(u)}function C(u){if(u instanceof Error){let{name:p,message:c}=u;const m=u.stacktrace||u.stack;return{$isError:!0,name:p,message:c,stack:m}}return u}const k="Canceled";function O(u){return u instanceof Error&&u.name===k&&u.message===k}function B(){const u=new Error(k);return u.name=u.message,u}function e(u){return u?new Error(`Illegal argument: ${u}`):new Error("Illegal argument")}function I(u){return u?new Error(`Illegal state: ${u}`):new Error("Illegal state")}class w extends Error{constructor(p){super("NotSupported"),p&&(this.message=p)}}},4669:function(Et,Fe,j){"use strict";j.d(Fe,{D0:function(){return w},E7:function(){return u},K3:function(){return I},Q5:function(){return e},ZD:function(){return p},ju:function(){return C}});var Z=j(17301),ae=j(9917),Q=j(91741),K=j(84013),C;(function(c){c.None=()=>ae.JT.None;function m(t){return(h,b=null,T)=>{let y=!1,d;return d=t(R=>{if(!y)return d?d.dispose():y=!0,h.call(b,R)},null,T),y&&d.dispose(),d}}c.once=m;function l(t,h){return r((b,T=null,y)=>t(d=>b.call(T,h(d)),null,y))}c.map=l;function g(t,h){return r((b,T=null,y)=>t(d=>{h(d),b.call(T,d)},null,y))}c.forEach=g;function _(t,h){return r((b,T=null,y)=>t(d=>h(d)&&b.call(T,d),null,y))}c.filter=_;function o(t){return t}c.signal=o;function s(...t){return(h,b=null,T)=>(0,ae.F8)(...t.map(y=>y(d=>h.call(b,d),null,T)))}c.any=s;function n(t,h,b){let T=b;return l(t,y=>(T=h(T,y),T))}c.reduce=n;function r(t){let h;const b=new e({onFirstListenerAdd(){h=t(b.fire,b)},onLastListenerRemove(){h.dispose()}});return b.event}function v(t,h,b=100,T=!1,y){let d,R,M,F=0;const U=new e({leakWarningThreshold:y,onFirstListenerAdd(){d=t(V=>{F++,R=h(R,V),T&&!M&&(U.fire(R),R=void 0),clearTimeout(M),M=setTimeout(()=>{const re=R;R=void 0,M=void 0,(!T||F>1)&&U.fire(re),F=0},b)})},onLastListenerRemove(){d.dispose()}});return U.event}c.debounce=v;function E(t,h=(b,T)=>b===T){let b=!0,T;return _(t,y=>{const d=b||!h(y,T);return b=!1,T=y,d})}c.latch=E;function f(t,h){return[c.filter(t,h),c.filter(t,b=>!h(b))]}c.split=f;function S(t,h=!1,b=[]){let T=b.slice(),y=t(M=>{T?T.push(M):R.fire(M)});const d=()=>{T&&T.forEach(M=>R.fire(M)),T=null},R=new e({onFirstListenerAdd(){y||(y=t(M=>R.fire(M)))},onFirstListenerDidAdd(){T&&(h?setTimeout(d):d())},onLastListenerRemove(){y&&y.dispose(),y=null}});return R.event}c.buffer=S;class L{constructor(h){this.event=h}map(h){return new L(l(this.event,h))}forEach(h){return new L(g(this.event,h))}filter(h){return new L(_(this.event,h))}reduce(h,b){return new L(n(this.event,h,b))}latch(){return new L(E(this.event))}debounce(h,b=100,T=!1,y){return new L(v(this.event,h,b,T,y))}on(h,b,T){return this.event(h,b,T)}once(h,b,T){return m(this.event)(h,b,T)}}function A(t){return new L(t)}c.chain=A;function D(t,h,b=T=>T){const T=(...M)=>R.fire(b(...M)),y=()=>t.on(h,T),d=()=>t.removeListener(h,T),R=new e({onFirstListenerAdd:y,onLastListenerRemove:d});return R.event}c.fromNodeEventEmitter=D;function a(t,h,b=T=>T){const T=(...M)=>R.fire(b(...M)),y=()=>t.addEventListener(h,T),d=()=>t.removeEventListener(h,T),R=new e({onFirstListenerAdd:y,onLastListenerRemove:d});return R.event}c.fromDOMEventEmitter=a;function i(t){return new Promise(h=>m(t)(h))}c.toPromise=i})(C||(C={}));class k{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${k._idPool++}`}start(m){this._stopWatch=new K.G(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let O=-1;class B{constructor(m,l=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let l=O;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||m<l)return;this._stacks||(this._stacks=new Map);const g=new Error().stack.split(`
`).slice(3).join(`
`),_=this._stacks.get(g)||0;if(this._stacks.set(g,_+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let o,s=0;for(const[n,r]of this._stacks)(!o||s<r)&&(o=n,s=r);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${s}):`),console.warn(o)}return()=>{const o=this._stacks.get(g)||0;this._stacks.set(g,o-1)}}}class e{constructor(m){var l;this._disposed=!1,this._options=m,this._leakageMon=O>0?new B(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((l=this._options)===null||l===void 0)&&l._profName?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(m,l,g)=>{var _;this._listeners||(this._listeners=new Q.S);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[m,l]:m);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,l);const n=(_=this._leakageMon)===null||_===void 0?void 0:_.check(this._listeners.size),r=(0,ae.OF)(()=>{n&&n(),this._disposed||(s(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return g instanceof ae.SL?g.add(r):Array.isArray(g)&&g.push(r),r}),this._event}fire(m){var l,g;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Q.S);for(let _ of this._listeners)this._deliveryQueue.push([_,m]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[_,o]=this._deliveryQueue.shift();try{typeof _=="function"?_.call(void 0,o):_[0].call(_[1],o)}catch(s){(0,Z.dL)(s)}}(g=this._perfMon)===null||g===void 0||g.stop()}}dispose(){var m,l,g,_,o;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(_=(g=this._options)===null||g===void 0?void 0:g.onLastListenerRemove)===null||_===void 0||_.call(g),(o=this._leakageMon)===null||o===void 0||o.dispose())}}class I extends e{constructor(m){super(m),this._isPaused=0,this._eventQueue=new Q.S,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class w extends I{constructor(m){var l;super(m),this._delay=(l=m.delay)!==null&&l!==void 0?l:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class u{constructor(){this.buffers=[]}wrapEvent(m){return(l,g,_)=>m(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(g,o)):l.call(g,o)},void 0,_)}bufferEvents(m){const l=[];this.buffers.push(l);const g=m();return this.buffers.pop(),l.forEach(_=>_()),g}}class p{constructor(){this.listening=!1,this.inputEvent=C.None,this.inputEventListener=ae.JT.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},88289:function(Et,Fe,j){"use strict";j.d(Fe,{I:function(){return Z}});function Z(ae){const Q=this;let K=!1,C;return function(){return K||(K=!0,C=ae.apply(Q,arguments)),C}}},53725:function(Et,Fe,j){"use strict";j.d(Fe,{$:function(){return Z}});var Z;(function(ae){function Q(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}ae.is=Q;const K=Object.freeze([]);function C(){return K}ae.empty=C;function*k(s){yield s}ae.single=k;function O(s){return s||K}ae.from=O;function B(s){return!s||s[Symbol.iterator]().next().done===!0}ae.isEmpty=B;function e(s){return s[Symbol.iterator]().next().value}ae.first=e;function I(s,n){for(const r of s)if(n(r))return!0;return!1}ae.some=I;function w(s,n){for(const r of s)if(n(r))return r}ae.find=w;function*u(s,n){for(const r of s)n(r)&&(yield r)}ae.filter=u;function*p(s,n){let r=0;for(const v of s)yield n(v,r++)}ae.map=p;function*c(...s){for(const n of s)for(const r of n)yield r}ae.concat=c;function*m(s){for(const n of s)for(const r of n)yield r}ae.concatNested=m;function l(s,n,r){let v=r;for(const E of s)v=n(v,E);return v}ae.reduce=l;function*g(s,n,r=s.length){for(n<0&&(n+=s.length),r<0?r+=s.length:r>s.length&&(r=s.length);n<r;n++)yield s[n]}ae.slice=g;function _(s,n=Number.POSITIVE_INFINITY){const r=[];if(n===0)return[r,s];const v=s[Symbol.iterator]();for(let E=0;E<n;E++){const f=v.next();if(f.done)return[r,ae.empty()];r.push(f.value)}return[r,{[Symbol.iterator](){return v}}]}ae.consume=_;function o(s,n,r=(v,E)=>v===E){const v=s[Symbol.iterator](),E=n[Symbol.iterator]();for(;;){const f=v.next(),S=E.next();if(f.done!==S.done)return!1;if(f.done)return!0;if(!r(f.value,S.value))return!1}}ae.equals=o})(Z||(Z={}))},9917:function(Et,Fe,j){"use strict";j.d(Fe,{B9:function(){return p},F8:function(){return c},JT:function(){return g},Jz:function(){return o},OF:function(){return m},SL:function(){return l},Wf:function(){return u},XK:function(){return _},dk:function(){return I}});var Z=j(88289),ae=j(53725);const Q=!1;let K=null;function C(s){K=s}if(Q){const s="__is_disposable_tracked__";C(new class{trackDisposable(n){const r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{n[s]||console.log(r)},3e3)}setParent(n,r){if(n&&n!==g.None)try{n[s]=!0}catch(v){}}markAsDisposed(n){if(n&&n!==g.None)try{n[s]=!0}catch(r){}}markAsSingleton(n){}})}function k(s){return K==null||K.trackDisposable(s),s}function O(s){K==null||K.markAsDisposed(s)}function B(s,n){K==null||K.setParent(s,n)}function e(s,n){if(K)for(const r of s)K.setParent(r,n)}function I(s){return K==null||K.markAsSingleton(s),s}class w extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`),this.errors=n}}function u(s){return typeof s.dispose=="function"&&s.dispose.length===0}function p(s){if(ae.$.is(s)){let n=[];for(const r of s)if(r)try{r.dispose()}catch(v){n.push(v)}if(n.length===1)throw n[0];if(n.length>1)throw new w(n);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function c(...s){const n=m(()=>p(s));return e(s,n),n}function m(s){const n=k({dispose:(0,Z.I)(()=>{O(n),s()})});return n}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){this._isDisposed||(O(this),this._isDisposed=!0,this.clear())}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return B(n,this),this._isDisposed?l.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}}l.DISABLE_DISPOSED_WARNING=!1;class g{constructor(){this._store=new l,k(this),B(this._store,this)}dispose(){O(this),this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}}g.None=Object.freeze({dispose(){}});class _{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(n){var r;this._isDisposed||n===this._value||((r=this._value)===null||r===void 0||r.dispose(),n&&B(n,this),this._value=n)}clear(){this.value=void 0}dispose(){var n;this._isDisposed=!0,O(this),(n=this._value)===null||n===void 0||n.dispose(),this._value=void 0}clearAndLeak(){const n=this._value;return this._value=void 0,n&&B(n,null),n}}class o{constructor(n){this.object=n}dispose(){}}},91741:function(Et,Fe,j){"use strict";j.d(Fe,{S:function(){return ae}});class Z{constructor(K){this.element=K,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class ae{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let K=this._first;for(;K!==Z.Undefined;){const C=K.next;K.prev=Z.Undefined,K.next=Z.Undefined,K=C}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(K){return this._insert(K,!1)}push(K){return this._insert(K,!0)}_insert(K,C){const k=new Z(K);if(this._first===Z.Undefined)this._first=k,this._last=k;else if(C){const B=this._last;this._last=k,k.prev=B,B.next=k}else{const B=this._first;this._first=k,k.next=B,B.prev=k}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(k))}}shift(){if(this._first!==Z.Undefined){const K=this._first.element;return this._remove(this._first),K}}pop(){if(this._last!==Z.Undefined){const K=this._last.element;return this._remove(this._last),K}}_remove(K){if(K.prev!==Z.Undefined&&K.next!==Z.Undefined){const C=K.prev;C.next=K.next,K.next.prev=C}else K.prev===Z.Undefined&&K.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):K.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):K.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let K=this._first;for(;K!==Z.Undefined;)yield K.element,K=K.next}}},1432:function(Et,Fe,j){"use strict";j.d(Fe,{$L:function(){return v},ED:function(){return o},IJ:function(){return n},OS:function(){return L},WE:function(){return f},dz:function(){return s},gn:function(){return E},li:function(){return m},r:function(){return a},tY:function(){return r},xS:function(){return S}});var Z=j(34155),ae;const Q="en";let K=!1,C=!1,k=!1,O=!1,B=!1,e=!1,I=!1,w,u=null,p=null,c;const m=typeof self=="object"?self:typeof j.g=="object"?j.g:{};let l;typeof m.vscode!="undefined"&&typeof m.vscode.process!="undefined"?l=m.vscode.process:typeof Z!="undefined"&&(l=Z);const g=typeof((ae=l==null?void 0:l.versions)===null||ae===void 0?void 0:ae.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!g)c=navigator.userAgent,K=c.indexOf("Windows")>=0,C=c.indexOf("Macintosh")>=0,I=(c.indexOf("Macintosh")>=0||c.indexOf("iPad")>=0||c.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,k=c.indexOf("Linux")>=0,e=!0,w=navigator.language,u=w;else if(typeof l=="object"){K=l.platform==="win32",C=l.platform==="darwin",k=l.platform==="linux",O=k&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,w=Q,u=Q;const i=l.env.VSCODE_NLS_CONFIG;if(i)try{const t=JSON.parse(i),h=t.availableLanguages["*"];w=t.locale,u=h||Q,p=t._translationsConfigFile}catch(t){}B=!0}else console.error("Unable to resolve platform.");let _=0;C?_=1:K?_=3:k&&(_=2);const o=K,s=C,n=k,r=B,v=e,E=I,f=c,S=function(){if(m.setImmediate)return m.setImmediate.bind(m);if(typeof m.postMessage=="function"&&!m.importScripts){let h=[];m.addEventListener("message",T=>{if(T.data&&T.data.vscodeSetImmediateId)for(let y=0,d=h.length;y<d;y++){const R=h[y];if(R.id===T.data.vscodeSetImmediateId){h.splice(y,1),R.callback();return}}});let b=0;return T=>{const y=++b;h.push({id:y,callback:T}),m.postMessage({vscodeSetImmediateId:y},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const t=Promise.resolve();return h=>t.then(h)}(),L=C||I?2:K?1:3;let A=!0,D=!1;function a(){if(!D){D=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2,A=new Uint16Array(i.buffer)[0]===513}return A}},84013:function(Et,Fe,j){"use strict";j.d(Fe,{G:function(){return Q}});var Z=j(1432);const ae=Z.li.performance&&typeof Z.li.performance.now=="function";class Q{constructor(C){this._highResolution=ae&&C,this._startTime=this._now(),this._stopTime=-1}static create(C=!0){return new Q(C)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.li.performance.now():Date.now()}}},97295:function(Et,Fe,j){"use strict";j.d(Fe,{$i:function(){return F},C8:function(){return le},GF:function(){return w},HO:function(){return b},IO:function(){return u},K7:function(){return $},Kw:function(){return fe},LC:function(){return m},Mh:function(){return S},P1:function(){return L},PJ:function(){return me},Qe:function(){return U},R1:function(){return I},RP:function(){return R},S6:function(){return Ae},TT:function(){return o},Ut:function(){return y},V8:function(){return l},WU:function(){return Q},YK:function(){return D},YU:function(){return K},ZG:function(){return A},ZH:function(){return i},ab:function(){return V},c1:function(){return te},df:function(){return v},ec:function(){return C},fi:function(){return Be},fy:function(){return k},j3:function(){return O},j_:function(){return n},m5:function(){return Z},mK:function(){return r},mr:function(){return p},oH:function(){return pe},oL:function(){return B},ok:function(){return f},ow:function(){return g},qq:function(){return E},qu:function(){return _},rL:function(){return a},uS:function(){return _e},un:function(){return e},uq:function(){return c},vH:function(){return h},xe:function(){return re},zY:function(){return s}});function Z(X){return!X||typeof X!="string"?!0:X.trim().length===0}const ae=/{(\d+)}/g;function Q(X,...q){return q.length===0?X:X.replace(ae,function(ue,ee){const z=parseInt(ee,10);return isNaN(z)||z<0||z>=q.length?ue:q[z]})}function K(X){return X.replace(/[<>&]/g,function(q){switch(q){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return q}})}function C(X){return X.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(X,q=" "){const ue=O(X,q);return B(ue,q)}function O(X,q){if(!X||!q)return X;const ue=q.length;if(ue===0||X.length===0)return X;let ee=0;for(;X.indexOf(q,ee)===ee;)ee=ee+ue;return X.substring(ee)}function B(X,q){if(!X||!q)return X;const ue=q.length,ee=X.length;if(ue===0||ee===0)return X;let z=ee,ne=-1;for(;ne=X.lastIndexOf(q,z-1),!(ne===-1||ne+ue!==z);){if(ne===0)return"";z=ne}return X.substring(0,z)}function e(X){return X.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(X){return X.replace(/\*/g,"")}function w(X,q,ue={}){if(!X)throw new Error("Cannot create regex from empty string");q||(X=C(X)),ue.wholeWord&&(/\B/.test(X.charAt(0))||(X="\\b"+X),/\B/.test(X.charAt(X.length-1))||(X=X+"\\b"));let ee="";return ue.global&&(ee+="g"),ue.matchCase||(ee+="i"),ue.multiline&&(ee+="m"),ue.unicode&&(ee+="u"),new RegExp(X,ee)}function u(X){return X.source==="^"||X.source==="^$"||X.source==="$"||X.source==="^\\s*$"?!1:!!(X.exec("")&&X.lastIndex===0)}function p(X){return(X.global?"g":"")+(X.ignoreCase?"i":"")+(X.multiline?"m":"")+(X.unicode?"u":"")}function c(X){return X.split(/\r\n|\r|\n/)}function m(X){for(let q=0,ue=X.length;q<ue;q++){const ee=X.charCodeAt(q);if(ee!==32&&ee!==9)return q}return-1}function l(X,q=0,ue=X.length){for(let ee=q;ee<ue;ee++){const z=X.charCodeAt(ee);if(z!==32&&z!==9)return X.substring(q,ee)}return X.substring(q,ue)}function g(X,q=X.length-1){for(let ue=q;ue>=0;ue--){const ee=X.charCodeAt(ue);if(ee!==32&&ee!==9)return ue}return-1}function _(X,q){return X<q?-1:X>q?1:0}function o(X,q,ue=0,ee=X.length,z=0,ne=q.length){for(;ue<ee&&z<ne;ue++,z++){let ke=X.charCodeAt(ue),$e=q.charCodeAt(z);if(ke<$e)return-1;if(ke>$e)return 1}const ce=ee-ue,ge=ne-z;return ce<ge?-1:ce>ge?1:0}function s(X,q){return n(X,q,0,X.length,0,q.length)}function n(X,q,ue=0,ee=X.length,z=0,ne=q.length){for(;ue<ee&&z<ne;ue++,z++){let ke=X.charCodeAt(ue),$e=q.charCodeAt(z);if(ke===$e)continue;if(ke>=128||$e>=128)return o(X.toLowerCase(),q.toLowerCase(),ue,ee,z,ne);r(ke)&&(ke-=32),r($e)&&($e-=32);const ft=ke-$e;if(ft!==0)return ft}const ce=ee-ue,ge=ne-z;return ce<ge?-1:ce>ge?1:0}function r(X){return X>=97&&X<=122}function v(X){return X>=65&&X<=90}function E(X,q){return X.length===q.length&&n(X,q)===0}function f(X,q){const ue=q.length;return q.length>X.length?!1:n(X,q,0,ue)===0}function S(X,q){let ue,ee=Math.min(X.length,q.length);for(ue=0;ue<ee;ue++)if(X.charCodeAt(ue)!==q.charCodeAt(ue))return ue;return ee}function L(X,q){let ue,ee=Math.min(X.length,q.length);const z=X.length-1,ne=q.length-1;for(ue=0;ue<ee;ue++)if(X.charCodeAt(z-ue)!==q.charCodeAt(ne-ue))return ue;return ee}function A(X){return 55296<=X&&X<=56319}function D(X){return 56320<=X&&X<=57343}function a(X,q){return(X-55296<<10)+(q-56320)+65536}function i(X,q,ue){const ee=X.charCodeAt(ue);if(A(ee)&&ue+1<q){const z=X.charCodeAt(ue+1);if(D(z))return a(ee,z)}return ee}function t(X,q){const ue=X.charCodeAt(q-1);if(D(ue)&&q>1){const ee=X.charCodeAt(q-2);if(A(ee))return a(ee,ue)}return ue}function h(X,q){const ue=Le.getInstance(),ee=q,z=X.length,ne=i(X,z,q);q+=ne>=65536?2:1;let ce=ue.getGraphemeBreakType(ne);for(;q<z;){const ge=i(X,z,q),ke=ue.getGraphemeBreakType(ge);if(Be(ce,ke))break;q+=ge>=65536?2:1,ce=ke}return q-ee}function b(X,q){const ue=Le.getInstance(),ee=q,z=t(X,q);q-=z>=65536?2:1;let ne=ue.getGraphemeBreakType(z);for(;q>0;){const ce=t(X,q),ge=ue.getGraphemeBreakType(ce);if(Be(ge,ne))break;q-=ce>=65536?2:1,ne=ge}return ee-q}const T=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function y(X){return T.test(X)}const d=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function R(X){return d.test(X)}const M=/^[\t\n\r\x20-\x7E]*$/;function F(X){return M.test(X)}const U=/[\u2028\u2029]/;function V(X){return U.test(X)}function re(X){for(let q=0,ue=X.length;q<ue;q++)if($(X.charCodeAt(q)))return!0;return!1}function $(X){return X=+X,X>=11904&&X<=55215||X>=63744&&X<=64255||X>=65281&&X<=65374}function le(X){return X>=127462&&X<=127487||X===8986||X===8987||X===9200||X===9203||X>=9728&&X<=10175||X===11088||X===11093||X>=127744&&X<=128591||X>=128640&&X<=128764||X>=128992&&X<=129003||X>=129280&&X<=129535||X>=129648&&X<=129750}const te="\uFEFF";function _e(X){return!!(X&&X.length>0&&X.charCodeAt(0)===65279)}function fe(X,q=!1){return X?(q&&(X=X.replace(/\\./g,"")),X.toLowerCase()!==X):!1}function me(X){return X=X%(2*26),X<26?String.fromCharCode(97+X):String.fromCharCode(65+X-26)}function Ae(X){return Le.getInstance().getGraphemeBreakType(X)}function Be(X,q){return X===0?q!==5&&q!==7:X===2&&q===3?!1:X===4||X===2||X===3||q===4||q===2||q===3?!0:!(X===8&&(q===8||q===9||q===11||q===12)||(X===11||X===9)&&(q===9||q===10)||(X===12||X===10)&&q===10||q===5||q===13||q===7||X===1||X===13&&q===14||X===6&&q===6)}class Le{constructor(){this._data=Ie()}static getInstance(){return Le._INSTANCE||(Le._INSTANCE=new Le),Le._INSTANCE}getGraphemeBreakType(q){if(q<32)return q===10?3:q===13?2:4;if(q<127)return 0;const ue=this._data,ee=ue.length/3;let z=1;for(;z<=ee;)if(q<ue[3*z])z=2*z;else if(q>ue[3*z+1])z=2*z+1;else return ue[3*z+2];return 0}}Le._INSTANCE=null;function Ie(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function pe(X,q){if(X===0)return 0;const ue=Ke(X,q);if(ue!==void 0)return ue;const ee=t(q,X);return X-=Ce(ee),X}function Ke(X,q){let ue=t(q,X);for(X-=Ce(ue);ie(ue)||ue===65039||ue===8419;){if(X===0)return;ue=t(q,X),X-=Ce(ue)}if(le(ue)){if(X>=0){const ee=t(q,X);ee===8205&&(X-=Ce(ee))}return X}}function Ce(X){return X>=65536?2:1}function ie(X){return 127995<=X&&X<=127999}},98401:function(Et,Fe,j){"use strict";j.d(Fe,{$E:function(){return m},$K:function(){return O},D8:function(){return u},HD:function(){return ae},IU:function(){return l},Jp:function(){return B},Kn:function(){return Q},cW:function(){return I},f6:function(){return g},hj:function(){return K},jn:function(){return C},kJ:function(){return Z},mf:function(){return w},o8:function(){return k},p_:function(){return e},vE:function(){return _}});function Z(o){return Array.isArray(o)}function ae(o){return typeof o=="string"}function Q(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function K(o){return typeof o=="number"&&!isNaN(o)}function C(o){return o===!0||o===!1}function k(o){return typeof o=="undefined"}function O(o){return!B(o)}function B(o){return k(o)||o===null}function e(o,s){if(!o)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function I(o){if(B(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function w(o){return typeof o=="function"}function u(o,s){const n=Math.min(o.length,s.length);for(let r=0;r<n;r++)p(o[r],s[r])}function p(o,s){if(ae(s)){if(typeof o!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(w(s)){try{if(o instanceof s)return}catch(n){}if(!B(o)&&o.constructor===s||s.length===1&&s.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(o){let s=[],n=Object.getPrototypeOf(o);for(;Object.prototype!==n;)s=s.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return s}function m(o){const s=[];for(const n of c(o))typeof o[n]=="function"&&s.push(n);return s}function l(o,s){const n=v=>function(){const E=Array.prototype.slice.call(arguments,0);return s(v,E)};let r={};for(const v of o)r[v]=n(v);return r}function g(o){return o===null?void 0:o}function _(o,s="Unreachable"){throw new Error(s)}},63580:function(Et,Fe,j){"use strict";j.d(Fe,{N:function(){return ae}});function Z(Q,K){let C;return K.length===0?C=Q:C=Q.replace(/\{(\d+)\}/g,function(k,O){const B=O[0];return typeof K[B]!="undefined"?K[B]:k}),C}function ae(Q,K,...C){return Z(K,C)}},84144:function(Et,Fe,j){"use strict";j.d(Fe,{BH:function(){return l},NZ:function(){return g},U8:function(){return _},co:function(){return m},eH:function(){return c},vr:function(){return p}});var Z=j(74741),ae=j(73046),Q=j(4669),K=j(53725),C=j(9917),k=j(91741),O=j(94565),B=j(38819),e=j(72065),I=j(97781),w=function(o,s,n,r){var v=arguments.length,E=v<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,n):r,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,s,n,r);else for(var S=o.length-1;S>=0;S--)(f=o[S])&&(E=(v<3?f(E):v>3?f(s,n,E):f(s,n))||E);return v>3&&E&&Object.defineProperty(s,n,E),E},u=function(o,s){return function(n,r){s(n,r,o)}};function p(o){return o.command!==void 0}class c{constructor(s){this.id=c._idPool++,this._debugName=s}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const m=(0,e.yh)("menuService"),l=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Q.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===c.CommandPalette}}addCommand(o){return this.addCommands(K.$.single(o))}addCommands(o){for(const s of o)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,C.OF)(()=>{let s=!1;for(const n of o)s=this._commands.delete(n.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((s,n)=>o.set(n,s)),o}appendMenuItem(o,s){return this.appendMenuItems(K.$.single({id:o,item:s}))}appendMenuItems(o){const s=new Set,n=new k.S;for(const{id:r,item:v}of o){let E=this._menuItems.get(r);E||(E=new k.S,this._menuItems.set(r,E)),n.push(E.push(v)),s.add(r)}return this._onDidChangeMenu.fire(s),(0,C.OF)(()=>{if(n.size>0){for(let r of n)r();this._onDidChangeMenu.fire(s),n.clear()}})}getMenuItems(o){let s;return this._menuItems.has(o)?s=[...this._menuItems.get(o)]:s=[],o===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(o){const s=new Set;for(const n of o)p(n)&&(s.add(n.command.id),n.alt&&s.add(n.alt.id));this._commands.forEach((n,r)=>{s.has(r)||o.push({command:n})})}};class g extends Z.wY{constructor(s,n,r,v){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu"),this.item=s,this._menuService=n,this._contextKeyService=r,this._options=v}get actions(){const s=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),r=n.getActions(this._options);n.dispose();for(const[,v]of r)v.length>0&&(s.push(...v),s.push(new Z.Z0));return s.length&&s.pop(),s}}let _=class ha{constructor(s,n,r,v,E){var f,S;if(this._commandService=E,this.id=s.id,this.label=r!=null&&r.renderShortTitle&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(S=typeof s.tooltip=="string"?s.tooltip:(f=s.tooltip)===null||f===void 0?void 0:f.value)!==null&&S!==void 0?S:"",this.enabled=!s.precondition||v.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const L=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=v.contextMatchesRules(L.condition),this.checked&&L.tooltip&&(this.tooltip=typeof L.tooltip=="string"?L.tooltip:L.tooltip.value),L.title&&(this.label=typeof L.title=="string"?L.title:L.title.value)}this.item=s,this.alt=n?new ha(n,void 0,r,v,E):void 0,this._options=r,I.kS.isThemeIcon(s.icon)&&(this.class=ae.dT.asClassName(s.icon))}dispose(){}run(...s){var n,r;let v=[];return!((n=this._options)===null||n===void 0)&&n.arg&&(v=[...v,this._options.arg]),!((r=this._options)===null||r===void 0)&&r.shouldForwardArgs&&(v=[...v,...s]),this._commandService.executeCommand(this.id,...v)}};_=w([u(3,B.i6),u(4,O.H)],_)},94565:function(Et,Fe,j){"use strict";j.d(Fe,{H:function(){return O},P:function(){return B}});var Z=j(4669),ae=j(53725),Q=j(9917),K=j(91741),C=j(98401),k=j(72065);const O=(0,k.yh)("commandService"),B=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,I){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:e,handler:I})}if(e.description){const m=[];for(let g of e.description.args)m.push(g.constraint);const l=e.handler;e.handler=function(g,..._){return(0,C.D8)(_,m),l(g,..._)}}const{id:w}=e;let u=this._commands.get(w);u||(u=new K.S,this._commands.set(w,u));let p=u.unshift(e),c=(0,Q.OF)(()=>{p();const m=this._commands.get(w);m!=null&&m.isEmpty()&&this._commands.delete(w)});return this._onDidRegisterCommand.fire(w),c}registerCommandAlias(e,I){return B.registerCommand(e,(w,...u)=>w.get(O).executeCommand(I,...u))}getCommand(e){const I=this._commands.get(e);if(!(!I||I.isEmpty()))return ae.$.first(I)}getCommands(){const e=new Map;for(const I of this._commands.keys()){const w=this.getCommand(I);w&&e.set(I,w)}return e}};B.registerCommand("noop",()=>{})},38819:function(Et,Fe,j){"use strict";j.d(Fe,{Ao:function(){return O},Eq:function(){return a},Fb:function(){return B},K8:function(){return h},i6:function(){return D},uy:function(){return A}});var Z=j(1432),ae=j(97295),Q=j(72065);let K=Z.WE||"";const C=new Map;C.set("false",!1),C.set("true",!0),C.set("isMac",Z.dz),C.set("isLinux",Z.IJ),C.set("isWindows",Z.ED),C.set("isWeb",Z.$L),C.set("isMacNative",Z.dz&&!Z.$L),C.set("isEdge",K.indexOf("Edg/")>=0),C.set("isFirefox",K.indexOf("Firefox")>=0),C.set("isChrome",K.indexOf("Chrome")>=0),C.set("isSafari",K.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class O{static has(y){return u.create(y)}static equals(y,d){return p.create(y,d)}static regex(y,d){return v.create(y,d)}static not(y){return g.create(y)}static and(...y){return S.create(y,null)}static or(...y){return L.create(y,null,!0)}static deserialize(y,d=!1){if(y)return this._deserializeOrExpression(y,d)}static _deserializeOrExpression(y,d){let R=y.split("||");return L.create(R.map(M=>this._deserializeAndExpression(M,d)),null,!0)}static _deserializeAndExpression(y,d){let R=y.split("&&");return S.create(R.map(M=>this._deserializeOne(M,d)),null)}static _deserializeOne(y,d){if(y=y.trim(),y.indexOf("!=")>=0){let R=y.split("!=");return l.create(R[0].trim(),this._deserializeValue(R[1],d))}if(y.indexOf("==")>=0){let R=y.split("==");return p.create(R[0].trim(),this._deserializeValue(R[1],d))}if(y.indexOf("=~")>=0){let R=y.split("=~");return v.create(R[0].trim(),this._deserializeRegexValue(R[1],d))}if(y.indexOf(" in ")>=0){let R=y.split(" in ");return c.create(R[0].trim(),R[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(y)){const R=y.split(">=");return s.create(R[0].trim(),R[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(y)){const R=y.split(">");return o.create(R[0].trim(),R[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(y)){const R=y.split("<=");return r.create(R[0].trim(),R[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(y)){const R=y.split("<");return n.create(R[0].trim(),R[1].trim())}return/^\!\s*/.test(y)?g.create(y.substr(1).trim()):u.create(y)}static _deserializeValue(y,d){if(y=y.trim(),y==="true")return!0;if(y==="false")return!1;let R=/^'([^']*)'$/.exec(y);return R?R[1].trim():y}static _deserializeRegexValue(y,d){if((0,ae.m5)(y)){if(d)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let R=y.indexOf("/"),M=y.lastIndexOf("/");if(R===M||R<0){if(d)throw new Error(`bad regexp-value '${y}', missing /-enclosure`);return console.warn(`bad regexp-value '${y}', missing /-enclosure`),null}let F=y.slice(R+1,M),U=y[M+1]==="i"?"i":"";try{return new RegExp(F,U)}catch(V){if(d)throw new Error(`bad regexp-value '${y}', parse error: ${V}`);return console.warn(`bad regexp-value '${y}', parse error: ${V}`),null}}}function B(T,y){const d=T?T.substituteConstants():void 0,R=y?y.substituteConstants():void 0;return!d&&!R?!0:!d||!R?!1:d.equals(R)}function e(T,y){return T.cmp(y)}class I{constructor(){this.type=0}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!1}serialize(){return"false"}keys(){return[]}negate(){return w.INSTANCE}}I.INSTANCE=new I;class w{constructor(){this.type=1}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}w.INSTANCE=new w;class u{constructor(y,d){this.key=y,this.negated=d,this.type=2}static create(y,d=null){const R=C.get(y);return typeof R=="boolean"?R?w.INSTANCE:I.INSTANCE:new u(y,d)}cmp(y){return y.type!==this.type?this.type-y.type:i(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=C.get(this.key);return typeof y=="boolean"?y?w.INSTANCE:I.INSTANCE:this}evaluate(y){return!!y.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}class p{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=4}static create(y,d,R=null){if(typeof d=="boolean")return d?u.create(y,R):g.create(y,R);const M=C.get(y);return typeof M=="boolean"?d===(M?"true":"false")?w.INSTANCE:I.INSTANCE:new p(y,d,R)}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=C.get(this.key);if(typeof y=="boolean"){const d=y?"true":"false";return this.value===d?w.INSTANCE:I.INSTANCE}return this}evaluate(y){return y.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class c{constructor(y,d){this.key=y,this.valueKey=d,this.type=10,this.negated=null}static create(y,d){return new c(y,d)}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.valueKey,y.key,y.valueKey)}equals(y){return y.type===this.type?this.key===y.key&&this.valueKey===y.valueKey:!1}substituteConstants(){return this}evaluate(y){const d=y.getValue(this.valueKey),R=y.getValue(this.key);return Array.isArray(d)?d.indexOf(R)>=0:typeof R=="string"&&typeof d=="object"&&d!==null?k.call(d,R):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=m.create(this)),this.negated}}class m{constructor(y){this._actual=y,this.type=11}static create(y){return new m(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=5}static create(y,d,R=null){if(typeof d=="boolean")return d?g.create(y,R):u.create(y,R);const M=C.get(y);return typeof M=="boolean"?d===(M?"true":"false")?I.INSTANCE:w.INSTANCE:new l(y,d,R)}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=C.get(this.key);if(typeof y=="boolean"){const d=y?"true":"false";return this.value===d?I.INSTANCE:w.INSTANCE}return this}evaluate(y){return y.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class g{constructor(y,d){this.key=y,this.negated=d,this.type=3}static create(y,d=null){const R=C.get(y);return typeof R=="boolean"?R?I.INSTANCE:w.INSTANCE:new g(y,d)}cmp(y){return y.type!==this.type?this.type-y.type:i(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=C.get(this.key);return typeof y=="boolean"?y?I.INSTANCE:w.INSTANCE:this}evaluate(y){return!y.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}function _(T,y){if(typeof T=="string"){const d=parseFloat(T);isNaN(d)||(T=d)}return typeof T=="string"||typeof T=="number"?y(T):I.INSTANCE}class o{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=12}static create(y,d,R=null){return _(d,M=>new o(y,M,R))}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class s{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=13}static create(y,d,R=null){return _(d,M=>new s(y,M,R))}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class n{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=14}static create(y,d,R=null){return _(d,M=>new n(y,M,R))}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class r{constructor(y,d,R){this.key=y,this.value=d,this.negated=R,this.type=15}static create(y,d,R=null){return _(d,M=>new r(y,M,R))}cmp(y){return y.type!==this.type?this.type-y.type:t(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class v{constructor(y,d){this.key=y,this.regexp=d,this.type=7,this.negated=null}static create(y,d){return new v(y,d)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.key<y.key)return-1;if(this.key>y.key)return 1;const d=this.regexp?this.regexp.source:"",R=y.regexp?y.regexp.source:"";return d<R?-1:d>R?1:0}equals(y){if(y.type===this.type){const d=this.regexp?this.regexp.source:"",R=y.regexp?y.regexp.source:"";return this.key===y.key&&d===R}return!1}substituteConstants(){return this}evaluate(y){let d=y.getValue(this.key);return this.regexp?this.regexp.test(d):!1}serialize(){const y=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${y}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this)),this.negated}}class E{constructor(y){this._actual=y,this.type=8}static create(y){return new E(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function f(T){let y=null;for(let d=0,R=T.length;d<R;d++){const M=T[d].substituteConstants();if(T[d]!==M&&y===null){y=[];for(let F=0;F<d;F++)y[F]=T[F]}y!==null&&(y[d]=M)}return y===null?T:y}class S{constructor(y,d){this.expr=y,this.negated=d,this.type=6}static create(y,d){return S._normalizeArr(y,d)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let d=0,R=this.expr.length;d<R;d++){const M=e(this.expr[d],y.expr[d]);if(M!==0)return M}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let d=0,R=this.expr.length;d<R;d++)if(!this.expr[d].equals(y.expr[d]))return!1;return!0}return!1}substituteConstants(){const y=f(this.expr);return y===this.expr?this:S.create(y,this.negated)}evaluate(y){for(let d=0,R=this.expr.length;d<R;d++)if(!this.expr[d].evaluate(y))return!1;return!0}static _normalizeArr(y,d){const R=[];let M=!1;for(const F of y)if(F){if(F.type===1){M=!0;continue}if(F.type===0)return I.INSTANCE;if(F.type===6){R.push(...F.expr);continue}R.push(F)}if(R.length===0&&M)return w.INSTANCE;if(R.length!==0){if(R.length===1)return R[0];R.sort(e);for(let F=1;F<R.length;F++)R[F-1].equals(R[F])&&(R.splice(F,1),F--);if(R.length===1)return R[0];for(;R.length>1;){const F=R[R.length-1];if(F.type!==9)break;R.pop();const U=R.pop(),V=R.length===0,re=L.create(F.expr.map($=>S.create([$,U],null)),null,V);re&&(R.push(re),R.sort(e))}return R.length===1?R[0]:new S(R,d)}}serialize(){return this.expr.map(y=>y.serialize()).join(" && ")}keys(){const y=[];for(let d of this.expr)y.push(...d.keys());return y}negate(){if(!this.negated){const y=[];for(let d of this.expr)y.push(d.negate());this.negated=L.create(y,this,!0)}return this.negated}}class L{constructor(y,d){this.expr=y,this.negated=d,this.type=9}static create(y,d,R){return L._normalizeArr(y,d,R)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let d=0,R=this.expr.length;d<R;d++){const M=e(this.expr[d],y.expr[d]);if(M!==0)return M}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let d=0,R=this.expr.length;d<R;d++)if(!this.expr[d].equals(y.expr[d]))return!1;return!0}return!1}substituteConstants(){const y=f(this.expr);return y===this.expr?this:L.create(y,this.negated,!1)}evaluate(y){for(let d=0,R=this.expr.length;d<R;d++)if(this.expr[d].evaluate(y))return!0;return!1}static _normalizeArr(y,d,R){let M=[],F=!1;if(y){for(let U=0,V=y.length;U<V;U++){const re=y[U];if(re){if(re.type===0){F=!0;continue}if(re.type===1)return w.INSTANCE;if(re.type===9){M=M.concat(re.expr);continue}M.push(re)}}if(M.length===0&&F)return I.INSTANCE;M.sort(e)}if(M.length!==0){if(M.length===1)return M[0];for(let U=1;U<M.length;U++)M[U-1].equals(M[U])&&(M.splice(U,1),U--);if(M.length===1)return M[0];if(R){for(let U=0;U<M.length;U++)for(let V=U+1;V<M.length;V++)h(M[U],M[V])&&(M.splice(V,1),V--);if(M.length===1)return M[0]}return new L(M,d)}}serialize(){return this.expr.map(y=>y.serialize()).join(" || ")}keys(){const y=[];for(let d of this.expr)y.push(...d.keys());return y}negate(){if(!this.negated){let y=[];for(let d of this.expr)y.push(d.negate());for(;y.length>1;){const d=y.shift(),R=y.shift(),M=[];for(const U of b(d))for(const V of b(R))M.push(S.create([U,V],null));const F=y.length===0;y.unshift(L.create(M,null,F))}this.negated=y[0]}return this.negated}}class A extends u{constructor(y,d,R){super(y,null),this._defaultValue=d,typeof R=="object"?A._info.push(Object.assign(Object.assign({},R),{key:y})):R!==!0&&A._info.push({key:y,description:R,type:d!=null?typeof d:void 0})}static all(){return A._info.values()}bindTo(y){return y.createKey(this.key,this._defaultValue)}getValue(y){return y.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(y){return p.create(this.key,y)}}A._info=[];const D=(0,Q.yh)("contextKeyService"),a="setContext";function i(T,y){return T<y?-1:T>y?1:0}function t(T,y,d,R){return T<d?-1:T>d?1:y<R?-1:y>R?1:0}function h(T,y){if(y.type===6&&T.type!==9&&T.type!==6){for(const M of y.expr)if(T.equals(M))return!0}const d=T.negate(),R=b(d).concat(b(y));R.sort(e);for(let M=0;M<R.length;M++){const U=R[M].negate();for(let V=M+1;V<R.length;V++){const re=R[V];if(U.equals(re))return!0}}return!1}function b(T){return T.type===9?T.expr:[T]}},72065:function(Et,Fe,j){"use strict";j.d(Fe,{I8:function(){return Z},TG:function(){return ae},jt:function(){return C},yh:function(){return K}});var Z;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function O(B){return B[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=O})(Z||(Z={}));const ae=K("instantiationService");function Q(k,O,B,e){O[Z.DI_TARGET]===O?O[Z.DI_DEPENDENCIES].push({id:k,index:B,optional:e}):(O[Z.DI_DEPENDENCIES]=[{id:k,index:B,optional:e}],O[Z.DI_TARGET]=O)}function K(k){if(Z.serviceIds.has(k))return Z.serviceIds.get(k);const O=function(B,e,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Q(O,B,I,!1)};return O.toString=()=>k,Z.serviceIds.set(k,O),O}function C(k){return function(O,B,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Q(k,O,e,!0)}}},89872:function(Et,Fe,j){"use strict";j.d(Fe,{B:function(){return K}});var Z=j(35146),ae=j(98401);class Q{constructor(){this.data=new Map}add(k,O){Z.ok(ae.HD(k)),Z.ok(ae.Kn(O)),Z.ok(!this.data.has(k),"There is already an extension with this id"),this.data.set(k,O)}as(k){return this.data.get(k)||null}}const K=new Q},92321:function(Et,Fe,j){"use strict";j.d(Fe,{e:function(){return Z}});var Z;(function(ae){ae.DARK="dark",ae.LIGHT="light",ae.HIGH_CONTRAST="hc"})(Z||(Z={}))},97781:function(Et,Fe,j){"use strict";j.d(Fe,{EN:function(){return e},IP:function(){return u},Ic:function(){return m},XE:function(){return O},bB:function(){return l},kS:function(){return I},m6:function(){return w}});var Z=j(73046),ae=j(4669),Q=j(9917),K=j(72065),C=j(89872),k=j(92321);const O=(0,K.yh)("themeService");var B;(function(g){function _(o){return o&&typeof o=="object"&&typeof o.id=="string"}g.isThemeColor=_})(B||(B={}));function e(g){return{id:g}}var I;(function(g){function _(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||B.isThemeColor(E.color))}g.isThemeIcon=_;const o=new RegExp(`^\\$\\((${Z.dT.iconNameExpression}(?:${Z.dT.iconModifierExpression})?)\\)$`);function s(E){const f=o.exec(E);if(!f)return;let[,S]=f;return{id:S}}g.fromString=s;function n(E,f){let S=E.id;const L=S.lastIndexOf("~");return L!==-1&&(S=S.substring(0,L)),f&&(S=`${S}~${f}`),{id:S}}g.modify=n;function r(E,f){var S,L;return E.id===f.id&&((S=E.color)===null||S===void 0?void 0:S.id)===((L=f.color)===null||L===void 0?void 0:L.id)}g.isEqual=r;function v(E,f){return{id:E.id,color:f?e(f):void 0}}g.asThemeIcon=v,g.asClassNameArray=Z.dT.asClassNameArray,g.asClassName=Z.dT.asClassName,g.asCSSSelector=Z.dT.asCSSSelector})(I||(I={}));function w(g){switch(g){case k.e.DARK:return"vs-dark";case k.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const u={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ae.Q5}onColorThemeChange(_){return this.themingParticipants.push(_),this.onThemingParticipantAddedEmitter.fire(_),(0,Q.OF)(()=>{const o=this.themingParticipants.indexOf(_);this.themingParticipants.splice(o,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new p;C.B.add(u.ThemingContribution,c);function m(g){return c.onColorThemeChange(g)}class l extends Q.JT{constructor(_){super(),this.themeService=_,this.theme=_.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(o=>this.onThemeChange(o)))}onThemeChange(_){this.theme=_,this.updateStyles()}updateStyles(){}}},78595:function(Et,Fe,j){"use strict";j.d(Fe,{iz:function(){return Fn},ck:function(){return Pt},BW:function(){return sn},sN:function(){return Pt},Wd:function(){return On},ZP:function(){return Di},Xl:function(){return ne}});var Z=j(87462),ae=j(4942),Q=j(1413),K=j(74902),C=j(97685),k=j(45987),O=j(94184),B=j.n(O),e=j(67294),I=j(48555);function w(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var u=w()?e.useLayoutEffect:e.useEffect,p=function(Me,Ve){var Oe=e.useRef(!0);u(function(){return Me(Oe.current)},Ve),u(function(){return Oe.current=!1,function(){Oe.current=!0}},[])},c=function(Me,Ve){p(function(Oe){if(!Oe)return Me()},Ve)},m=p,l=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],g=void 0;function _(de,Me){var Ve=de.prefixCls,Oe=de.invalidate,qe=de.item,et=de.renderItem,ut=de.responsive,Lt=de.responsiveDisabled,Gt=de.registerSize,Ft=de.itemKey,Jt=de.className,Vt=de.style,Qt=de.children,sr=de.display,zt=de.order,fr=de.component,qt=fr===void 0?"div":fr,G=(0,k.Z)(de,l),J=ut&&!sr;function Y(xt){Gt(Ft,xt)}e.useEffect(function(){return function(){Y(null)}},[]);var ve=et&&qe!==g?et(qe):Qt,Pe;Oe||(Pe={opacity:J?0:1,height:J?0:g,overflowY:J?"hidden":g,order:ut?zt:g,pointerEvents:J?"none":g,position:J?"absolute":g});var Ye={};J&&(Ye["aria-hidden"]=!0);var nt=e.createElement(qt,(0,Z.Z)({className:B()(!Oe&&Ve,Jt),style:(0,Q.Z)((0,Q.Z)({},Pe),Vt)},Ye,G,{ref:Me}),ve);return ut&&(nt=e.createElement(I.Z,{onResize:function(yt){var kt=yt.offsetWidth;Y(kt)},disabled:Lt},nt)),nt}var o=e.forwardRef(_);o.displayName="Item";var s=o;function n(de){var Me=e.useRef();Me.current=de;var Ve=e.useCallback(function(){for(var Oe,qe=arguments.length,et=new Array(qe),ut=0;ut<qe;ut++)et[ut]=arguments[ut];return(Oe=Me.current)===null||Oe===void 0?void 0:Oe.call.apply(Oe,[Me].concat(et))},[]);return Ve}var r=j(73935),v=function(Me){return+setTimeout(Me,16)},E=function(Me){return clearTimeout(Me)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(v=function(Me){return window.requestAnimationFrame(Me)},E=function(Me){return window.cancelAnimationFrame(Me)});var f=0,S=new Map;function L(de){S.delete(de)}var A=function(Me){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;f+=1;var Oe=f;function qe(et){if(et===0)L(Oe),Me();else{var ut=v(function(){qe(et-1)});S.set(Oe,ut)}}return qe(Ve),Oe};A.cancel=function(de){var Me=S.get(de);return L(Me),E(Me)};var D=A;function a(de){if(typeof MessageChannel=="undefined")D(de);else{var Me=new MessageChannel;Me.port1.onmessage=function(){return de()},Me.port2.postMessage(void 0)}}function i(){var de=e.useRef(null),Me=function(Oe){de.current||(de.current=[],a(function(){(0,r.unstable_batchedUpdates)(function(){de.current.forEach(function(qe){qe()}),de.current=null})})),de.current.push(Oe)};return Me}function t(de,Me){var Ve=e.useState(Me),Oe=(0,C.Z)(Ve,2),qe=Oe[0],et=Oe[1],ut=n(function(Lt){de(function(){et(Lt)})});return[qe,ut]}var h=e.createContext(null),b=["component"],T=["className"],y=["className"],d=function(Me,Ve){var Oe=e.useContext(h);if(!Oe){var qe=Me.component,et=qe===void 0?"div":qe,ut=(0,k.Z)(Me,b);return e.createElement(et,(0,Z.Z)({},ut,{ref:Ve}))}var Lt=Oe.className,Gt=(0,k.Z)(Oe,T),Ft=Me.className,Jt=(0,k.Z)(Me,y);return e.createElement(h.Provider,{value:null},e.createElement(s,(0,Z.Z)({ref:Ve,className:B()(Lt,Ft)},Gt,Jt)))},R=e.forwardRef(d);R.displayName="RawItem";var M=R,F=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],U="responsive",V="invalidate";function re(de){return"+ ".concat(de.length," ...")}function $(de,Me){var Ve=de.prefixCls,Oe=Ve===void 0?"rc-overflow":Ve,qe=de.data,et=qe===void 0?[]:qe,ut=de.renderItem,Lt=de.renderRawItem,Gt=de.itemKey,Ft=de.itemWidth,Jt=Ft===void 0?10:Ft,Vt=de.ssr,Qt=de.style,sr=de.className,zt=de.maxCount,fr=de.renderRest,qt=de.renderRawRest,G=de.suffix,J=de.component,Y=J===void 0?"div":J,ve=de.itemComponent,Pe=de.onVisibleChange,Ye=(0,k.Z)(de,F),nt=Vt==="full",xt=i(),yt=t(xt,null),kt=(0,C.Z)(yt,2),pt=kt[0],vt=kt[1],At=pt||0,Dt=t(xt,new Map),Ut=(0,C.Z)(Dt,2),tr=Ut[0],Ht=Ut[1],or=t(xt,0),er=(0,C.Z)(or,2),Xt=er[0],lr=er[1],cr=t(xt,0),jt=(0,C.Z)(cr,2),Ir=jt[0],Er=jt[1],Dr=t(xt,0),Jr=(0,C.Z)(Dr,2),Pr=Jr[0],Wr=Jr[1],br=(0,e.useState)(null),Mr=(0,C.Z)(br,2),jr=Mr[0],Xr=Mr[1],on=(0,e.useState)(null),xr=(0,C.Z)(on,2),kr=xr[0],nr=xr[1],ln=e.useMemo(function(){return kr===null&&nt?Number.MAX_SAFE_INTEGER:kr||0},[kr,pt]),tn=(0,e.useState)(!1),Nr=(0,C.Z)(tn,2),ur=Nr[0],rn=Nr[1],xn="".concat(Oe,"-item"),Rn=Math.max(Xt,Ir),Fr=zt===U,Ar=et.length&&Fr,An=zt===V,Dn=Ar||typeof zt=="number"&&et.length>zt,Cr=(0,e.useMemo)(function(){var Yt=et;return Ar?pt===null&&nt?Yt=et:Yt=et.slice(0,Math.min(et.length,At/Jt)):typeof zt=="number"&&(Yt=et.slice(0,zt)),Yt},[et,Jt,pt,zt,Ar]),qr=(0,e.useMemo)(function(){return Ar?et.slice(ln+1):et.slice(Cr.length)},[et,Cr,Ar,ln]),Gr=(0,e.useCallback)(function(Yt,rr){var dr;return typeof Gt=="function"?Gt(Yt):(dr=Gt&&(Yt==null?void 0:Yt[Gt]))!==null&&dr!==void 0?dr:rr},[Gt]),Br=(0,e.useCallback)(ut||function(Yt){return Yt},[ut]);function un(Yt,rr,dr){kr===Yt&&(rr===void 0||rr===jr)||(nr(Yt),dr||(rn(Yt<et.length-1),Pe==null||Pe(Yt)),rr!==void 0&&Xr(rr))}function En(Yt,rr){vt(rr.clientWidth)}function Zr(Yt,rr){Ht(function(dr){var Or=new Map(dr);return rr===null?Or.delete(Yt):Or.set(Yt,rr),Or})}function mr(Yt,rr){Er(rr),lr(Ir)}function zr(Yt,rr){Wr(rr)}function Vr(Yt){return tr.get(Gr(Cr[Yt],Yt))}m(function(){if(At&&typeof Rn=="number"&&Cr){var Yt=Pr,rr=Cr.length,dr=rr-1;if(!rr){un(0,null);return}for(var Or=0;Or<rr;Or+=1){var wr=Vr(Or);if(nt&&(wr=wr||0),wr===void 0){un(Or-1,void 0,!0);break}if(Yt+=wr,dr===0&&Yt<=At||Or===dr-1&&Yt+Vr(dr)<=At){un(dr,null);break}else if(Yt+Rn>At){un(Or-1,Yt-wr-Pr+Ir);break}}G&&Vr(0)+Pr>At&&Xr(null)}},[At,tr,Ir,Pr,Gr,Cr]);var ci=ur&&!!qr.length,pr={};jr!==null&&Ar&&(pr={position:"absolute",left:jr,top:0});var Un={prefixCls:xn,responsive:Ar,component:ve,invalidate:An},Vn=Lt?function(Yt,rr){var dr=Gr(Yt,rr);return e.createElement(h.Provider,{key:dr,value:(0,Q.Z)((0,Q.Z)({},Un),{},{order:rr,item:Yt,itemKey:dr,registerSize:Zr,display:rr<=ln})},Lt(Yt,rr))}:function(Yt,rr){var dr=Gr(Yt,rr);return e.createElement(s,(0,Z.Z)({},Un,{order:rr,key:dr,item:Yt,renderItem:Br,itemKey:dr,registerSize:Zr,display:rr<=ln}))},Hr,In={order:ci?ln:Number.MAX_SAFE_INTEGER,className:"".concat(xn,"-rest"),registerSize:mr,display:ci};if(qt)qt&&(Hr=e.createElement(h.Provider,{value:(0,Q.Z)((0,Q.Z)({},Un),In)},qt(qr)));else{var bn=fr||re;Hr=e.createElement(s,(0,Z.Z)({},Un,In),typeof bn=="function"?bn(qr):bn)}var Kn=e.createElement(Y,(0,Z.Z)({className:B()(!An&&Oe,sr),style:Qt,ref:Me},Ye),Cr.map(Vn),Dn?Hr:null,G&&e.createElement(s,(0,Z.Z)({},Un,{responsive:Fr,responsiveDisabled:!Ar,order:ln,className:"".concat(xn,"-suffix"),registerSize:zr,display:!0,style:pr}),G));return Fr&&(Kn=e.createElement(I.Z,{onResize:En,disabled:!Ar},Kn)),Kn}var le=e.forwardRef($);le.displayName="Overflow",le.Item=M,le.RESPONSIVE=U,le.INVALIDATE=V;var te=le,_e=te,fe=j(21770),me=j(91881),Ae=j(80334),Be=e.createContext(null);function Le(de,Me){return de===void 0?null:"".concat(de,"-").concat(Me)}function Ie(de){var Me=e.useContext(Be);return Le(Me,de)}var pe=j(56982),Ke=["children","locked"],Ce=e.createContext(null);function ie(de,Me){var Ve=(0,Q.Z)({},de);return Object.keys(Me).forEach(function(Oe){var qe=Me[Oe];qe!==void 0&&(Ve[Oe]=qe)}),Ve}function X(de){var Me=de.children,Ve=de.locked,Oe=(0,k.Z)(de,Ke),qe=e.useContext(Ce),et=(0,pe.Z)(function(){return ie(qe,Oe)},[qe,Oe],function(ut,Lt){return!Ve&&(ut[0]!==Lt[0]||!(0,me.Z)(ut[1],Lt[1],!0))});return e.createElement(Ce.Provider,{value:et},Me)}var q=[],ue=e.createContext(null);function ee(){return e.useContext(ue)}var z=e.createContext(q);function ne(de){var Me=e.useContext(z);return e.useMemo(function(){return de!==void 0?[].concat((0,K.Z)(Me),[de]):Me},[Me,de])}var ce=e.createContext(null),ge=e.createContext({}),ke=ge,$e=function(de){if(!de)return!1;if(de instanceof Element){if(de.offsetParent)return!0;if(de.getBBox){var Me=de.getBBox(),Ve=Me.width,Oe=Me.height;if(Ve||Oe)return!0}if(de.getBoundingClientRect){var qe=de.getBoundingClientRect(),et=qe.width,ut=qe.height;if(et||ut)return!0}}return!1};function ft(de){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if($e(de)){var Ve=de.nodeName.toLowerCase(),Oe=["input","select","textarea","button"].includes(Ve)||de.isContentEditable||Ve==="a"&&!!de.getAttribute("href"),qe=de.getAttribute("tabindex"),et=Number(qe),ut=null;return qe&&!Number.isNaN(et)?ut=et:Oe&&ut===null&&(ut=0),Oe&&de.disabled&&(ut=null),ut!==null&&(ut>=0||Me&&ut<0)}return!1}function Ne(de){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ve=(0,K.Z)(de.querySelectorAll("*")).filter(function(Oe){return ft(Oe,Me)});return ft(de,Me)&&Ve.unshift(de),Ve}var Re=null;function xe(){Re=document.activeElement}function Ue(){Re=null}function ye(){if(Re)try{Re.focus()}catch(de){}}function it(de,Me){if(Me.keyCode===9){var Ve=Ne(de),Oe=Ve[Me.shiftKey?0:Ve.length-1],qe=Oe===document.activeElement||de===document.activeElement;if(qe){var et=Ve[Me.shiftKey?Ve.length-1:0];et.focus(),Me.preventDefault()}}}var rt=j(15105),tt=j(75164),We=rt.Z.LEFT,ot=rt.Z.RIGHT,_t=rt.Z.UP,St=rt.Z.DOWN,gt=rt.Z.ENTER,wt=rt.Z.ESC,mt=rt.Z.HOME,Ct=rt.Z.END,Ge=[_t,St,We,ot];function he(de,Me,Ve,Oe){var qe,et="prev",ut="next",Lt="children",Gt="parent";if(de==="inline"&&Oe===gt)return{inlineTrigger:!0};var Ft=(0,ae.Z)((0,ae.Z)({},_t,et),St,ut),Jt=(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)({},We,Ve?ut:et),ot,Ve?et:ut),St,Lt),gt,Lt),Vt=(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)({},_t,et),St,ut),gt,Lt),wt,Gt),We,Ve?Lt:Gt),ot,Ve?Gt:Lt),Qt={inline:Ft,horizontal:Jt,vertical:Vt,inlineSub:Ft,horizontalSub:Vt,verticalSub:Vt},sr=(qe=Qt["".concat(de).concat(Me?"":"Sub")])===null||qe===void 0?void 0:qe[Oe];switch(sr){case et:return{offset:-1,sibling:!0};case ut:return{offset:1,sibling:!0};case Gt:return{offset:-1,sibling:!1};case Lt:return{offset:1,sibling:!1};default:return null}}function De(de){for(var Me=de;Me;){if(Me.getAttribute("data-menu-list"))return Me;Me=Me.parentElement}return null}function be(de,Me){for(var Ve=de||document.activeElement;Ve;){if(Me.has(Ve))return Ve;Ve=Ve.parentElement}return null}function Ee(de,Me){var Ve=Ne(de,!0);return Ve.filter(function(Oe){return Me.has(Oe)})}function je(de,Me,Ve){var Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!de)return null;var qe=Ee(de,Me),et=qe.length,ut=qe.findIndex(function(Lt){return Ve===Lt});return Oe<0?ut===-1?ut=et-1:ut-=1:Oe>0&&(ut+=1),ut=(ut+et)%et,qe[ut]}var Je=function(Me,Ve){var Oe=new Set,qe=new Map,et=new Map;return Me.forEach(function(ut){var Lt=document.querySelector("[data-menu-id='".concat(Le(Ve,ut),"']"));Lt&&(Oe.add(Lt),et.set(Lt,ut),qe.set(ut,Lt))}),{elements:Oe,key2element:qe,element2key:et}};function Qe(de,Me,Ve,Oe,qe,et,ut,Lt,Gt,Ft){var Jt=e.useRef(),Vt=e.useRef();Vt.current=Me;var Qt=function(){tt.Z.cancel(Jt.current)};return e.useEffect(function(){return function(){Qt()}},[]),function(sr){var zt=sr.which;if([].concat(Ge,[gt,wt,mt,Ct]).includes(zt)){var fr=et(),qt=Je(fr,Oe),G=qt,J=G.elements,Y=G.key2element,ve=G.element2key,Pe=Y.get(Me),Ye=be(Pe,J),nt=ve.get(Ye),xt=he(de,ut(nt,!0).length===1,Ve,zt);if(!xt&&zt!==mt&&zt!==Ct)return;(Ge.includes(zt)||[mt,Ct].includes(zt))&&sr.preventDefault();var yt=function(Ht){if(Ht){var or=Ht,er=Ht.querySelector("a");er!=null&&er.getAttribute("href")&&(or=er);var Xt=ve.get(Ht);Lt(Xt),Qt(),Jt.current=(0,tt.Z)(function(){Vt.current===Xt&&or.focus()})}};if([mt,Ct].includes(zt)||xt.sibling||!Ye){var kt;!Ye||de==="inline"?kt=qe.current:kt=De(Ye);var pt,vt=Ee(kt,J);zt===mt?pt=vt[0]:zt===Ct?pt=vt[vt.length-1]:pt=je(kt,J,Ye,xt.offset),yt(pt)}else if(xt.inlineTrigger)Gt(nt);else if(xt.offset>0)Gt(nt,!0),Qt(),Jt.current=(0,tt.Z)(function(){qt=Je(fr,Oe);var tr=Ye.getAttribute("aria-controls"),Ht=document.getElementById(tr),or=je(Ht,qt.elements);yt(or)},5);else if(xt.offset<0){var At=ut(nt,!0),Dt=At[At.length-2],Ut=Y.get(Dt);Gt(Dt,!1),yt(Ut)}}Ft==null||Ft(sr)}}function Xe(de){Promise.resolve().then(de)}var He="__RC_UTIL_PATH_SPLIT__",Se=function(Me){return Me.join(He)},x=function(Me){return Me.split(He)},P="rc-menu-more";function N(){var de=e.useState({}),Me=(0,C.Z)(de,2),Ve=Me[1],Oe=(0,e.useRef)(new Map),qe=(0,e.useRef)(new Map),et=e.useState([]),ut=(0,C.Z)(et,2),Lt=ut[0],Gt=ut[1],Ft=(0,e.useRef)(0),Jt=(0,e.useRef)(!1),Vt=function(){Jt.current||Ve({})},Qt=(0,e.useCallback)(function(Y,ve){var Pe=Se(ve);qe.current.set(Pe,Y),Oe.current.set(Y,Pe),Ft.current+=1;var Ye=Ft.current;Xe(function(){Ye===Ft.current&&Vt()})},[]),sr=(0,e.useCallback)(function(Y,ve){var Pe=Se(ve);qe.current.delete(Pe),Oe.current.delete(Y)},[]),zt=(0,e.useCallback)(function(Y){Gt(Y)},[]),fr=(0,e.useCallback)(function(Y,ve){var Pe=Oe.current.get(Y)||"",Ye=x(Pe);return ve&&Lt.includes(Ye[0])&&Ye.unshift(P),Ye},[Lt]),qt=(0,e.useCallback)(function(Y,ve){return Y.filter(function(Pe){return Pe!==void 0}).some(function(Pe){var Ye=fr(Pe,!0);return Ye.includes(ve)})},[fr]),G=function(){var ve=(0,K.Z)(Oe.current.keys());return Lt.length&&ve.push(P),ve},J=(0,e.useCallback)(function(Y){var ve="".concat(Oe.current.get(Y)).concat(He),Pe=new Set;return(0,K.Z)(qe.current.keys()).forEach(function(Ye){Ye.startsWith(ve)&&Pe.add(qe.current.get(Ye))}),Pe},[]);return e.useEffect(function(){return function(){Jt.current=!0}},[]),{registerPath:Qt,unregisterPath:sr,refreshOverflowKeys:zt,isSubPathKey:qt,getKeyPath:fr,getKeys:G,getSubPathKeys:J}}function W(de){var Me=e.useRef(de);Me.current=de;var Ve=e.useCallback(function(){for(var Oe,qe=arguments.length,et=new Array(qe),ut=0;ut<qe;ut++)et[ut]=arguments[ut];return(Oe=Me.current)===null||Oe===void 0?void 0:Oe.call.apply(Oe,[Me].concat(et))},[]);return de?Ve:void 0}var H=Math.random().toFixed(5).toString().slice(2),oe=0;function se(de){var Me=(0,fe.Z)(de,{value:de}),Ve=(0,C.Z)(Me,2),Oe=Ve[0],qe=Ve[1];return e.useEffect(function(){oe+=1;var et="".concat(H,"-").concat(oe);qe("rc-menu-uuid-".concat(et))},[]),Oe}var Te=j(15671),we=j(43144),Ze=j(60136),dt=j(29388),Tt=j(98423),ct=j(42550);function Rt(de,Me,Ve,Oe){var qe=e.useContext(Ce),et=qe.activeKey,ut=qe.onActive,Lt=qe.onInactive,Gt={active:et===de};return Me||(Gt.onMouseEnter=function(Ft){Ve==null||Ve({key:de,domEvent:Ft}),ut(de)},Gt.onMouseLeave=function(Ft){Oe==null||Oe({key:de,domEvent:Ft}),Lt(de)}),Gt}function at(de){var Me=e.useContext(Ce),Ve=Me.mode,Oe=Me.rtl,qe=Me.inlineIndent;if(Ve!=="inline")return null;var et=de;return Oe?{paddingRight:et*qe}:{paddingLeft:et*qe}}function ze(de){var Me=de.icon,Ve=de.props,Oe=de.children,qe;return Me===null||Me===!1?null:(typeof Me=="function"?qe=e.createElement(Me,(0,Q.Z)({},Ve)):typeof Me!="boolean"&&(qe=Me),qe||Oe||null)}var st=["item"];function lt(de){var Me=de.item,Ve=(0,k.Z)(de,st);return Object.defineProperty(Ve,"item",{get:function(){return(0,Ae.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Me}}),Ve}var bt=["title","attribute","elementRef"],Ot=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Nt=["active"],It=function(de){(0,Ze.Z)(Ve,de);var Me=(0,dt.Z)(Ve);function Ve(){return(0,Te.Z)(this,Ve),Me.apply(this,arguments)}return(0,we.Z)(Ve,[{key:"render",value:function(){var qe=this.props,et=qe.title,ut=qe.attribute,Lt=qe.elementRef,Gt=(0,k.Z)(qe,bt),Ft=(0,Tt.Z)(Gt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Ae.ZP)(!ut,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),e.createElement(_e.Item,(0,Z.Z)({},ut,{title:typeof et=="string"?et:void 0},Ft,{ref:Lt}))}}]),Ve}(e.Component),ht=e.forwardRef(function(de,Me){var Ve=de.style,Oe=de.className,qe=de.eventKey,et=de.warnKey,ut=de.disabled,Lt=de.itemIcon,Gt=de.children,Ft=de.role,Jt=de.onMouseEnter,Vt=de.onMouseLeave,Qt=de.onClick,sr=de.onKeyDown,zt=de.onFocus,fr=(0,k.Z)(de,Ot),qt=Ie(qe),G=e.useContext(Ce),J=G.prefixCls,Y=G.onItemClick,ve=G.disabled,Pe=G.overflowDisabled,Ye=G.itemIcon,nt=G.selectedKeys,xt=G.onActive,yt=e.useContext(ke),kt=yt._internalRenderMenuItem,pt="".concat(J,"-item"),vt=e.useRef(),At=e.useRef(),Dt=ve||ut,Ut=(0,ct.x1)(Me,At),tr=ne(qe),Ht=function(br){return{key:qe,keyPath:(0,K.Z)(tr).reverse(),item:vt.current,domEvent:br}},or=Lt||Ye,er=Rt(qe,Dt,Jt,Vt),Xt=er.active,lr=(0,k.Z)(er,Nt),cr=nt.includes(qe),jt=at(tr.length),Ir=function(br){if(!Dt){var Mr=Ht(br);Qt==null||Qt(lt(Mr)),Y(Mr)}},Er=function(br){if(sr==null||sr(br),br.which===rt.Z.ENTER){var Mr=Ht(br);Qt==null||Qt(lt(Mr)),Y(Mr)}},Dr=function(br){xt(qe),zt==null||zt(br)},Jr={};de.role==="option"&&(Jr["aria-selected"]=cr);var Pr=e.createElement(It,(0,Z.Z)({ref:vt,elementRef:Ut,role:Ft===null?"none":Ft||"menuitem",tabIndex:ut?null:-1,"data-menu-id":Pe&&qt?null:qt},(0,Tt.Z)(fr,["extra"]),lr,Jr,{component:"li","aria-disabled":ut,style:(0,Q.Z)((0,Q.Z)({},jt),Ve),className:B()(pt,(0,ae.Z)((0,ae.Z)((0,ae.Z)({},"".concat(pt,"-active"),Xt),"".concat(pt,"-selected"),cr),"".concat(pt,"-disabled"),Dt),Oe),onClick:Ir,onKeyDown:Er,onFocus:Dr}),Gt,e.createElement(ze,{props:(0,Q.Z)((0,Q.Z)({},de),{},{isSelected:cr}),icon:or}));return kt&&(Pr=kt(Pr,de,{selected:cr})),Pr});function Bt(de,Me){var Ve=de.eventKey,Oe=ee(),qe=ne(Ve);return e.useEffect(function(){if(Oe)return Oe.registerPath(Ve,qe),function(){Oe.unregisterPath(Ve,qe)}},[qe]),Oe?null:e.createElement(ht,(0,Z.Z)({},de,{ref:Me}))}var Pt=e.forwardRef(Bt),Kt=["className","children"],Wt=function(Me,Ve){var Oe=Me.className,qe=Me.children,et=(0,k.Z)(Me,Kt),ut=e.useContext(Ce),Lt=ut.prefixCls,Gt=ut.mode,Ft=ut.rtl;return e.createElement("ul",(0,Z.Z)({className:B()(Lt,Ft&&"".concat(Lt,"-rtl"),"".concat(Lt,"-sub"),"".concat(Lt,"-").concat(Gt==="inline"?"inline":"vertical"),Oe),role:"menu"},et,{"data-menu-list":!0,ref:Ve}),qe)},$t=e.forwardRef(Wt);$t.displayName="SubMenuList";var ir=$t,ar=j(50344);function hn(de,Me){return(0,ar.Z)(de).map(function(Ve,Oe){if(e.isValidElement(Ve)){var qe,et,ut=Ve.key,Lt=(qe=(et=Ve.props)===null||et===void 0?void 0:et.eventKey)!==null&&qe!==void 0?qe:ut,Gt=Lt==null;Gt&&(Lt="tmp_key-".concat([].concat((0,K.Z)(Me),[Oe]).join("-")));var Ft={key:Lt,eventKey:Lt};return e.cloneElement(Ve,Ft)}return Ve})}var dn=j(98280),vr={adjustX:1,adjustY:1},gn={topLeft:{points:["bl","tl"],overflow:vr},topRight:{points:["br","tr"],overflow:vr},bottomLeft:{points:["tl","bl"],overflow:vr},bottomRight:{points:["tr","br"],overflow:vr},leftTop:{points:["tr","tl"],overflow:vr},leftBottom:{points:["br","bl"],overflow:vr},rightTop:{points:["tl","tr"],overflow:vr},rightBottom:{points:["bl","br"],overflow:vr}},Rr={topLeft:{points:["bl","tl"],overflow:vr},topRight:{points:["br","tr"],overflow:vr},bottomLeft:{points:["tl","bl"],overflow:vr},bottomRight:{points:["tr","br"],overflow:vr},rightTop:{points:["tr","tl"],overflow:vr},rightBottom:{points:["br","bl"],overflow:vr},leftTop:{points:["tl","tr"],overflow:vr},leftBottom:{points:["bl","br"],overflow:vr}},gr=null;function yr(de,Me,Ve){if(Me)return Me;if(Ve)return Ve[de]||Ve.other}var vn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Kr(de){var Me=de.prefixCls,Ve=de.visible,Oe=de.children,qe=de.popup,et=de.popupStyle,ut=de.popupClassName,Lt=de.popupOffset,Gt=de.disabled,Ft=de.mode,Jt=de.onVisibleChange,Vt=e.useContext(Ce),Qt=Vt.getPopupContainer,sr=Vt.rtl,zt=Vt.subMenuOpenDelay,fr=Vt.subMenuCloseDelay,qt=Vt.builtinPlacements,G=Vt.triggerSubMenuAction,J=Vt.forceSubMenuRender,Y=Vt.rootClassName,ve=Vt.motion,Pe=Vt.defaultMotions,Ye=e.useState(!1),nt=(0,C.Z)(Ye,2),xt=nt[0],yt=nt[1],kt=sr?(0,Q.Z)((0,Q.Z)({},Rr),qt):(0,Q.Z)((0,Q.Z)({},gn),qt),pt=vn[Ft],vt=yr(Ft,ve,Pe),At=e.useRef(vt);Ft!=="inline"&&(At.current=vt);var Dt=(0,Q.Z)((0,Q.Z)({},At.current),{},{leavedClassName:"".concat(Me,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Ut=e.useRef();return e.useEffect(function(){return Ut.current=(0,tt.Z)(function(){yt(Ve)}),function(){tt.Z.cancel(Ut.current)}},[Ve]),e.createElement(dn.Z,{prefixCls:Me,popupClassName:B()("".concat(Me,"-popup"),(0,ae.Z)({},"".concat(Me,"-rtl"),sr),ut,Y),stretch:Ft==="horizontal"?"minWidth":null,getPopupContainer:Qt,builtinPlacements:kt,popupPlacement:pt,popupVisible:xt,popup:qe,popupStyle:et,popupAlign:Lt&&{offset:Lt},action:Gt?[]:[G],mouseEnterDelay:zt,mouseLeaveDelay:fr,onPopupVisibleChange:Jt,forceRender:J,popupMotion:Dt,fresh:!0},Oe)}var $r=j(62874);function Cn(de){var Me=de.id,Ve=de.open,Oe=de.keyPath,qe=de.children,et="inline",ut=e.useContext(Ce),Lt=ut.prefixCls,Gt=ut.forceSubMenuRender,Ft=ut.motion,Jt=ut.defaultMotions,Vt=ut.mode,Qt=e.useRef(!1);Qt.current=Vt===et;var sr=e.useState(!Qt.current),zt=(0,C.Z)(sr,2),fr=zt[0],qt=zt[1],G=Qt.current?Ve:!1;e.useEffect(function(){Qt.current&&qt(!1)},[Vt]);var J=(0,Q.Z)({},yr(et,Ft,Jt));Oe.length>1&&(J.motionAppear=!1);var Y=J.onVisibleChanged;return J.onVisibleChanged=function(ve){return!Qt.current&&!ve&&qt(!0),Y==null?void 0:Y(ve)},fr?null:e.createElement(X,{mode:et,locked:!Qt.current},e.createElement($r.Z,(0,Z.Z)({visible:G},J,{forceRender:Gt,removeOnLeave:!1,leavedClassName:"".concat(Lt,"-hidden")}),function(ve){var Pe=ve.className,Ye=ve.style;return e.createElement(ir,{id:Me,className:Pe,style:Ye},qe)}))}var ii=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],$n=["active"],ai=e.forwardRef(function(de,Me){var Ve=de.style,Oe=de.className,qe=de.title,et=de.eventKey,ut=de.warnKey,Lt=de.disabled,Gt=de.internalPopupClose,Ft=de.children,Jt=de.itemIcon,Vt=de.expandIcon,Qt=de.popupClassName,sr=de.popupOffset,zt=de.popupStyle,fr=de.onClick,qt=de.onMouseEnter,G=de.onMouseLeave,J=de.onTitleClick,Y=de.onTitleMouseEnter,ve=de.onTitleMouseLeave,Pe=(0,k.Z)(de,ii),Ye=Ie(et),nt=e.useContext(Ce),xt=nt.prefixCls,yt=nt.mode,kt=nt.openKeys,pt=nt.disabled,vt=nt.overflowDisabled,At=nt.activeKey,Dt=nt.selectedKeys,Ut=nt.itemIcon,tr=nt.expandIcon,Ht=nt.onItemClick,or=nt.onOpenChange,er=nt.onActive,Xt=e.useContext(ke),lr=Xt._internalRenderSubMenuItem,cr=e.useContext(ce),jt=cr.isSubPathKey,Ir=ne(),Er="".concat(xt,"-submenu"),Dr=pt||Lt,Jr=e.useRef(),Pr=e.useRef(),Wr=Jt!=null?Jt:Ut,br=Vt!=null?Vt:tr,Mr=kt.includes(et),jr=!vt&&Mr,Xr=jt(Dt,et),on=Rt(et,Dr,Y,ve),xr=on.active,kr=(0,k.Z)(on,$n),nr=e.useState(!1),ln=(0,C.Z)(nr,2),tn=ln[0],Nr=ln[1],ur=function(zr){Dr||Nr(zr)},rn=function(zr){ur(!0),qt==null||qt({key:et,domEvent:zr})},xn=function(zr){ur(!1),G==null||G({key:et,domEvent:zr})},Rn=e.useMemo(function(){return xr||(yt!=="inline"?tn||jt([At],et):!1)},[yt,xr,At,tn,et,jt]),Fr=at(Ir.length),Ar=function(zr){Dr||(J==null||J({key:et,domEvent:zr}),yt==="inline"&&or(et,!Mr))},An=W(function(mr){fr==null||fr(lt(mr)),Ht(mr)}),Dn=function(zr){yt!=="inline"&&or(et,zr)},Cr=function(){er(et)},qr=Ye&&"".concat(Ye,"-popup"),Gr=e.useMemo(function(){return e.createElement(ze,{icon:yt!=="horizontal"?br:void 0,props:(0,Q.Z)((0,Q.Z)({},de),{},{isOpen:jr,isSubMenu:!0})},e.createElement("i",{className:"".concat(Er,"-arrow")}))},[yt,br,de,jr,Er]),Br=e.createElement("div",(0,Z.Z)({role:"menuitem",style:Fr,className:"".concat(Er,"-title"),tabIndex:Dr?null:-1,ref:Jr,title:typeof qe=="string"?qe:null,"data-menu-id":vt&&Ye?null:Ye,"aria-expanded":jr,"aria-haspopup":!0,"aria-controls":qr,"aria-disabled":Dr,onClick:Ar,onFocus:Cr},kr),qe,Gr),un=e.useRef(yt);if(yt!=="inline"&&Ir.length>1?un.current="vertical":un.current=yt,!vt){var En=un.current;Br=e.createElement(Kr,{mode:En,prefixCls:Er,visible:!Gt&&jr&&yt!=="inline",popupClassName:Qt,popupOffset:sr,popupStyle:zt,popup:e.createElement(X,{mode:En==="horizontal"?"vertical":En},e.createElement(ir,{id:qr,ref:Pr},Ft)),disabled:Dr,onVisibleChange:Dn},Br)}var Zr=e.createElement(_e.Item,(0,Z.Z)({ref:Me,role:"none"},Pe,{component:"li",style:Ve,className:B()(Er,"".concat(Er,"-").concat(yt),Oe,(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)({},"".concat(Er,"-open"),jr),"".concat(Er,"-active"),Rn),"".concat(Er,"-selected"),Xr),"".concat(Er,"-disabled"),Dr)),onMouseEnter:rn,onMouseLeave:xn}),Br,!vt&&e.createElement(Cn,{id:qr,open:jr,keyPath:Ir},Ft));return lr&&(Zr=lr(Zr,de,{selected:Xr,active:Rn,open:jr,disabled:Dr})),e.createElement(X,{onItemClick:An,mode:yt==="horizontal"?"vertical":yt,itemIcon:Wr,expandIcon:br},Zr)}),gi=e.forwardRef(function(de,Me){var Ve=de.eventKey,Oe=de.children,qe=ne(Ve),et=hn(Oe,qe),ut=ee();e.useEffect(function(){if(ut)return ut.registerPath(Ve,qe),function(){ut.unregisterPath(Ve,qe)}},[qe]);var Lt;return ut?Lt=et:Lt=e.createElement(ai,(0,Z.Z)({ref:Me},de),et),e.createElement(z.Provider,{value:qe},Lt)}),On=gi,yi=j(71002);function Fn(de){var Me=de.className,Ve=de.style,Oe=e.useContext(Ce),qe=Oe.prefixCls,et=ee();return et?null:e.createElement("li",{role:"separator",className:B()("".concat(qe,"-item-divider"),Me),style:Ve})}var Sn=["className","title","eventKey","children"],Xn=e.forwardRef(function(de,Me){var Ve=de.className,Oe=de.title,qe=de.eventKey,et=de.children,ut=(0,k.Z)(de,Sn),Lt=e.useContext(Ce),Gt=Lt.prefixCls,Ft="".concat(Gt,"-item-group");return e.createElement("li",(0,Z.Z)({ref:Me,role:"presentation"},ut,{onClick:function(Vt){return Vt.stopPropagation()},className:B()(Ft,Ve)}),e.createElement("div",{role:"presentation",className:"".concat(Ft,"-title"),title:typeof Oe=="string"?Oe:void 0},Oe),e.createElement("ul",{role:"group",className:"".concat(Ft,"-list")},et))}),Tn=e.forwardRef(function(de,Me){var Ve=de.eventKey,Oe=de.children,qe=ne(Ve),et=hn(Oe,qe),ut=ee();return ut?et:e.createElement(Xn,(0,Z.Z)({ref:Me},(0,Tt.Z)(de,["warnKey"])),et)}),sn=Tn,yn=["label","children","key","type","extra"];function Bn(de,Me,Ve){var Oe=Me.item,qe=Me.group,et=Me.submenu,ut=Me.divider;return(de||[]).map(function(Lt,Gt){if(Lt&&(0,yi.Z)(Lt)==="object"){var Ft=Lt,Jt=Ft.label,Vt=Ft.children,Qt=Ft.key,sr=Ft.type,zt=Ft.extra,fr=(0,k.Z)(Ft,yn),qt=Qt!=null?Qt:"tmp-".concat(Gt);return Vt||sr==="group"?sr==="group"?e.createElement(qe,(0,Z.Z)({key:qt},fr,{title:Jt}),Bn(Vt,Me,Ve)):e.createElement(et,(0,Z.Z)({key:qt},fr,{title:Jt}),Bn(Vt,Me,Ve)):sr==="divider"?e.createElement(ut,(0,Z.Z)({key:qt},fr)):e.createElement(Oe,(0,Z.Z)({key:qt},fr,{extra:zt}),Jt,(!!zt||zt===0)&&e.createElement("span",{className:"".concat(Ve,"-item-extra")},zt))}return null}).filter(function(Lt){return Lt})}function fi(de,Me,Ve,Oe,qe){var et=de,ut=(0,Q.Z)({divider:Fn,item:Pt,group:sn,submenu:On},Oe);return Me&&(et=Bn(Me,ut,qe)),hn(et,Ve)}var Ri=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],pn=[],en=e.forwardRef(function(de,Me){var Ve,Oe=de,qe=Oe.prefixCls,et=qe===void 0?"rc-menu":qe,ut=Oe.rootClassName,Lt=Oe.style,Gt=Oe.className,Ft=Oe.tabIndex,Jt=Ft===void 0?0:Ft,Vt=Oe.items,Qt=Oe.children,sr=Oe.direction,zt=Oe.id,fr=Oe.mode,qt=fr===void 0?"vertical":fr,G=Oe.inlineCollapsed,J=Oe.disabled,Y=Oe.disabledOverflow,ve=Oe.subMenuOpenDelay,Pe=ve===void 0?.1:ve,Ye=Oe.subMenuCloseDelay,nt=Ye===void 0?.1:Ye,xt=Oe.forceSubMenuRender,yt=Oe.defaultOpenKeys,kt=Oe.openKeys,pt=Oe.activeKey,vt=Oe.defaultActiveFirst,At=Oe.selectable,Dt=At===void 0?!0:At,Ut=Oe.multiple,tr=Ut===void 0?!1:Ut,Ht=Oe.defaultSelectedKeys,or=Oe.selectedKeys,er=Oe.onSelect,Xt=Oe.onDeselect,lr=Oe.inlineIndent,cr=lr===void 0?24:lr,jt=Oe.motion,Ir=Oe.defaultMotions,Er=Oe.triggerSubMenuAction,Dr=Er===void 0?"hover":Er,Jr=Oe.builtinPlacements,Pr=Oe.itemIcon,Wr=Oe.expandIcon,br=Oe.overflowedIndicator,Mr=br===void 0?"...":br,jr=Oe.overflowedIndicatorPopupClassName,Xr=Oe.getPopupContainer,on=Oe.onClick,xr=Oe.onOpenChange,kr=Oe.onKeyDown,nr=Oe.openAnimation,ln=Oe.openTransitionName,tn=Oe._internalRenderMenuItem,Nr=Oe._internalRenderSubMenuItem,ur=Oe._internalComponents,rn=(0,k.Z)(Oe,Ri),xn=e.useMemo(function(){return[fi(Qt,Vt,pn,ur,et),fi(Qt,Vt,pn,{},et)]},[Qt,Vt,ur]),Rn=(0,C.Z)(xn,2),Fr=Rn[0],Ar=Rn[1],An=e.useState(!1),Dn=(0,C.Z)(An,2),Cr=Dn[0],qr=Dn[1],Gr=e.useRef(),Br=se(zt),un=sr==="rtl",En=(0,fe.Z)(yt,{value:kt,postState:function(hr){return hr||pn}}),Zr=(0,C.Z)(En,2),mr=Zr[0],zr=Zr[1],Vr=function(hr){var _r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Qr(){zr(hr),xr==null||xr(hr)}_r?(0,r.flushSync)(Qr):Qr()},ci=e.useState(mr),pr=(0,C.Z)(ci,2),Un=pr[0],Vn=pr[1],Hr=e.useRef(!1),In=e.useMemo(function(){return(qt==="inline"||qt==="vertical")&&G?["vertical",G]:[qt,!1]},[qt,G]),bn=(0,C.Z)(In,2),Kn=bn[0],Yt=bn[1],rr=Kn==="inline",dr=e.useState(Kn),Or=(0,C.Z)(dr,2),wr=Or[0],Fi=Or[1],oi=e.useState(Yt),wn=(0,C.Z)(oi,2),Qn=wn[0],Bi=wn[1];e.useEffect(function(){Fi(Kn),Bi(Yt),Hr.current&&(rr?zr(Un):Vr(pn))},[Kn,Yt]);var Li=e.useState(0),Ci=(0,C.Z)(Li,2),hi=Ci[0],Wn=Ci[1],mn=hi>=Fr.length-1||wr!=="horizontal"||Y;e.useEffect(function(){rr&&Vn(mr)},[mr]),e.useEffect(function(){return Hr.current=!0,function(){Hr.current=!1}},[]);var Pn=N(),fn=Pn.registerPath,Hn=Pn.unregisterPath,Sr=Pn.refreshOverflowKeys,Tr=Pn.isSubPathKey,Mn=Pn.getKeyPath,Jn=Pn.getKeys,Ei=Pn.getSubPathKeys,Ln=e.useMemo(function(){return{registerPath:fn,unregisterPath:Hn}},[fn,Hn]),Oi=e.useMemo(function(){return{isSubPathKey:Tr}},[Tr]);e.useEffect(function(){Sr(mn?pn:Fr.slice(hi+1).map(function(Lr){return Lr.key}))},[hi,mn]);var bi=(0,fe.Z)(pt||vt&&((Ve=Fr[0])===null||Ve===void 0?void 0:Ve.key),{value:pt}),Zn=(0,C.Z)(bi,2),qn=Zn[0],Si=Zn[1],Ti=W(function(Lr){Si(Lr)}),di=W(function(){Si(void 0)});(0,e.useImperativeHandle)(Me,function(){return{list:Gr.current,focus:function(hr){var _r,Qr=Jn(),cn=Je(Qr,Br),Yn=cn.elements,kn=cn.key2element,Mi=cn.element2key,wi=Ee(Gr.current,Yn),Nn=qn!=null?qn:wi[0]?Mi.get(wi[0]):(_r=Fr.find(function(pi){return!pi.props.disabled}))===null||_r===void 0?void 0:_r.key,_n=kn.get(Nn);if(Nn&&_n){var ti;_n==null||(ti=_n.focus)===null||ti===void 0||ti.call(_n,hr)}}}});var xi=(0,fe.Z)(Ht||[],{value:or,postState:function(hr){return Array.isArray(hr)?hr:hr==null?pn:[hr]}}),ei=(0,C.Z)(xi,2),jn=ei[0],zn=ei[1],vi=function(hr){if(Dt){var _r=hr.key,Qr=jn.includes(_r),cn;tr?Qr?cn=jn.filter(function(kn){return kn!==_r}):cn=[].concat((0,K.Z)(jn),[_r]):cn=[_r],zn(cn);var Yn=(0,Q.Z)((0,Q.Z)({},hr),{},{selectedKeys:cn});Qr?Xt==null||Xt(Yn):er==null||er(Yn)}!tr&&mr.length&&wr!=="inline"&&Vr(pn)},li=W(function(Lr){on==null||on(lt(Lr)),vi(Lr)}),Ai=W(function(Lr,hr){var _r=mr.filter(function(cn){return cn!==Lr});if(hr)_r.push(Lr);else if(wr!=="inline"){var Qr=Ei(Lr);_r=_r.filter(function(cn){return!Qr.has(cn)})}(0,me.Z)(mr,_r,!0)||Vr(_r,!0)}),nn=function(hr,_r){var Qr=_r!=null?_r:!mr.includes(hr);Ai(hr,Qr)},Ii=Qe(wr,qn,un,Br,Gr,Jn,Mn,Si,nn,kr);e.useEffect(function(){qr(!0)},[]);var Ui=e.useMemo(function(){return{_internalRenderMenuItem:tn,_internalRenderSubMenuItem:Nr}},[tn,Nr]),ui=wr!=="horizontal"||Y?Fr:Fr.map(function(Lr,hr){return e.createElement(X,{key:Lr.key,overflowDisabled:hr>hi},Lr)}),Pi=e.createElement(_e,(0,Z.Z)({id:zt,ref:Gr,prefixCls:"".concat(et,"-overflow"),component:"ul",itemComponent:Pt,className:B()(et,"".concat(et,"-root"),"".concat(et,"-").concat(wr),Gt,(0,ae.Z)((0,ae.Z)({},"".concat(et,"-inline-collapsed"),Qn),"".concat(et,"-rtl"),un),ut),dir:sr,style:Lt,role:"menu",tabIndex:Jt,data:ui,renderRawItem:function(hr){return hr},renderRawRest:function(hr){var _r=hr.length,Qr=_r?Fr.slice(-_r):null;return e.createElement(On,{eventKey:P,title:Mr,disabled:mn,internalPopupClose:_r===0,popupClassName:jr},Qr)},maxCount:wr!=="horizontal"||Y?_e.INVALIDATE:_e.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(hr){Wn(hr)},onKeyDown:Ii},rn));return e.createElement(ke.Provider,{value:Ui},e.createElement(Be.Provider,{value:Br},e.createElement(X,{prefixCls:et,rootClassName:ut,mode:wr,openKeys:mr,rtl:un,disabled:J,motion:Cr?jt:null,defaultMotions:Cr?Ir:null,activeKey:qn,onActive:Ti,onInactive:di,selectedKeys:jn,inlineIndent:cr,subMenuOpenDelay:Pe,subMenuCloseDelay:nt,forceSubMenuRender:xt,builtinPlacements:Jr,triggerSubMenuAction:Dr,getPopupContainer:Xr,itemIcon:Pr,expandIcon:Wr,onItemClick:li,onOpenChange:Ai},e.createElement(ce.Provider,{value:Oi},Pi),e.createElement("div",{style:{display:"none"},"aria-hidden":!0},e.createElement(ue.Provider,{value:Ln},Ar)))))}),Ni=en,si=Ni;si.Item=Pt,si.SubMenu=On,si.ItemGroup=sn,si.Divider=Fn;var Di=si},62874:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return ft}});var Z=j(4942),ae=j(1413),Q=j(97685),K=j(71002),C=j(67294),k=j(34203),O=j(42550),B=j(94184),e=j.n(B),I=j(98924);function w(Ne,Re){var xe={};return xe[Ne.toLowerCase()]=Re.toLowerCase(),xe["Webkit".concat(Ne)]="webkit".concat(Re),xe["Moz".concat(Ne)]="moz".concat(Re),xe["ms".concat(Ne)]="MS".concat(Re),xe["O".concat(Ne)]="o".concat(Re.toLowerCase()),xe}function u(Ne,Re){var xe={animationend:w("Animation","AnimationEnd"),transitionend:w("Transition","TransitionEnd")};return Ne&&("AnimationEvent"in Re||delete xe.animationend.animation,"TransitionEvent"in Re||delete xe.transitionend.transition),xe}var p=u((0,I.Z)(),typeof window!="undefined"?window:{}),c={};if((0,I.Z)()){var m=document.createElement("div");c=m.style}var l={};function g(Ne){if(l[Ne])return l[Ne];var Re=p[Ne];if(Re)for(var xe=Object.keys(Re),Ue=xe.length,ye=0;ye<Ue;ye+=1){var it=xe[ye];if(Object.prototype.hasOwnProperty.call(Re,it)&&it in c)return l[Ne]=Re[it],l[Ne]}return""}var _=g("animationend"),o=g("transitionend"),s=!!(_&&o),n=_||"animationend",r=o||"transitionend";function v(Ne,Re){if(!Ne)return null;if((0,K.Z)(Ne)==="object"){var xe=Re.replace(/-\w/g,function(Ue){return Ue[1].toUpperCase()});return Ne[xe]}return"".concat(Ne,"-").concat(Re)}var E="none",f="appear",S="enter",L="leave",A="none",D="prepare",a="start",i="active",t="end",h=j(63896),b=j(75164),T=function(){var Ne=C.useRef(null);function Re(){b.Z.cancel(Ne.current)}function xe(Ue){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Re();var it=(0,b.Z)(function(){ye<=1?Ue({isCanceled:function(){return it!==Ne.current}}):xe(Ue,ye-1)});Ne.current=it}return C.useEffect(function(){return function(){Re()}},[]),[xe,Re]},y=(0,I.Z)()?C.useLayoutEffect:C.useEffect,d=y,R=[D,a,i,t],M=!1,F=!0;function U(Ne){return Ne===i||Ne===t}var V=function(Ne,Re){var xe=(0,h.Z)(A),Ue=(0,Q.Z)(xe,2),ye=Ue[0],it=Ue[1],rt=T(),tt=(0,Q.Z)(rt,2),We=tt[0],ot=tt[1];function _t(){it(D,!0)}return d(function(){if(ye!==A&&ye!==t){var St=R.indexOf(ye),gt=R[St+1],wt=Re(ye);wt===M?it(gt,!0):We(function(mt){function Ct(){mt.isCanceled()||it(gt,!0)}wt===!0?Ct():Promise.resolve(wt).then(Ct)})}},[Ne,ye]),C.useEffect(function(){return function(){ot()}},[]),[_t,ye]},re=function(Ne){var Re=(0,C.useRef)(),xe=(0,C.useRef)(Ne);xe.current=Ne;var Ue=C.useCallback(function(rt){xe.current(rt)},[]);function ye(rt){rt&&(rt.removeEventListener(r,Ue),rt.removeEventListener(n,Ue))}function it(rt){Re.current&&Re.current!==rt&&ye(Re.current),rt&&rt!==Re.current&&(rt.addEventListener(r,Ue),rt.addEventListener(n,Ue),Re.current=rt)}return C.useEffect(function(){return function(){ye(Re.current)}},[]),[it,ye]};function $(Ne,Re,xe,Ue){var ye=Ue.motionEnter,it=ye===void 0?!0:ye,rt=Ue.motionAppear,tt=rt===void 0?!0:rt,We=Ue.motionLeave,ot=We===void 0?!0:We,_t=Ue.motionDeadline,St=Ue.motionLeaveImmediately,gt=Ue.onAppearPrepare,wt=Ue.onEnterPrepare,mt=Ue.onLeavePrepare,Ct=Ue.onAppearStart,Ge=Ue.onEnterStart,he=Ue.onLeaveStart,De=Ue.onAppearActive,be=Ue.onEnterActive,Ee=Ue.onLeaveActive,je=Ue.onAppearEnd,Je=Ue.onEnterEnd,Qe=Ue.onLeaveEnd,Xe=Ue.onVisibleChanged,He=(0,h.Z)(),Se=(0,Q.Z)(He,2),x=Se[0],P=Se[1],N=(0,h.Z)(E),W=(0,Q.Z)(N,2),H=W[0],oe=W[1],se=(0,h.Z)(null),Te=(0,Q.Z)(se,2),we=Te[0],Ze=Te[1],dt=(0,C.useRef)(!1),Tt=(0,C.useRef)(null);function ct(){return xe()}var Rt=(0,C.useRef)(!1);function at(Wt){var $t=ct();if(!(Wt&&!Wt.deadline&&Wt.target!==$t)){var ir=Rt.current,ar;H===f&&ir?ar=je==null?void 0:je($t,Wt):H===S&&ir?ar=Je==null?void 0:Je($t,Wt):H===L&&ir&&(ar=Qe==null?void 0:Qe($t,Wt)),H!==E&&ir&&ar!==!1&&(oe(E,!0),Ze(null,!0))}}var ze=re(at),st=(0,Q.Z)(ze,1),lt=st[0],bt=C.useMemo(function(){var Wt,$t,ir;switch(H){case f:return Wt={},(0,Z.Z)(Wt,D,gt),(0,Z.Z)(Wt,a,Ct),(0,Z.Z)(Wt,i,De),Wt;case S:return $t={},(0,Z.Z)($t,D,wt),(0,Z.Z)($t,a,Ge),(0,Z.Z)($t,i,be),$t;case L:return ir={},(0,Z.Z)(ir,D,mt),(0,Z.Z)(ir,a,he),(0,Z.Z)(ir,i,Ee),ir;default:return{}}},[H]),Ot=V(H,function(Wt){if(Wt===D){var $t=bt[D];return $t?$t(ct()):M}if(ht in bt){var ir;Ze(((ir=bt[ht])===null||ir===void 0?void 0:ir.call(bt,ct(),null))||null)}return ht===i&&(lt(ct()),_t>0&&(clearTimeout(Tt.current),Tt.current=setTimeout(function(){at({deadline:!0})},_t))),F}),Nt=(0,Q.Z)(Ot,2),It=Nt[0],ht=Nt[1],Bt=U(ht);Rt.current=Bt,d(function(){P(Re);var Wt=dt.current;if(dt.current=!0,!!Ne){var $t;!Wt&&Re&&tt&&($t=f),Wt&&Re&&it&&($t=S),(Wt&&!Re&&ot||!Wt&&St&&!Re&&ot)&&($t=L),$t&&(oe($t),It())}},[Re]),(0,C.useEffect)(function(){(H===f&&!tt||H===S&&!it||H===L&&!ot)&&oe(E)},[tt,it,ot]),(0,C.useEffect)(function(){return function(){dt.current=!1,clearTimeout(Tt.current)}},[]);var Pt=C.useRef(!1);(0,C.useEffect)(function(){x&&(Pt.current=!0),x!==void 0&&H===E&&((Pt.current||x)&&(Xe==null||Xe(x)),Pt.current=!0)},[x,H]);var Kt=we;return bt[D]&&ht===a&&(Kt=(0,ae.Z)({transition:"none"},Kt)),[H,ht,Kt,x!=null?x:Re]}var le=j(15671),te=j(43144),_e=j(60136),fe=j(29388),me=function(Ne){(0,_e.Z)(xe,Ne);var Re=(0,fe.Z)(xe);function xe(){return(0,le.Z)(this,xe),Re.apply(this,arguments)}return(0,te.Z)(xe,[{key:"render",value:function(){return this.props.children}}]),xe}(C.Component),Ae=me;function Be(Ne){var Re=Ne;(0,K.Z)(Ne)==="object"&&(Re=Ne.transitionSupport);function xe(ye){return!!(ye.motionName&&Re)}var Ue=C.forwardRef(function(ye,it){var rt=ye.visible,tt=rt===void 0?!0:rt,We=ye.removeOnLeave,ot=We===void 0?!0:We,_t=ye.forceRender,St=ye.children,gt=ye.motionName,wt=ye.leavedClassName,mt=ye.eventProps,Ct=xe(ye),Ge=(0,C.useRef)(),he=(0,C.useRef)();function De(){try{return Ge.current instanceof HTMLElement?Ge.current:(0,k.Z)(he.current)}catch(se){return null}}var be=$(Ct,tt,De,ye),Ee=(0,Q.Z)(be,4),je=Ee[0],Je=Ee[1],Qe=Ee[2],Xe=Ee[3],He=C.useRef(Xe);Xe&&(He.current=!0);var Se=C.useCallback(function(se){Ge.current=se,(0,O.mH)(it,se)},[it]),x,P=(0,ae.Z)((0,ae.Z)({},mt),{},{visible:tt});if(!St)x=null;else if(je===E||!xe(ye))Xe?x=St((0,ae.Z)({},P),Se):!ot&&He.current&&wt?x=St((0,ae.Z)((0,ae.Z)({},P),{},{className:wt}),Se):_t||!ot&&!wt?x=St((0,ae.Z)((0,ae.Z)({},P),{},{style:{display:"none"}}),Se):x=null;else{var N,W;Je===D?W="prepare":U(Je)?W="active":Je===a&&(W="start"),x=St((0,ae.Z)((0,ae.Z)({},P),{},{className:e()(v(gt,je),(N={},(0,Z.Z)(N,v(gt,"".concat(je,"-").concat(W)),W),(0,Z.Z)(N,gt,typeof gt=="string"),N)),style:Qe}),Se)}if(C.isValidElement(x)&&(0,O.Yr)(x)){var H=x,oe=H.ref;oe||(x=C.cloneElement(x,{ref:Se}))}return C.createElement(Ae,{ref:he},x)});return Ue.displayName="CSSMotion",Ue}var Le=Be(s),Ie=j(87462),pe=j(45987),Ke=j(97326),Ce="add",ie="keep",X="remove",q="removed";function ue(Ne){var Re;return Ne&&(0,K.Z)(Ne)==="object"&&"key"in Ne?Re=Ne:Re={key:Ne},(0,ae.Z)((0,ae.Z)({},Re),{},{key:String(Re.key)})}function ee(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ne.map(ue)}function z(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],xe=[],Ue=0,ye=Re.length,it=ee(Ne),rt=ee(Re);it.forEach(function(ot){for(var _t=!1,St=Ue;St<ye;St+=1){var gt=rt[St];if(gt.key===ot.key){Ue<St&&(xe=xe.concat(rt.slice(Ue,St).map(function(wt){return(0,ae.Z)((0,ae.Z)({},wt),{},{status:Ce})})),Ue=St),xe.push((0,ae.Z)((0,ae.Z)({},gt),{},{status:ie})),Ue+=1,_t=!0;break}}_t||xe.push((0,ae.Z)((0,ae.Z)({},ot),{},{status:X}))}),Ue<ye&&(xe=xe.concat(rt.slice(Ue).map(function(ot){return(0,ae.Z)((0,ae.Z)({},ot),{},{status:Ce})})));var tt={};xe.forEach(function(ot){var _t=ot.key;tt[_t]=(tt[_t]||0)+1});var We=Object.keys(tt).filter(function(ot){return tt[ot]>1});return We.forEach(function(ot){xe=xe.filter(function(_t){var St=_t.key,gt=_t.status;return St!==ot||gt!==X}),xe.forEach(function(_t){_t.key===ot&&(_t.status=ie)})}),xe}var ne=["component","children","onVisibleChanged","onAllRemoved"],ce=["status"],ge=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ke(Ne){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Le,xe=function(Ue){(0,_e.Z)(it,Ue);var ye=(0,fe.Z)(it);function it(){var rt;(0,le.Z)(this,it);for(var tt=arguments.length,We=new Array(tt),ot=0;ot<tt;ot++)We[ot]=arguments[ot];return rt=ye.call.apply(ye,[this].concat(We)),(0,Z.Z)((0,Ke.Z)(rt),"state",{keyEntities:[]}),(0,Z.Z)((0,Ke.Z)(rt),"removeKey",function(_t){var St=rt.state.keyEntities,gt=St.map(function(wt){return wt.key!==_t?wt:(0,ae.Z)((0,ae.Z)({},wt),{},{status:q})});return rt.setState({keyEntities:gt}),gt.filter(function(wt){var mt=wt.status;return mt!==q}).length}),rt}return(0,te.Z)(it,[{key:"render",value:function(){var tt=this,We=this.state.keyEntities,ot=this.props,_t=ot.component,St=ot.children,gt=ot.onVisibleChanged,wt=ot.onAllRemoved,mt=(0,pe.Z)(ot,ne),Ct=_t||C.Fragment,Ge={};return ge.forEach(function(he){Ge[he]=mt[he],delete mt[he]}),delete mt.keys,C.createElement(Ct,mt,We.map(function(he){var De=he.status,be=(0,pe.Z)(he,ce),Ee=De===Ce||De===ie;return C.createElement(Re,(0,Ie.Z)({},Ge,{key:be.key,visible:Ee,eventProps:be,onVisibleChanged:function(Je){if(gt==null||gt(Je,{key:be.key}),!Je){var Qe=tt.removeKey(be.key);Qe===0&&wt&&wt()}}}),St)}))}}],[{key:"getDerivedStateFromProps",value:function(tt,We){var ot=tt.keys,_t=We.keyEntities,St=ee(ot),gt=z(_t,St);return{keyEntities:gt.filter(function(wt){var mt=_t.find(function(Ct){var Ge=Ct.key;return wt.key===Ge});return!(mt&&mt.status===q&&wt.status===X)})}}}]),it}(C.Component);return(0,Z.Z)(xe,"defaultProps",{component:"div"}),xe}var $e=ke(s),ft=Le},71032:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return s}});var Z=j(87462),ae=j(4942),Q=j(97685),K=j(45987),C=j(94184),k=j.n(C),O=j(21770),B=j(15105),e=j(64217),I=j(67294);function w(n,r){var v=n.disabled,E=n.prefixCls,f=n.character,S=n.characterRender,L=n.index,A=n.count,D=n.value,a=n.allowHalf,i=n.focused,t=n.onHover,h=n.onClick,b=function(V){t(V,L)},T=function(V){h(V,L)},y=function(V){V.keyCode===B.Z.ENTER&&h(V,L)},d=L+1,R=new Set([E]);D===0&&L===0&&i?R.add("".concat(E,"-focused")):a&&D+.5>=d&&D<d?(R.add("".concat(E,"-half")),R.add("".concat(E,"-active")),i&&R.add("".concat(E,"-focused"))):(d<=D?R.add("".concat(E,"-full")):R.add("".concat(E,"-zero")),d===D&&i&&R.add("".concat(E,"-focused")));var M=typeof f=="function"?f(n):f,F=I.createElement("li",{className:k()(Array.from(R)),ref:r},I.createElement("div",{onClick:v?null:T,onKeyDown:v?null:y,onMouseMove:v?null:b,role:"radio","aria-checked":D>L?"true":"false","aria-posinset":L+1,"aria-setsize":A,tabIndex:v?-1:0},I.createElement("div",{className:"".concat(E,"-first")},M),I.createElement("div",{className:"".concat(E,"-second")},M)));return S&&(F=S(F,n)),F}var u=I.forwardRef(w);function p(){var n=I.useRef({});function r(E){return n.current[E]}function v(E){return function(f){n.current[E]=f}}return[r,v]}function c(n){var r=n.pageXOffset,v="scrollLeft";if(typeof r!="number"){var E=n.document;r=E.documentElement[v],typeof r!="number"&&(r=E.body[v])}return r}function m(n){var r,v,E=n.ownerDocument,f=E.body,S=E&&E.documentElement,L=n.getBoundingClientRect();return r=L.left,v=L.top,r-=S.clientLeft||f.clientLeft||0,v-=S.clientTop||f.clientTop||0,{left:r,top:v}}function l(n){var r=m(n),v=n.ownerDocument,E=v.defaultView||v.parentWindow;return r.left+=c(E),r.left}var g=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function _(n,r){var v=n.prefixCls,E=v===void 0?"rc-rate":v,f=n.className,S=n.defaultValue,L=n.value,A=n.count,D=A===void 0?5:A,a=n.allowHalf,i=a===void 0?!1:a,t=n.allowClear,h=t===void 0?!0:t,b=n.keyboard,T=b===void 0?!0:b,y=n.character,d=y===void 0?"\u2605":y,R=n.characterRender,M=n.disabled,F=n.direction,U=F===void 0?"ltr":F,V=n.tabIndex,re=V===void 0?0:V,$=n.autoFocus,le=n.onHoverChange,te=n.onChange,_e=n.onFocus,fe=n.onBlur,me=n.onKeyDown,Ae=n.onMouseLeave,Be=(0,K.Z)(n,g),Le=p(),Ie=(0,Q.Z)(Le,2),pe=Ie[0],Ke=Ie[1],Ce=I.useRef(null),ie=function(){if(!M){var Ge;(Ge=Ce.current)===null||Ge===void 0||Ge.focus()}};I.useImperativeHandle(r,function(){return{focus:ie,blur:function(){if(!M){var Ge;(Ge=Ce.current)===null||Ge===void 0||Ge.blur()}}}});var X=(0,O.Z)(S||0,{value:L}),q=(0,Q.Z)(X,2),ue=q[0],ee=q[1],z=(0,O.Z)(null),ne=(0,Q.Z)(z,2),ce=ne[0],ge=ne[1],ke=function(Ge,he){var De=U==="rtl",be=Ge+1;if(i){var Ee=pe(Ge),je=l(Ee),Je=Ee.clientWidth;(De&&he-je>Je/2||!De&&he-je<Je/2)&&(be-=.5)}return be},$e=function(Ge){ee(Ge),te==null||te(Ge)},ft=I.useState(!1),Ne=(0,Q.Z)(ft,2),Re=Ne[0],xe=Ne[1],Ue=function(){xe(!0),_e==null||_e()},ye=function(){xe(!1),fe==null||fe()},it=I.useState(null),rt=(0,Q.Z)(it,2),tt=rt[0],We=rt[1],ot=function(Ge,he){var De=ke(he,Ge.pageX);De!==ce&&(We(De),ge(null)),le==null||le(De)},_t=function(Ge){M||(We(null),ge(null),le==null||le(void 0)),Ge&&(Ae==null||Ae(Ge))},St=function(Ge,he){var De=ke(he,Ge.pageX),be=!1;h&&(be=De===ue),_t(),$e(be?0:De),ge(be?De:null)},gt=function(Ge){var he=Ge.keyCode,De=U==="rtl",be=i?.5:1;T&&(he===B.Z.RIGHT&&ue<D&&!De?($e(ue+be),Ge.preventDefault()):he===B.Z.LEFT&&ue>0&&!De||he===B.Z.RIGHT&&ue>0&&De?($e(ue-be),Ge.preventDefault()):he===B.Z.LEFT&&ue<D&&De&&($e(ue+be),Ge.preventDefault())),me==null||me(Ge)};I.useEffect(function(){$&&!M&&ie()},[]);var wt=new Array(D).fill(0).map(function(Ct,Ge){return I.createElement(u,{ref:Ke(Ge),index:Ge,count:D,disabled:M,prefixCls:"".concat(E,"-star"),allowHalf:i,value:tt===null?ue:tt,onClick:St,onHover:ot,key:Ct||Ge,character:d,characterRender:R,focused:Re})}),mt=k()(E,f,(0,ae.Z)((0,ae.Z)({},"".concat(E,"-disabled"),M),"".concat(E,"-rtl"),U==="rtl"));return I.createElement("ul",(0,Z.Z)({className:mt,onMouseLeave:_t,tabIndex:M?-1:re,onFocus:M?null:Ue,onBlur:M?null:ye,onKeyDown:M?null:gt,ref:Ce},(0,e.Z)(Be,{aria:!0,data:!0,attr:!0})),wt)}var o=I.forwardRef(_),s=o},48555:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return D}});var Z=j(87462),ae=j(67294),Q=j(50344),K=j(80334),C=j(1413),k=j(42550),O=j(34203),B=j(91033),e=new Map;function I(a){a.forEach(function(i){var t,h=i.target;(t=e.get(h))===null||t===void 0||t.forEach(function(b){return b(h)})})}var w=new B.Z(I),u=null,p=null;function c(a,i){e.has(a)||(e.set(a,new Set),w.observe(a)),e.get(a).add(i)}function m(a,i){e.has(a)&&(e.get(a).delete(i),e.get(a).size||(w.unobserve(a),e.delete(a)))}var l=j(15671),g=j(43144),_=j(60136),o=j(29388),s=function(a){(0,_.Z)(t,a);var i=(0,o.Z)(t);function t(){return(0,l.Z)(this,t),i.apply(this,arguments)}return(0,g.Z)(t,[{key:"render",value:function(){return this.props.children}}]),t}(ae.Component),n=ae.createContext(null);function r(a){var i=a.children,t=a.onBatchResize,h=ae.useRef(0),b=ae.useRef([]),T=ae.useContext(n),y=ae.useCallback(function(d,R,M){h.current+=1;var F=h.current;b.current.push({size:d,element:R,data:M}),Promise.resolve().then(function(){F===h.current&&(t==null||t(b.current),b.current=[])}),T==null||T(d,R,M)},[t,T]);return ae.createElement(n.Provider,{value:y},i)}function v(a,i){var t=a.children,h=a.disabled,b=ae.useRef(null),T=ae.useRef(null),y=ae.useContext(n),d=typeof t=="function",R=d?t(b):t,M=ae.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),F=!d&&ae.isValidElement(R)&&(0,k.Yr)(R),U=F?R.ref:null,V=ae.useMemo(function(){return(0,k.sQ)(U,b)},[U,b]),re=function(){return(0,O.Z)(b.current)||(0,O.Z)(T.current)};ae.useImperativeHandle(i,function(){return re()});var $=ae.useRef(a);$.current=a;var le=ae.useCallback(function(te){var _e=$.current,fe=_e.onResize,me=_e.data,Ae=te.getBoundingClientRect(),Be=Ae.width,Le=Ae.height,Ie=te.offsetWidth,pe=te.offsetHeight,Ke=Math.floor(Be),Ce=Math.floor(Le);if(M.current.width!==Ke||M.current.height!==Ce||M.current.offsetWidth!==Ie||M.current.offsetHeight!==pe){var ie={width:Ke,height:Ce,offsetWidth:Ie,offsetHeight:pe};M.current=ie;var X=Ie===Math.round(Be)?Be:Ie,q=pe===Math.round(Le)?Le:pe,ue=(0,C.Z)((0,C.Z)({},ie),{},{offsetWidth:X,offsetHeight:q});y==null||y(ue,te,me),fe&&Promise.resolve().then(function(){fe(ue,te)})}},[]);return ae.useEffect(function(){var te=re();return te&&!h&&c(te,le),function(){return m(te,le)}},[b.current,h]),ae.createElement(s,{ref:T},F?ae.cloneElement(R,{ref:V}):R)}var E=ae.forwardRef(v),f=E,S="rc-observer-key";function L(a,i){var t=a.children,h=typeof t=="function"?[t]:(0,Q.Z)(t);return h.map(function(b,T){var y=(b==null?void 0:b.key)||"".concat(S,"-").concat(T);return ae.createElement(f,(0,Z.Z)({},a,{key:y,ref:T===0?i:void 0}),b)})}var A=ae.forwardRef(L);A.Collection=r;var D=A},58212:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return y}});function Z(){return Z=Object.assign?Object.assign.bind():function(d){for(var R=1;R<arguments.length;R++){var M=arguments[R];for(var F in M)Object.prototype.hasOwnProperty.call(M,F)&&(d[F]=M[F])}return d},Z.apply(this,arguments)}function ae(d){"@babel/helpers - typeof";return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},ae(d)}function Q(d,R){if(ae(d)!=="object"||d===null)return d;var M=d[Symbol.toPrimitive];if(M!==void 0){var F=M.call(d,R||"default");if(ae(F)!=="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(d)}function K(d){var R=Q(d,"string");return ae(R)==="symbol"?R:String(R)}function C(d,R,M){return R=K(R),R in d?Object.defineProperty(d,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):d[R]=M,d}function k(d){if(Array.isArray(d))return d}function O(d,R){var M=d==null?null:typeof Symbol!="undefined"&&d[Symbol.iterator]||d["@@iterator"];if(M!=null){var F,U,V,re,$=[],le=!0,te=!1;try{if(V=(M=M.call(d)).next,R===0){if(Object(M)!==M)return;le=!1}else for(;!(le=(F=V.call(M)).done)&&($.push(F.value),$.length!==R);le=!0);}catch(_e){te=!0,U=_e}finally{try{if(!le&&M.return!=null&&(re=M.return(),Object(re)!==re))return}finally{if(te)throw U}}return $}}function B(d,R){(R==null||R>d.length)&&(R=d.length);for(var M=0,F=new Array(R);M<R;M++)F[M]=d[M];return F}function e(d,R){if(d){if(typeof d=="string")return B(d,R);var M=Object.prototype.toString.call(d).slice(8,-1);if(M==="Object"&&d.constructor&&(M=d.constructor.name),M==="Map"||M==="Set")return Array.from(d);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return B(d,R)}}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(d,R){return k(d)||O(d,R)||e(d,R)||I()}function u(d,R){if(d==null)return{};var M={},F=Object.keys(d),U,V;for(V=0;V<F.length;V++)U=F[V],!(R.indexOf(U)>=0)&&(M[U]=d[U]);return M}function p(d,R){if(d==null)return{};var M=u(d,R),F,U;if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(d);for(U=0;U<V.length;U++)F=V[U],!(R.indexOf(F)>=0)&&Object.prototype.propertyIsEnumerable.call(d,F)&&(M[F]=d[F])}return M}var c=j(67294),m=j(94184),l=j.n(m);function g(d){if(Array.isArray(d))return d}function _(d,R){var M=d==null?null:typeof Symbol!="undefined"&&d[Symbol.iterator]||d["@@iterator"];if(M!=null){var F,U,V,re,$=[],le=!0,te=!1;try{if(V=(M=M.call(d)).next,R===0){if(Object(M)!==M)return;le=!1}else for(;!(le=(F=V.call(M)).done)&&($.push(F.value),$.length!==R);le=!0);}catch(_e){te=!0,U=_e}finally{try{if(!le&&M.return!=null&&(re=M.return(),Object(re)!==re))return}finally{if(te)throw U}}return $}}function o(d,R){(R==null||R>d.length)&&(R=d.length);for(var M=0,F=new Array(R);M<R;M++)F[M]=d[M];return F}function s(d,R){if(d){if(typeof d=="string")return o(d,R);var M=Object.prototype.toString.call(d).slice(8,-1);if(M==="Object"&&d.constructor&&(M=d.constructor.name),M==="Map"||M==="Set")return Array.from(d);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return o(d,R)}}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(d,R){return g(d)||_(d,R)||s(d,R)||n()}function v(d){var R=c.useRef();R.current=d;var M=c.useCallback(function(){for(var F,U=arguments.length,V=new Array(U),re=0;re<U;re++)V[re]=arguments[re];return(F=R.current)===null||F===void 0?void 0:F.call.apply(F,[R].concat(V))},[]);return M}function E(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var f=E()?c.useLayoutEffect:c.useEffect,S=function(R,M){var F=c.useRef(!0);f(function(){return R(F.current)},M),f(function(){return F.current=!1,function(){F.current=!0}},[])},L=function(R,M){S(function(F){if(!F)return R()},M)},A=null;function D(d){var R=c.useRef(!1),M=c.useState(d),F=r(M,2),U=F[0],V=F[1];c.useEffect(function(){return R.current=!1,function(){R.current=!0}},[]);function re($,le){le&&R.current||V($)}return[U,re]}function a(d){return d!==void 0}function i(d,R){var M=R||{},F=M.defaultValue,U=M.value,V=M.onChange,re=M.postState,$=D(function(){return a(U)?U:a(F)?typeof F=="function"?F():F:typeof d=="function"?d():d}),le=r($,2),te=le[0],_e=le[1],fe=U!==void 0?U:te,me=re?re(fe):fe,Ae=v(V),Be=D([fe]),Le=r(Be,2),Ie=Le[0],pe=Le[1];L(function(){var Ce=Ie[0];te!==Ce&&Ae(te,Ce)},[Ie]),L(function(){a(U)||_e(U)},[U]);var Ke=v(function(Ce,ie){_e(Ce,ie),pe([fe],ie)});return[me,Ke]}var t={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(R){var M=R.keyCode;if(R.altKey&&!R.ctrlKey||R.metaKey||M>=t.F1&&M<=t.F12)return!1;switch(M){case t.ALT:case t.CAPS_LOCK:case t.CONTEXT_MENU:case t.CTRL:case t.DOWN:case t.END:case t.ESC:case t.HOME:case t.INSERT:case t.LEFT:case t.MAC_FF_META:case t.META:case t.NUMLOCK:case t.NUM_CENTER:case t.PAGE_DOWN:case t.PAGE_UP:case t.PAUSE:case t.PRINT_SCREEN:case t.RIGHT:case t.SHIFT:case t.UP:case t.WIN_KEY:case t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(R){if(R>=t.ZERO&&R<=t.NINE||R>=t.NUM_ZERO&&R<=t.NUM_MULTIPLY||R>=t.A&&R<=t.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&R===0)return!0;switch(R){case t.SPACE:case t.QUESTION_MARK:case t.NUM_PLUS:case t.NUM_MINUS:case t.NUM_PERIOD:case t.NUM_DIVISION:case t.SEMICOLON:case t.DASH:case t.EQUALS:case t.COMMA:case t.PERIOD:case t.SLASH:case t.APOSTROPHE:case t.SINGLE_QUOTE:case t.OPEN_SQUARE_BRACKET:case t.BACKSLASH:case t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},h=t,b=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],T=c.forwardRef(function(d,R){var M,F=d.prefixCls,U=F===void 0?"rc-switch":F,V=d.className,re=d.checked,$=d.defaultChecked,le=d.disabled,te=d.loadingIcon,_e=d.checkedChildren,fe=d.unCheckedChildren,me=d.onClick,Ae=d.onChange,Be=d.onKeyDown,Le=p(d,b),Ie=i(!1,{value:re,defaultValue:$}),pe=w(Ie,2),Ke=pe[0],Ce=pe[1];function ie(ee,z){var ne=Ke;return le||(ne=ee,Ce(ne),Ae==null||Ae(ne,z)),ne}function X(ee){ee.which===h.LEFT?ie(!1,ee):ee.which===h.RIGHT&&ie(!0,ee),Be==null||Be(ee)}function q(ee){var z=ie(!Ke,ee);me==null||me(z,ee)}var ue=l()(U,V,(M={},C(M,"".concat(U,"-checked"),Ke),C(M,"".concat(U,"-disabled"),le),M));return c.createElement("button",Z({},Le,{type:"button",role:"switch","aria-checked":Ke,disabled:le,className:ue,ref:R,onKeyDown:X,onClick:q}),te,c.createElement("span",{className:"".concat(U,"-inner")},c.createElement("span",{className:"".concat(U,"-inner-checked")},_e),c.createElement("span",{className:"".concat(U,"-inner-unchecked")},fe)))});T.displayName="Switch";var y=T},36697:function(Et,Fe,j){"use strict";j.d(Fe,{G:function(){return C},Z:function(){return E}});var Z=j(94184),ae=j.n(Z),Q=j(67294),K=j.t(Q,2);function C(f){var S=f.children,L=f.prefixCls,A=f.id,D=f.overlayInnerStyle,a=f.bodyClassName,i=f.className,t=f.style;return Q.createElement("div",{className:ae()("".concat(L,"-content"),i),style:t},Q.createElement("div",{className:ae()("".concat(L,"-inner"),a),id:A,role:"tooltip",style:D},typeof S=="function"?S():S))}var k=j(87462),O=j(1413),B=j(45987),e=j(98280),I={shiftX:64,adjustY:1},w={adjustX:1,shiftY:!0},u=[0,0],p={left:{points:["cr","cl"],overflow:w,offset:[-4,0],targetOffset:u},right:{points:["cl","cr"],overflow:w,offset:[4,0],targetOffset:u},top:{points:["bc","tc"],overflow:I,offset:[0,-4],targetOffset:u},bottom:{points:["tc","bc"],overflow:I,offset:[0,4],targetOffset:u},topLeft:{points:["bl","tl"],overflow:I,offset:[0,-4],targetOffset:u},leftTop:{points:["tr","tl"],overflow:w,offset:[-4,0],targetOffset:u},topRight:{points:["br","tr"],overflow:I,offset:[0,-4],targetOffset:u},rightTop:{points:["tl","tr"],overflow:w,offset:[4,0],targetOffset:u},bottomRight:{points:["tr","br"],overflow:I,offset:[0,4],targetOffset:u},rightBottom:{points:["bl","br"],overflow:w,offset:[4,0],targetOffset:u},bottomLeft:{points:["tl","bl"],overflow:I,offset:[0,4],targetOffset:u},leftBottom:{points:["br","bl"],overflow:w,offset:[-4,0],targetOffset:u}},c=null,m=j(97685);function l(){var f=(0,O.Z)({},K);return f.useId}var g=0;function _(){}var o=l(),s=o?function(S){var L=o();return S||L}:function(S){var L=Q.useState("ssr-id"),A=(0,m.Z)(L,2),D=A[0],a=A[1];return Q.useEffect(function(){var i=g;g+=1,a("rc_unique_".concat(i))},[]),S||D},n=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],r=function(S,L){var A=S.overlayClassName,D=S.trigger,a=D===void 0?["hover"]:D,i=S.mouseEnterDelay,t=i===void 0?0:i,h=S.mouseLeaveDelay,b=h===void 0?.1:h,T=S.overlayStyle,y=S.prefixCls,d=y===void 0?"rc-tooltip":y,R=S.children,M=S.onVisibleChange,F=S.afterVisibleChange,U=S.transitionName,V=S.animation,re=S.motion,$=S.placement,le=$===void 0?"right":$,te=S.align,_e=te===void 0?{}:te,fe=S.destroyTooltipOnHide,me=fe===void 0?!1:fe,Ae=S.defaultVisible,Be=S.getTooltipContainer,Le=S.overlayInnerStyle,Ie=S.arrowContent,pe=S.overlay,Ke=S.id,Ce=S.showArrow,ie=Ce===void 0?!0:Ce,X=S.classNames,q=S.styles,ue=(0,B.Z)(S,n),ee=s(Ke),z=(0,Q.useRef)(null);(0,Q.useImperativeHandle)(L,function(){return z.current});var ne=(0,O.Z)({},ue);"visible"in S&&(ne.popupVisible=S.visible);var ce=function(){return Q.createElement(C,{key:"content",prefixCls:d,id:ee,bodyClassName:X==null?void 0:X.body,overlayInnerStyle:(0,O.Z)((0,O.Z)({},Le),q==null?void 0:q.body)},pe)},ge=function(){var $e=Q.Children.only(R),ft=($e==null?void 0:$e.props)||{},Ne=(0,O.Z)((0,O.Z)({},ft),{},{"aria-describedby":pe?ee:null});return Q.cloneElement(R,Ne)};return Q.createElement(e.Z,(0,k.Z)({popupClassName:ae()(A,X==null?void 0:X.root),prefixCls:d,popup:ce,action:a,builtinPlacements:p,popupPlacement:le,ref:z,popupAlign:_e,getPopupContainer:Be,onPopupVisibleChange:M,afterPopupVisibleChange:F,popupTransitionName:U,popupAnimation:V,popupMotion:re,defaultPopupVisible:Ae,autoDestroy:me,mouseLeaveDelay:b,popupStyle:(0,O.Z)((0,O.Z)({},T),q==null?void 0:q.root),mouseEnterDelay:t,arrow:ie},ne),ge())},v=(0,Q.forwardRef)(r),E=v},86128:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return s}});var Z=j(87462),ae=j(4942),Q=j(1413),K=j(97685),C=j(45987),k=j(67294),O=j(94184),B=j.n(O),e=j(64217),I=j(27822),w=function(r){for(var v=r.prefixCls,E=r.level,f=r.isStart,S=r.isEnd,L="".concat(v,"-indent-unit"),A=[],D=0;D<E;D+=1)A.push(k.createElement("span",{key:D,className:B()(L,(0,ae.Z)((0,ae.Z)({},"".concat(L,"-start"),f[D]),"".concat(L,"-end"),S[D]))}));return k.createElement("span",{"aria-hidden":"true",className:"".concat(v,"-indent")},A)},u=k.memo(w),p=j(35381),c=j(1089),m=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],l="open",g="close",_="---",o=function(r){var v,E,f,S=r.eventKey,L=r.className,A=r.style,D=r.dragOver,a=r.dragOverGapTop,i=r.dragOverGapBottom,t=r.isLeaf,h=r.isStart,b=r.isEnd,T=r.expanded,y=r.selected,d=r.checked,R=r.halfChecked,M=r.loading,F=r.domRef,U=r.active,V=r.data,re=r.onMouseMove,$=r.selectable,le=(0,C.Z)(r,m),te=k.useContext(I.k),_e=k.useContext(I.y),fe=k.useRef(null),me=k.useState(!1),Ae=(0,K.Z)(me,2),Be=Ae[0],Le=Ae[1],Ie=!!(te.disabled||r.disabled||(v=_e.nodeDisabled)!==null&&v!==void 0&&v.call(_e,V)),pe=k.useMemo(function(){return!te.checkable||r.checkable===!1?!1:te.checkable},[te.checkable,r.checkable]),Ke=function(Ee){Ie||te.onNodeSelect(Ee,(0,c.F)(r))},Ce=function(Ee){Ie||!pe||r.disableCheckbox||te.onNodeCheck(Ee,(0,c.F)(r),!d)},ie=k.useMemo(function(){return typeof $=="boolean"?$:te.selectable},[$,te.selectable]),X=function(Ee){te.onNodeClick(Ee,(0,c.F)(r)),ie?Ke(Ee):Ce(Ee)},q=function(Ee){te.onNodeDoubleClick(Ee,(0,c.F)(r))},ue=function(Ee){te.onNodeMouseEnter(Ee,(0,c.F)(r))},ee=function(Ee){te.onNodeMouseLeave(Ee,(0,c.F)(r))},z=function(Ee){te.onNodeContextMenu(Ee,(0,c.F)(r))},ne=k.useMemo(function(){return!!(te.draggable&&(!te.draggable.nodeDraggable||te.draggable.nodeDraggable(V)))},[te.draggable,V]),ce=function(Ee){Ee.stopPropagation(),Le(!0),te.onNodeDragStart(Ee,r);try{Ee.dataTransfer.setData("text/plain","")}catch(je){}},ge=function(Ee){Ee.preventDefault(),Ee.stopPropagation(),te.onNodeDragEnter(Ee,r)},ke=function(Ee){Ee.preventDefault(),Ee.stopPropagation(),te.onNodeDragOver(Ee,r)},$e=function(Ee){Ee.stopPropagation(),te.onNodeDragLeave(Ee,r)},ft=function(Ee){Ee.stopPropagation(),Le(!1),te.onNodeDragEnd(Ee,r)},Ne=function(Ee){Ee.preventDefault(),Ee.stopPropagation(),Le(!1),te.onNodeDrop(Ee,r)},Re=function(Ee){M||te.onNodeExpand(Ee,(0,c.F)(r))},xe=k.useMemo(function(){var be=(0,p.Z)(te.keyEntities,S)||{},Ee=be.children;return!!(Ee||[]).length},[te.keyEntities,S]),Ue=k.useMemo(function(){return t===!1?!1:t||!te.loadData&&!xe||te.loadData&&r.loaded&&!xe},[t,te.loadData,xe,r.loaded]);k.useEffect(function(){M||typeof te.loadData=="function"&&T&&!Ue&&!r.loaded&&te.onNodeLoad((0,c.F)(r))},[M,te.loadData,te.onNodeLoad,T,Ue,r]);var ye=k.useMemo(function(){var be;return(be=te.draggable)!==null&&be!==void 0&&be.icon?k.createElement("span",{className:"".concat(te.prefixCls,"-draggable-icon")},te.draggable.icon):null},[te.draggable]),it=function(Ee){var je=r.switcherIcon||te.switcherIcon;return typeof je=="function"?je((0,Q.Z)((0,Q.Z)({},r),{},{isLeaf:Ee})):je},rt=function(){if(Ue){var Ee=it(!0);return Ee!==!1?k.createElement("span",{className:B()("".concat(te.prefixCls,"-switcher"),"".concat(te.prefixCls,"-switcher-noop"))},Ee):null}var je=it(!1);return je!==!1?k.createElement("span",{onClick:Re,className:B()("".concat(te.prefixCls,"-switcher"),"".concat(te.prefixCls,"-switcher_").concat(T?l:g))},je):null},tt=k.useMemo(function(){if(!pe)return null;var be=typeof pe!="boolean"?pe:null;return k.createElement("span",{className:B()("".concat(te.prefixCls,"-checkbox"),(0,ae.Z)((0,ae.Z)((0,ae.Z)({},"".concat(te.prefixCls,"-checkbox-checked"),d),"".concat(te.prefixCls,"-checkbox-indeterminate"),!d&&R),"".concat(te.prefixCls,"-checkbox-disabled"),Ie||r.disableCheckbox)),onClick:Ce,role:"checkbox","aria-checked":R?"mixed":d,"aria-disabled":Ie||r.disableCheckbox,"aria-label":"Select ".concat(typeof r.title=="string"?r.title:"tree node")},be)},[pe,d,R,Ie,r.disableCheckbox,r.title]),We=k.useMemo(function(){return Ue?null:T?l:g},[Ue,T]),ot=k.useMemo(function(){return k.createElement("span",{className:B()("".concat(te.prefixCls,"-iconEle"),"".concat(te.prefixCls,"-icon__").concat(We||"docu"),(0,ae.Z)({},"".concat(te.prefixCls,"-icon_loading"),M))})},[te.prefixCls,We,M]),_t=k.useMemo(function(){var be=!!te.draggable,Ee=!r.disabled&&be&&te.dragOverNodeKey===S;return Ee?te.dropIndicatorRender({dropPosition:te.dropPosition,dropLevelOffset:te.dropLevelOffset,indent:te.indent,prefixCls:te.prefixCls,direction:te.direction}):null},[te.dropPosition,te.dropLevelOffset,te.indent,te.prefixCls,te.direction,te.draggable,te.dragOverNodeKey,te.dropIndicatorRender]),St=k.useMemo(function(){var be=r.title,Ee=be===void 0?_:be,je="".concat(te.prefixCls,"-node-content-wrapper"),Je;if(te.showIcon){var Qe=r.icon||te.icon;Je=Qe?k.createElement("span",{className:B()("".concat(te.prefixCls,"-iconEle"),"".concat(te.prefixCls,"-icon__customize"))},typeof Qe=="function"?Qe(r):Qe):ot}else te.loadData&&M&&(Je=ot);var Xe;return typeof Ee=="function"?Xe=Ee(V):te.titleRender?Xe=te.titleRender(V):Xe=Ee,k.createElement("span",{ref:fe,title:typeof Ee=="string"?Ee:"",className:B()(je,"".concat(je,"-").concat(We||"normal"),(0,ae.Z)({},"".concat(te.prefixCls,"-node-selected"),!Ie&&(y||Be))),onMouseEnter:ue,onMouseLeave:ee,onContextMenu:z,onClick:X,onDoubleClick:q},Je,k.createElement("span",{className:"".concat(te.prefixCls,"-title")},Xe),_t)},[te.prefixCls,te.showIcon,r,te.icon,ot,te.titleRender,V,We,ue,ee,z,X,q]),gt=(0,e.Z)(le,{aria:!0,data:!0}),wt=(0,p.Z)(te.keyEntities,S)||{},mt=wt.level,Ct=b[b.length-1],Ge=!Ie&&ne,he=te.draggingNodeKey===S,De=$!==void 0?{"aria-selected":!!$}:void 0;return k.createElement("div",(0,Z.Z)({ref:F,role:"treeitem","aria-expanded":t?void 0:T,className:B()(L,"".concat(te.prefixCls,"-treenode"),(f={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(f,"".concat(te.prefixCls,"-treenode-disabled"),Ie),"".concat(te.prefixCls,"-treenode-switcher-").concat(T?"open":"close"),!t),"".concat(te.prefixCls,"-treenode-checkbox-checked"),d),"".concat(te.prefixCls,"-treenode-checkbox-indeterminate"),R),"".concat(te.prefixCls,"-treenode-selected"),y),"".concat(te.prefixCls,"-treenode-loading"),M),"".concat(te.prefixCls,"-treenode-active"),U),"".concat(te.prefixCls,"-treenode-leaf-last"),Ct),"".concat(te.prefixCls,"-treenode-draggable"),ne),"dragging",he),(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(f,"drop-target",te.dropTargetKey===S),"drop-container",te.dropContainerKey===S),"drag-over",!Ie&&D),"drag-over-gap-top",!Ie&&a),"drag-over-gap-bottom",!Ie&&i),"filter-node",(E=te.filterTreeNode)===null||E===void 0?void 0:E.call(te,(0,c.F)(r))),"".concat(te.prefixCls,"-treenode-leaf"),Ue))),style:A,draggable:Ge,onDragStart:Ge?ce:void 0,onDragEnter:ne?ge:void 0,onDragOver:ne?ke:void 0,onDragLeave:ne?$e:void 0,onDrop:ne?Ne:void 0,onDragEnd:ne?ft:void 0,onMouseMove:re},De,gt),k.createElement(u,{prefixCls:te.prefixCls,level:mt,isStart:h,isEnd:b}),ye,rt(),tt,St)};o.isTreeNode=1;var s=o},27822:function(Et,Fe,j){"use strict";j.d(Fe,{k:function(){return ae},y:function(){return Q}});var Z=j(67294),ae=Z.createContext(null),Q=Z.createContext({})},70593:function(Et,Fe,j){"use strict";j.d(Fe,{OF:function(){return S.Z},y6:function(){return g.y},ZP:function(){return Ie}});var Z=j(87462),ae=j(71002),Q=j(1413),K=j(74902),C=j(15671),k=j(43144),O=j(97326),B=j(60136),e=j(29388),I=j(4942),w=j(94184),u=j.n(w),p=j(15105),c=j(64217),m=j(80334),l=j(67294),g=j(27822),_=function(Ke){var Ce=Ke.dropPosition,ie=Ke.dropLevelOffset,X=Ke.indent,q={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ce){case-1:q.top=0,q.left=-ie*X;break;case 1:q.bottom=0,q.left=-ie*X;break;case 0:q.bottom=0,q.left=X;break}return l.createElement("div",{style:q})},o=_;function s(pe){if(pe==null)throw new TypeError("Cannot destructure "+pe)}var n=j(97685),r=j(45987),v=j(8410),E=j(73299),f=j(62874),S=j(86128);function L(pe,Ke){var Ce=l.useState(!1),ie=(0,n.Z)(Ce,2),X=ie[0],q=ie[1];(0,v.Z)(function(){if(X)return pe(),function(){Ke()}},[X]),(0,v.Z)(function(){return q(!0),function(){q(!1)}},[])}var A=L,D=j(1089),a=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],i=l.forwardRef(function(pe,Ke){var Ce=pe.className,ie=pe.style,X=pe.motion,q=pe.motionNodes,ue=pe.motionType,ee=pe.onMotionStart,z=pe.onMotionEnd,ne=pe.active,ce=pe.treeNodeRequiredProps,ge=(0,r.Z)(pe,a),ke=l.useState(!0),$e=(0,n.Z)(ke,2),ft=$e[0],Ne=$e[1],Re=l.useContext(g.k),xe=Re.prefixCls,Ue=q&&ue!=="hide";(0,v.Z)(function(){q&&Ue!==ft&&Ne(Ue)},[q]);var ye=function(){q&&ee()},it=l.useRef(!1),rt=function(){q&&!it.current&&(it.current=!0,z())};A(ye,rt);var tt=function(ot){Ue===ot&&rt()};return q?l.createElement(f.Z,(0,Z.Z)({ref:Ke,visible:ft},X,{motionAppear:ue==="show",onVisibleChanged:tt}),function(We,ot){var _t=We.className,St=We.style;return l.createElement("div",{ref:ot,className:u()("".concat(xe,"-treenode-motion"),_t),style:St},q.map(function(gt){var wt=Object.assign({},(s(gt.data),gt.data)),mt=gt.title,Ct=gt.key,Ge=gt.isStart,he=gt.isEnd;delete wt.children;var De=(0,D.H8)(Ct,ce);return l.createElement(S.Z,(0,Z.Z)({},wt,De,{title:mt,active:ne,data:gt.data,key:Ct,isStart:Ge,isEnd:he}))}))}):l.createElement(S.Z,(0,Z.Z)({domRef:Ke,className:Ce,style:ie},ge,{active:ne}))}),t=i;function h(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ce=pe.length,ie=Ke.length;if(Math.abs(Ce-ie)!==1)return{add:!1,key:null};function X(q,ue){var ee=new Map;q.forEach(function(ne){ee.set(ne,!0)});var z=ue.filter(function(ne){return!ee.has(ne)});return z.length===1?z[0]:null}return Ce<ie?{add:!0,key:X(pe,Ke)}:{add:!1,key:X(Ke,pe)}}function b(pe,Ke,Ce){var ie=pe.findIndex(function(ee){return ee.key===Ce}),X=pe[ie+1],q=Ke.findIndex(function(ee){return ee.key===Ce});if(X){var ue=Ke.findIndex(function(ee){return ee.key===X.key});return Ke.slice(q+1,ue)}return Ke.slice(q+1)}var T=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],y={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},d=function(){},R="RC_TREE_MOTION_".concat(Math.random()),M={key:R},F={key:R,level:0,index:0,pos:"0",node:M,nodes:[M]},U={parent:null,children:[],pos:F.pos,data:M,title:null,key:R,isStart:[],isEnd:[]};function V(pe,Ke,Ce,ie){return Ke===!1||!Ce?pe:pe.slice(0,Math.ceil(Ce/ie)+1)}function re(pe){var Ke=pe.key,Ce=pe.pos;return(0,D.km)(Ke,Ce)}function $(pe){for(var Ke=String(pe.data.key),Ce=pe;Ce.parent;)Ce=Ce.parent,Ke="".concat(Ce.data.key," > ").concat(Ke);return Ke}var le=l.forwardRef(function(pe,Ke){var Ce=pe.prefixCls,ie=pe.data,X=pe.selectable,q=pe.checkable,ue=pe.expandedKeys,ee=pe.selectedKeys,z=pe.checkedKeys,ne=pe.loadedKeys,ce=pe.loadingKeys,ge=pe.halfCheckedKeys,ke=pe.keyEntities,$e=pe.disabled,ft=pe.dragging,Ne=pe.dragOverNodeKey,Re=pe.dropPosition,xe=pe.motion,Ue=pe.height,ye=pe.itemHeight,it=pe.virtual,rt=pe.scrollWidth,tt=pe.focusable,We=pe.activeItem,ot=pe.focused,_t=pe.tabIndex,St=pe.onKeyDown,gt=pe.onFocus,wt=pe.onBlur,mt=pe.onActiveChange,Ct=pe.onListChangeStart,Ge=pe.onListChangeEnd,he=(0,r.Z)(pe,T),De=l.useRef(null),be=l.useRef(null);l.useImperativeHandle(Ke,function(){return{scrollTo:function(bt){De.current.scrollTo(bt)},getIndentWidth:function(){return be.current.offsetWidth}}});var Ee=l.useState(ue),je=(0,n.Z)(Ee,2),Je=je[0],Qe=je[1],Xe=l.useState(ie),He=(0,n.Z)(Xe,2),Se=He[0],x=He[1],P=l.useState(ie),N=(0,n.Z)(P,2),W=N[0],H=N[1],oe=l.useState([]),se=(0,n.Z)(oe,2),Te=se[0],we=se[1],Ze=l.useState(null),dt=(0,n.Z)(Ze,2),Tt=dt[0],ct=dt[1],Rt=l.useRef(ie);Rt.current=ie;function at(){var lt=Rt.current;x(lt),H(lt),we([]),ct(null),Ge()}(0,v.Z)(function(){Qe(ue);var lt=h(Je,ue);if(lt.key!==null)if(lt.add){var bt=Se.findIndex(function(Pt){var Kt=Pt.key;return Kt===lt.key}),Ot=V(b(Se,ie,lt.key),it,Ue,ye),Nt=Se.slice();Nt.splice(bt+1,0,U),H(Nt),we(Ot),ct("show")}else{var It=ie.findIndex(function(Pt){var Kt=Pt.key;return Kt===lt.key}),ht=V(b(ie,Se,lt.key),it,Ue,ye),Bt=ie.slice();Bt.splice(It+1,0,U),H(Bt),we(ht),ct("hide")}else Se!==ie&&(x(ie),H(ie))},[ue,ie]),l.useEffect(function(){ft||at()},[ft]);var ze=xe?W:ie,st={expandedKeys:ue,selectedKeys:ee,loadedKeys:ne,loadingKeys:ce,checkedKeys:z,halfCheckedKeys:ge,dragOverNodeKey:Ne,dropPosition:Re,keyEntities:ke};return l.createElement(l.Fragment,null,ot&&We&&l.createElement("span",{style:y,"aria-live":"assertive"},$(We)),l.createElement("div",null,l.createElement("input",{style:y,disabled:tt===!1||$e,tabIndex:tt!==!1?_t:null,onKeyDown:St,onFocus:gt,onBlur:wt,value:"",onChange:d,"aria-label":"for screen reader"})),l.createElement("div",{className:"".concat(Ce,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},l.createElement("div",{className:"".concat(Ce,"-indent")},l.createElement("div",{ref:be,className:"".concat(Ce,"-indent-unit")}))),l.createElement(E.Z,(0,Z.Z)({},he,{data:ze,itemKey:re,height:Ue,fullHeight:!1,virtual:it,itemHeight:ye,scrollWidth:rt,prefixCls:"".concat(Ce,"-list"),ref:De,role:"tree",onVisibleChange:function(bt){bt.every(function(Ot){return re(Ot)!==R})&&at()}}),function(lt){var bt=lt.pos,Ot=Object.assign({},(s(lt.data),lt.data)),Nt=lt.title,It=lt.key,ht=lt.isStart,Bt=lt.isEnd,Pt=(0,D.km)(It,bt);delete Ot.key,delete Ot.children;var Kt=(0,D.H8)(Pt,st);return l.createElement(t,(0,Z.Z)({},Ot,Kt,{title:Nt,active:!!We&&It===We.key,pos:bt,data:lt.data,isStart:ht,isEnd:Bt,motion:xe,motionNodes:It===R?Te:null,motionType:Tt,onMotionStart:Ct,onMotionEnd:at,treeNodeRequiredProps:st,onMouseMove:function(){mt(null)}}))}))}),te=le,_e=j(10225),fe=j(17341),me=j(35381),Ae=10,Be=function(pe){(0,B.Z)(Ce,pe);var Ke=(0,e.Z)(Ce);function Ce(){var ie;(0,C.Z)(this,Ce);for(var X=arguments.length,q=new Array(X),ue=0;ue<X;ue++)q[ue]=arguments[ue];return ie=Ke.call.apply(Ke,[this].concat(q)),(0,I.Z)((0,O.Z)(ie),"destroyed",!1),(0,I.Z)((0,O.Z)(ie),"delayedDragEnterLogic",void 0),(0,I.Z)((0,O.Z)(ie),"loadingRetryTimes",{}),(0,I.Z)((0,O.Z)(ie),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,D.w$)()}),(0,I.Z)((0,O.Z)(ie),"dragStartMousePosition",null),(0,I.Z)((0,O.Z)(ie),"dragNodeProps",null),(0,I.Z)((0,O.Z)(ie),"currentMouseOverDroppableNodeKey",null),(0,I.Z)((0,O.Z)(ie),"listRef",l.createRef()),(0,I.Z)((0,O.Z)(ie),"onNodeDragStart",function(ee,z){var ne=ie.state,ce=ne.expandedKeys,ge=ne.keyEntities,ke=ie.props.onDragStart,$e=z.eventKey;ie.dragNodeProps=z,ie.dragStartMousePosition={x:ee.clientX,y:ee.clientY};var ft=(0,_e._5)(ce,$e);ie.setState({draggingNodeKey:$e,dragChildrenKeys:(0,_e.wA)($e,ge),indent:ie.listRef.current.getIndentWidth()}),ie.setExpandedKeys(ft),window.addEventListener("dragend",ie.onWindowDragEnd),ke==null||ke({event:ee,node:(0,D.F)(z)})}),(0,I.Z)((0,O.Z)(ie),"onNodeDragEnter",function(ee,z){var ne=ie.state,ce=ne.expandedKeys,ge=ne.keyEntities,ke=ne.dragChildrenKeys,$e=ne.flattenNodes,ft=ne.indent,Ne=ie.props,Re=Ne.onDragEnter,xe=Ne.onExpand,Ue=Ne.allowDrop,ye=Ne.direction,it=z.pos,rt=z.eventKey;if(ie.currentMouseOverDroppableNodeKey!==rt&&(ie.currentMouseOverDroppableNodeKey=rt),!ie.dragNodeProps){ie.resetDragState();return}var tt=(0,_e.OM)(ee,ie.dragNodeProps,z,ft,ie.dragStartMousePosition,Ue,$e,ge,ce,ye),We=tt.dropPosition,ot=tt.dropLevelOffset,_t=tt.dropTargetKey,St=tt.dropContainerKey,gt=tt.dropTargetPos,wt=tt.dropAllowed,mt=tt.dragOverNodeKey;if(ke.includes(_t)||!wt){ie.resetDragState();return}if(ie.delayedDragEnterLogic||(ie.delayedDragEnterLogic={}),Object.keys(ie.delayedDragEnterLogic).forEach(function(Ct){clearTimeout(ie.delayedDragEnterLogic[Ct])}),ie.dragNodeProps.eventKey!==z.eventKey&&(ee.persist(),ie.delayedDragEnterLogic[it]=window.setTimeout(function(){if(ie.state.draggingNodeKey!==null){var Ct=(0,K.Z)(ce),Ge=(0,me.Z)(ge,z.eventKey);Ge&&(Ge.children||[]).length&&(Ct=(0,_e.L0)(ce,z.eventKey)),ie.props.hasOwnProperty("expandedKeys")||ie.setExpandedKeys(Ct),xe==null||xe(Ct,{node:(0,D.F)(z),expanded:!0,nativeEvent:ee.nativeEvent})}},800)),ie.dragNodeProps.eventKey===_t&&ot===0){ie.resetDragState();return}ie.setState({dragOverNodeKey:mt,dropPosition:We,dropLevelOffset:ot,dropTargetKey:_t,dropContainerKey:St,dropTargetPos:gt,dropAllowed:wt}),Re==null||Re({event:ee,node:(0,D.F)(z),expandedKeys:ce})}),(0,I.Z)((0,O.Z)(ie),"onNodeDragOver",function(ee,z){var ne=ie.state,ce=ne.dragChildrenKeys,ge=ne.flattenNodes,ke=ne.keyEntities,$e=ne.expandedKeys,ft=ne.indent,Ne=ie.props,Re=Ne.onDragOver,xe=Ne.allowDrop,Ue=Ne.direction;if(ie.dragNodeProps){var ye=(0,_e.OM)(ee,ie.dragNodeProps,z,ft,ie.dragStartMousePosition,xe,ge,ke,$e,Ue),it=ye.dropPosition,rt=ye.dropLevelOffset,tt=ye.dropTargetKey,We=ye.dropContainerKey,ot=ye.dropTargetPos,_t=ye.dropAllowed,St=ye.dragOverNodeKey;ce.includes(tt)||!_t||(ie.dragNodeProps.eventKey===tt&&rt===0?ie.state.dropPosition===null&&ie.state.dropLevelOffset===null&&ie.state.dropTargetKey===null&&ie.state.dropContainerKey===null&&ie.state.dropTargetPos===null&&ie.state.dropAllowed===!1&&ie.state.dragOverNodeKey===null||ie.resetDragState():it===ie.state.dropPosition&&rt===ie.state.dropLevelOffset&&tt===ie.state.dropTargetKey&&We===ie.state.dropContainerKey&&ot===ie.state.dropTargetPos&&_t===ie.state.dropAllowed&&St===ie.state.dragOverNodeKey||ie.setState({dropPosition:it,dropLevelOffset:rt,dropTargetKey:tt,dropContainerKey:We,dropTargetPos:ot,dropAllowed:_t,dragOverNodeKey:St}),Re==null||Re({event:ee,node:(0,D.F)(z)}))}}),(0,I.Z)((0,O.Z)(ie),"onNodeDragLeave",function(ee,z){ie.currentMouseOverDroppableNodeKey===z.eventKey&&!ee.currentTarget.contains(ee.relatedTarget)&&(ie.resetDragState(),ie.currentMouseOverDroppableNodeKey=null);var ne=ie.props.onDragLeave;ne==null||ne({event:ee,node:(0,D.F)(z)})}),(0,I.Z)((0,O.Z)(ie),"onWindowDragEnd",function(ee){ie.onNodeDragEnd(ee,null,!0),window.removeEventListener("dragend",ie.onWindowDragEnd)}),(0,I.Z)((0,O.Z)(ie),"onNodeDragEnd",function(ee,z){var ne=ie.props.onDragEnd;ie.setState({dragOverNodeKey:null}),ie.cleanDragState(),ne==null||ne({event:ee,node:(0,D.F)(z)}),ie.dragNodeProps=null,window.removeEventListener("dragend",ie.onWindowDragEnd)}),(0,I.Z)((0,O.Z)(ie),"onNodeDrop",function(ee,z){var ne,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ge=ie.state,ke=ge.dragChildrenKeys,$e=ge.dropPosition,ft=ge.dropTargetKey,Ne=ge.dropTargetPos,Re=ge.dropAllowed;if(Re){var xe=ie.props.onDrop;if(ie.setState({dragOverNodeKey:null}),ie.cleanDragState(),ft!==null){var Ue=(0,Q.Z)((0,Q.Z)({},(0,D.H8)(ft,ie.getTreeNodeRequiredProps())),{},{active:((ne=ie.getActiveItem())===null||ne===void 0?void 0:ne.key)===ft,data:(0,me.Z)(ie.state.keyEntities,ft).node}),ye=ke.includes(ft);(0,m.ZP)(!ye,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var it=(0,_e.yx)(Ne),rt={event:ee,node:(0,D.F)(Ue),dragNode:ie.dragNodeProps?(0,D.F)(ie.dragNodeProps):null,dragNodesKeys:[ie.dragNodeProps.eventKey].concat(ke),dropToGap:$e!==0,dropPosition:$e+Number(it[it.length-1])};ce||xe==null||xe(rt),ie.dragNodeProps=null}}}),(0,I.Z)((0,O.Z)(ie),"cleanDragState",function(){var ee=ie.state.draggingNodeKey;ee!==null&&ie.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),ie.dragStartMousePosition=null,ie.currentMouseOverDroppableNodeKey=null}),(0,I.Z)((0,O.Z)(ie),"triggerExpandActionExpand",function(ee,z){var ne=ie.state,ce=ne.expandedKeys,ge=ne.flattenNodes,ke=z.expanded,$e=z.key,ft=z.isLeaf;if(!(ft||ee.shiftKey||ee.metaKey||ee.ctrlKey)){var Ne=ge.filter(function(xe){return xe.key===$e})[0],Re=(0,D.F)((0,Q.Z)((0,Q.Z)({},(0,D.H8)($e,ie.getTreeNodeRequiredProps())),{},{data:Ne.data}));ie.setExpandedKeys(ke?(0,_e._5)(ce,$e):(0,_e.L0)(ce,$e)),ie.onNodeExpand(ee,Re)}}),(0,I.Z)((0,O.Z)(ie),"onNodeClick",function(ee,z){var ne=ie.props,ce=ne.onClick,ge=ne.expandAction;ge==="click"&&ie.triggerExpandActionExpand(ee,z),ce==null||ce(ee,z)}),(0,I.Z)((0,O.Z)(ie),"onNodeDoubleClick",function(ee,z){var ne=ie.props,ce=ne.onDoubleClick,ge=ne.expandAction;ge==="doubleClick"&&ie.triggerExpandActionExpand(ee,z),ce==null||ce(ee,z)}),(0,I.Z)((0,O.Z)(ie),"onNodeSelect",function(ee,z){var ne=ie.state.selectedKeys,ce=ie.state,ge=ce.keyEntities,ke=ce.fieldNames,$e=ie.props,ft=$e.onSelect,Ne=$e.multiple,Re=z.selected,xe=z[ke.key],Ue=!Re;Ue?Ne?ne=(0,_e.L0)(ne,xe):ne=[xe]:ne=(0,_e._5)(ne,xe);var ye=ne.map(function(it){var rt=(0,me.Z)(ge,it);return rt?rt.node:null}).filter(Boolean);ie.setUncontrolledState({selectedKeys:ne}),ft==null||ft(ne,{event:"select",selected:Ue,node:z,selectedNodes:ye,nativeEvent:ee.nativeEvent})}),(0,I.Z)((0,O.Z)(ie),"onNodeCheck",function(ee,z,ne){var ce=ie.state,ge=ce.keyEntities,ke=ce.checkedKeys,$e=ce.halfCheckedKeys,ft=ie.props,Ne=ft.checkStrictly,Re=ft.onCheck,xe=z.key,Ue,ye={event:"check",node:z,checked:ne,nativeEvent:ee.nativeEvent};if(Ne){var it=ne?(0,_e.L0)(ke,xe):(0,_e._5)(ke,xe),rt=(0,_e._5)($e,xe);Ue={checked:it,halfChecked:rt},ye.checkedNodes=it.map(function(gt){return(0,me.Z)(ge,gt)}).filter(Boolean).map(function(gt){return gt.node}),ie.setUncontrolledState({checkedKeys:it})}else{var tt=(0,fe.S)([].concat((0,K.Z)(ke),[xe]),!0,ge),We=tt.checkedKeys,ot=tt.halfCheckedKeys;if(!ne){var _t=new Set(We);_t.delete(xe);var St=(0,fe.S)(Array.from(_t),{checked:!1,halfCheckedKeys:ot},ge);We=St.checkedKeys,ot=St.halfCheckedKeys}Ue=We,ye.checkedNodes=[],ye.checkedNodesPositions=[],ye.halfCheckedKeys=ot,We.forEach(function(gt){var wt=(0,me.Z)(ge,gt);if(wt){var mt=wt.node,Ct=wt.pos;ye.checkedNodes.push(mt),ye.checkedNodesPositions.push({node:mt,pos:Ct})}}),ie.setUncontrolledState({checkedKeys:We},!1,{halfCheckedKeys:ot})}Re==null||Re(Ue,ye)}),(0,I.Z)((0,O.Z)(ie),"onNodeLoad",function(ee){var z,ne=ee.key,ce=ie.state.keyEntities,ge=(0,me.Z)(ce,ne);if(!(ge!=null&&(z=ge.children)!==null&&z!==void 0&&z.length)){var ke=new Promise(function($e,ft){ie.setState(function(Ne){var Re=Ne.loadedKeys,xe=Re===void 0?[]:Re,Ue=Ne.loadingKeys,ye=Ue===void 0?[]:Ue,it=ie.props,rt=it.loadData,tt=it.onLoad;if(!rt||xe.includes(ne)||ye.includes(ne))return null;var We=rt(ee);return We.then(function(){var ot=ie.state.loadedKeys,_t=(0,_e.L0)(ot,ne);tt==null||tt(_t,{event:"load",node:ee}),ie.setUncontrolledState({loadedKeys:_t}),ie.setState(function(St){return{loadingKeys:(0,_e._5)(St.loadingKeys,ne)}}),$e()}).catch(function(ot){if(ie.setState(function(St){return{loadingKeys:(0,_e._5)(St.loadingKeys,ne)}}),ie.loadingRetryTimes[ne]=(ie.loadingRetryTimes[ne]||0)+1,ie.loadingRetryTimes[ne]>=Ae){var _t=ie.state.loadedKeys;(0,m.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),ie.setUncontrolledState({loadedKeys:(0,_e.L0)(_t,ne)}),$e()}ft(ot)}),{loadingKeys:(0,_e.L0)(ye,ne)}})});return ke.catch(function(){}),ke}}),(0,I.Z)((0,O.Z)(ie),"onNodeMouseEnter",function(ee,z){var ne=ie.props.onMouseEnter;ne==null||ne({event:ee,node:z})}),(0,I.Z)((0,O.Z)(ie),"onNodeMouseLeave",function(ee,z){var ne=ie.props.onMouseLeave;ne==null||ne({event:ee,node:z})}),(0,I.Z)((0,O.Z)(ie),"onNodeContextMenu",function(ee,z){var ne=ie.props.onRightClick;ne&&(ee.preventDefault(),ne({event:ee,node:z}))}),(0,I.Z)((0,O.Z)(ie),"onFocus",function(){var ee=ie.props.onFocus;ie.setState({focused:!0});for(var z=arguments.length,ne=new Array(z),ce=0;ce<z;ce++)ne[ce]=arguments[ce];ee==null||ee.apply(void 0,ne)}),(0,I.Z)((0,O.Z)(ie),"onBlur",function(){var ee=ie.props.onBlur;ie.setState({focused:!1}),ie.onActiveChange(null);for(var z=arguments.length,ne=new Array(z),ce=0;ce<z;ce++)ne[ce]=arguments[ce];ee==null||ee.apply(void 0,ne)}),(0,I.Z)((0,O.Z)(ie),"getTreeNodeRequiredProps",function(){var ee=ie.state,z=ee.expandedKeys,ne=ee.selectedKeys,ce=ee.loadedKeys,ge=ee.loadingKeys,ke=ee.checkedKeys,$e=ee.halfCheckedKeys,ft=ee.dragOverNodeKey,Ne=ee.dropPosition,Re=ee.keyEntities;return{expandedKeys:z||[],selectedKeys:ne||[],loadedKeys:ce||[],loadingKeys:ge||[],checkedKeys:ke||[],halfCheckedKeys:$e||[],dragOverNodeKey:ft,dropPosition:Ne,keyEntities:Re}}),(0,I.Z)((0,O.Z)(ie),"setExpandedKeys",function(ee){var z=ie.state,ne=z.treeData,ce=z.fieldNames,ge=(0,D.oH)(ne,ee,ce);ie.setUncontrolledState({expandedKeys:ee,flattenNodes:ge},!0)}),(0,I.Z)((0,O.Z)(ie),"onNodeExpand",function(ee,z){var ne=ie.state.expandedKeys,ce=ie.state,ge=ce.listChanging,ke=ce.fieldNames,$e=ie.props,ft=$e.onExpand,Ne=$e.loadData,Re=z.expanded,xe=z[ke.key];if(!ge){var Ue=ne.includes(xe),ye=!Re;if((0,m.ZP)(Re&&Ue||!Re&&!Ue,"Expand state not sync with index check"),ne=ye?(0,_e.L0)(ne,xe):(0,_e._5)(ne,xe),ie.setExpandedKeys(ne),ft==null||ft(ne,{node:z,expanded:ye,nativeEvent:ee.nativeEvent}),ye&&Ne){var it=ie.onNodeLoad(z);it&&it.then(function(){var rt=(0,D.oH)(ie.state.treeData,ne,ke);ie.setUncontrolledState({flattenNodes:rt})}).catch(function(){var rt=ie.state.expandedKeys,tt=(0,_e._5)(rt,xe);ie.setExpandedKeys(tt)})}}}),(0,I.Z)((0,O.Z)(ie),"onListChangeStart",function(){ie.setUncontrolledState({listChanging:!0})}),(0,I.Z)((0,O.Z)(ie),"onListChangeEnd",function(){setTimeout(function(){ie.setUncontrolledState({listChanging:!1})})}),(0,I.Z)((0,O.Z)(ie),"onActiveChange",function(ee){var z=ie.state.activeKey,ne=ie.props,ce=ne.onActiveChange,ge=ne.itemScrollOffset,ke=ge===void 0?0:ge;z!==ee&&(ie.setState({activeKey:ee}),ee!==null&&ie.scrollTo({key:ee,offset:ke}),ce==null||ce(ee))}),(0,I.Z)((0,O.Z)(ie),"getActiveItem",function(){var ee=ie.state,z=ee.activeKey,ne=ee.flattenNodes;return z===null?null:ne.find(function(ce){var ge=ce.key;return ge===z})||null}),(0,I.Z)((0,O.Z)(ie),"offsetActiveKey",function(ee){var z=ie.state,ne=z.flattenNodes,ce=z.activeKey,ge=ne.findIndex(function(ft){var Ne=ft.key;return Ne===ce});ge===-1&&ee<0&&(ge=ne.length),ge=(ge+ee+ne.length)%ne.length;var ke=ne[ge];if(ke){var $e=ke.key;ie.onActiveChange($e)}else ie.onActiveChange(null)}),(0,I.Z)((0,O.Z)(ie),"onKeyDown",function(ee){var z=ie.state,ne=z.activeKey,ce=z.expandedKeys,ge=z.checkedKeys,ke=z.fieldNames,$e=ie.props,ft=$e.onKeyDown,Ne=$e.checkable,Re=$e.selectable;switch(ee.which){case p.Z.UP:{ie.offsetActiveKey(-1),ee.preventDefault();break}case p.Z.DOWN:{ie.offsetActiveKey(1),ee.preventDefault();break}}var xe=ie.getActiveItem();if(xe&&xe.data){var Ue=ie.getTreeNodeRequiredProps(),ye=xe.data.isLeaf===!1||!!(xe.data[ke.children]||[]).length,it=(0,D.F)((0,Q.Z)((0,Q.Z)({},(0,D.H8)(ne,Ue)),{},{data:xe.data,active:!0}));switch(ee.which){case p.Z.LEFT:{ye&&ce.includes(ne)?ie.onNodeExpand({},it):xe.parent&&ie.onActiveChange(xe.parent.key),ee.preventDefault();break}case p.Z.RIGHT:{ye&&!ce.includes(ne)?ie.onNodeExpand({},it):xe.children&&xe.children.length&&ie.onActiveChange(xe.children[0].key),ee.preventDefault();break}case p.Z.ENTER:case p.Z.SPACE:{Ne&&!it.disabled&&it.checkable!==!1&&!it.disableCheckbox?ie.onNodeCheck({},it,!ge.includes(ne)):!Ne&&Re&&!it.disabled&&it.selectable!==!1&&ie.onNodeSelect({},it);break}}}ft==null||ft(ee)}),(0,I.Z)((0,O.Z)(ie),"setUncontrolledState",function(ee){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!ie.destroyed){var ce=!1,ge=!0,ke={};Object.keys(ee).forEach(function($e){if(ie.props.hasOwnProperty($e)){ge=!1;return}ce=!0,ke[$e]=ee[$e]}),ce&&(!z||ge)&&ie.setState((0,Q.Z)((0,Q.Z)({},ke),ne))}}),(0,I.Z)((0,O.Z)(ie),"scrollTo",function(ee){ie.listRef.current.scrollTo(ee)}),ie}return(0,k.Z)(Ce,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var X=this.props,q=X.activeKey,ue=X.itemScrollOffset,ee=ue===void 0?0:ue;q!==void 0&&q!==this.state.activeKey&&(this.setState({activeKey:q}),q!==null&&this.scrollTo({key:q,offset:ee}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var X=this.state,q=X.focused,ue=X.flattenNodes,ee=X.keyEntities,z=X.draggingNodeKey,ne=X.activeKey,ce=X.dropLevelOffset,ge=X.dropContainerKey,ke=X.dropTargetKey,$e=X.dropPosition,ft=X.dragOverNodeKey,Ne=X.indent,Re=this.props,xe=Re.prefixCls,Ue=Re.className,ye=Re.style,it=Re.showLine,rt=Re.focusable,tt=Re.tabIndex,We=tt===void 0?0:tt,ot=Re.selectable,_t=Re.showIcon,St=Re.icon,gt=Re.switcherIcon,wt=Re.draggable,mt=Re.checkable,Ct=Re.checkStrictly,Ge=Re.disabled,he=Re.motion,De=Re.loadData,be=Re.filterTreeNode,Ee=Re.height,je=Re.itemHeight,Je=Re.scrollWidth,Qe=Re.virtual,Xe=Re.titleRender,He=Re.dropIndicatorRender,Se=Re.onContextMenu,x=Re.onScroll,P=Re.direction,N=Re.rootClassName,W=Re.rootStyle,H=(0,c.Z)(this.props,{aria:!0,data:!0}),oe;wt&&((0,ae.Z)(wt)==="object"?oe=wt:typeof wt=="function"?oe={nodeDraggable:wt}:oe={});var se={prefixCls:xe,selectable:ot,showIcon:_t,icon:St,switcherIcon:gt,draggable:oe,draggingNodeKey:z,checkable:mt,checkStrictly:Ct,disabled:Ge,keyEntities:ee,dropLevelOffset:ce,dropContainerKey:ge,dropTargetKey:ke,dropPosition:$e,dragOverNodeKey:ft,indent:Ne,direction:P,dropIndicatorRender:He,loadData:De,filterTreeNode:be,titleRender:Xe,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return l.createElement(g.k.Provider,{value:se},l.createElement("div",{className:u()(xe,Ue,N,(0,I.Z)((0,I.Z)((0,I.Z)({},"".concat(xe,"-show-line"),it),"".concat(xe,"-focused"),q),"".concat(xe,"-active-focused"),ne!==null)),style:W},l.createElement(te,(0,Z.Z)({ref:this.listRef,prefixCls:xe,style:ye,data:ue,disabled:Ge,selectable:ot,checkable:!!mt,motion:he,dragging:z!==null,height:Ee,itemHeight:je,virtual:Qe,focusable:rt,focused:q,tabIndex:We,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Se,onScroll:x,scrollWidth:Je},this.getTreeNodeRequiredProps(),H))))}}],[{key:"getDerivedStateFromProps",value:function(X,q){var ue=q.prevProps,ee={prevProps:X};function z(We){return!ue&&X.hasOwnProperty(We)||ue&&ue[We]!==X[We]}var ne,ce=q.fieldNames;if(z("fieldNames")&&(ce=(0,D.w$)(X.fieldNames),ee.fieldNames=ce),z("treeData")?ne=X.treeData:z("children")&&((0,m.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ne=(0,D.zn)(X.children)),ne){ee.treeData=ne;var ge=(0,D.I8)(ne,{fieldNames:ce});ee.keyEntities=(0,Q.Z)((0,I.Z)({},R,F),ge.keyEntities)}var ke=ee.keyEntities||q.keyEntities;if(z("expandedKeys")||ue&&z("autoExpandParent"))ee.expandedKeys=X.autoExpandParent||!ue&&X.defaultExpandParent?(0,_e.r7)(X.expandedKeys,ke):X.expandedKeys;else if(!ue&&X.defaultExpandAll){var $e=(0,Q.Z)({},ke);delete $e[R];var ft=[];Object.keys($e).forEach(function(We){var ot=$e[We];ot.children&&ot.children.length&&ft.push(ot.key)}),ee.expandedKeys=ft}else!ue&&X.defaultExpandedKeys&&(ee.expandedKeys=X.autoExpandParent||X.defaultExpandParent?(0,_e.r7)(X.defaultExpandedKeys,ke):X.defaultExpandedKeys);if(ee.expandedKeys||delete ee.expandedKeys,ne||ee.expandedKeys){var Ne=(0,D.oH)(ne||q.treeData,ee.expandedKeys||q.expandedKeys,ce);ee.flattenNodes=Ne}if(X.selectable&&(z("selectedKeys")?ee.selectedKeys=(0,_e.BT)(X.selectedKeys,X):!ue&&X.defaultSelectedKeys&&(ee.selectedKeys=(0,_e.BT)(X.defaultSelectedKeys,X))),X.checkable){var Re;if(z("checkedKeys")?Re=(0,_e.E6)(X.checkedKeys)||{}:!ue&&X.defaultCheckedKeys?Re=(0,_e.E6)(X.defaultCheckedKeys)||{}:ne&&(Re=(0,_e.E6)(X.checkedKeys)||{checkedKeys:q.checkedKeys,halfCheckedKeys:q.halfCheckedKeys}),Re){var xe=Re,Ue=xe.checkedKeys,ye=Ue===void 0?[]:Ue,it=xe.halfCheckedKeys,rt=it===void 0?[]:it;if(!X.checkStrictly){var tt=(0,fe.S)(ye,!0,ke);ye=tt.checkedKeys,rt=tt.halfCheckedKeys}ee.checkedKeys=ye,ee.halfCheckedKeys=rt}}return z("loadedKeys")&&(ee.loadedKeys=X.loadedKeys),ee}}]),Ce}(l.Component);(0,I.Z)(Be,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:o,allowDrop:function(){return!0},expandAction:!1}),(0,I.Z)(Be,"TreeNode",S.Z);var Le=Be,Ie=Le},10225:function(Et,Fe,j){"use strict";j.d(Fe,{BT:function(){return l},E6:function(){return o},L0:function(){return I},OM:function(){return m},_5:function(){return e},r7:function(){return s},wA:function(){return u},yx:function(){return w}});var Z=j(74902),ae=j(71002),Q=j(80334),K=j(67294),C=j(86128),k=j(35381),O=j(1089),B=null;function e(n,r){if(!n)return[];var v=n.slice(),E=v.indexOf(r);return E>=0&&v.splice(E,1),v}function I(n,r){var v=(n||[]).slice();return v.indexOf(r)===-1&&v.push(r),v}function w(n){return n.split("-")}function u(n,r){var v=[],E=(0,k.Z)(r,n);function f(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.forEach(function(L){var A=L.key,D=L.children;v.push(A),f(D)})}return f(E.children),v}function p(n){if(n.parent){var r=w(n.pos);return Number(r[r.length-1])===n.parent.children.length-1}return!1}function c(n){var r=w(n.pos);return Number(r[r.length-1])===0}function m(n,r,v,E,f,S,L,A,D,a){var i,t=n.clientX,h=n.clientY,b=n.target.getBoundingClientRect(),T=b.top,y=b.height,d=(a==="rtl"?-1:1)*(((f==null?void 0:f.x)||0)-t),R=(d-12)/E,M=D.filter(function(Ie){var pe;return(pe=A[Ie])===null||pe===void 0||(pe=pe.children)===null||pe===void 0?void 0:pe.length}),F=(0,k.Z)(A,v.eventKey);if(h<T+y/2){var U=L.findIndex(function(Ie){return Ie.key===F.key}),V=U<=0?0:U-1,re=L[V].key;F=(0,k.Z)(A,re)}var $=F.key,le=F,te=F.key,_e=0,fe=0;if(!M.includes($))for(var me=0;me<R&&p(F);me+=1)F=F.parent,fe+=1;var Ae=r.data,Be=F.node,Le=!0;return c(F)&&F.level===0&&h<T+y/2&&S({dragNode:Ae,dropNode:Be,dropPosition:-1})&&F.key===v.eventKey?_e=-1:(le.children||[]).length&&M.includes(te)?S({dragNode:Ae,dropNode:Be,dropPosition:0})?_e=0:Le=!1:fe===0?R>-1.5?S({dragNode:Ae,dropNode:Be,dropPosition:1})?_e=1:Le=!1:S({dragNode:Ae,dropNode:Be,dropPosition:0})?_e=0:S({dragNode:Ae,dropNode:Be,dropPosition:1})?_e=1:Le=!1:S({dragNode:Ae,dropNode:Be,dropPosition:1})?_e=1:Le=!1,{dropPosition:_e,dropLevelOffset:fe,dropTargetKey:F.key,dropTargetPos:F.pos,dragOverNodeKey:te,dropContainerKey:_e===0?null:((i=F.parent)===null||i===void 0?void 0:i.key)||null,dropAllowed:Le}}function l(n,r){if(n){var v=r.multiple;return v?n.slice():n.length?[n[0]]:n}}var g=function(r){return r};function _(n,r){if(!n)return[];var v=r||{},E=v.processProps,f=E===void 0?g:E,S=Array.isArray(n)?n:[n];return S.map(function(L){var A=L.children,D=_objectWithoutProperties(L,B),a=_(A,r);return React.createElement(TreeNode,_extends({key:D.key},f(D)),a)})}function o(n){if(!n)return null;var r;if(Array.isArray(n))r={checkedKeys:n,halfCheckedKeys:void 0};else if((0,ae.Z)(n)==="object")r={checkedKeys:n.checked||void 0,halfCheckedKeys:n.halfChecked||void 0};else return(0,Q.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return r}function s(n,r){var v=new Set;function E(f){if(!v.has(f)){var S=(0,k.Z)(r,f);if(S){v.add(f);var L=S.parent,A=S.node;A.disabled||L&&E(L.key)}}}return(n||[]).forEach(function(f){E(f)}),(0,Z.Z)(v)}},17341:function(Et,Fe,j){"use strict";j.d(Fe,{S:function(){return O}});var Z=j(80334),ae=j(35381);function Q(B,e){var I=new Set;return B.forEach(function(w){e.has(w)||I.add(w)}),I}function K(B){var e=B||{},I=e.disabled,w=e.disableCheckbox,u=e.checkable;return!!(I||w)||u===!1}function C(B,e,I,w){for(var u=new Set(B),p=new Set,c=0;c<=I;c+=1){var m=e.get(c)||new Set;m.forEach(function(o){var s=o.key,n=o.node,r=o.children,v=r===void 0?[]:r;u.has(s)&&!w(n)&&v.filter(function(E){return!w(E.node)}).forEach(function(E){u.add(E.key)})})}for(var l=new Set,g=I;g>=0;g-=1){var _=e.get(g)||new Set;_.forEach(function(o){var s=o.parent,n=o.node;if(!(w(n)||!o.parent||l.has(o.parent.key))){if(w(o.parent.node)){l.add(s.key);return}var r=!0,v=!1;(s.children||[]).filter(function(E){return!w(E.node)}).forEach(function(E){var f=E.key,S=u.has(f);r&&!S&&(r=!1),!v&&(S||p.has(f))&&(v=!0)}),r&&u.add(s.key),v&&p.add(s.key),l.add(s.key)}})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(Q(p,u))}}function k(B,e,I,w,u){for(var p=new Set(B),c=new Set(e),m=0;m<=w;m+=1){var l=I.get(m)||new Set;l.forEach(function(s){var n=s.key,r=s.node,v=s.children,E=v===void 0?[]:v;!p.has(n)&&!c.has(n)&&!u(r)&&E.filter(function(f){return!u(f.node)}).forEach(function(f){p.delete(f.key)})})}c=new Set;for(var g=new Set,_=w;_>=0;_-=1){var o=I.get(_)||new Set;o.forEach(function(s){var n=s.parent,r=s.node;if(!(u(r)||!s.parent||g.has(s.parent.key))){if(u(s.parent.node)){g.add(n.key);return}var v=!0,E=!1;(n.children||[]).filter(function(f){return!u(f.node)}).forEach(function(f){var S=f.key,L=p.has(S);v&&!L&&(v=!1),!E&&(L||c.has(S))&&(E=!0)}),v||p.delete(n.key),E&&c.add(n.key),g.add(n.key)}})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Q(c,p))}}function O(B,e,I,w){var u=[],p;w?p=w:p=K;var c=new Set(B.filter(function(_){var o=!!(0,ae.Z)(I,_);return o||u.push(_),o})),m=new Map,l=0;Object.keys(I).forEach(function(_){var o=I[_],s=o.level,n=m.get(s);n||(n=new Set,m.set(s,n)),n.add(o),l=Math.max(l,s)}),(0,Z.ZP)(!u.length,"Tree missing follow keys: ".concat(u.slice(0,100).map(function(_){return"'".concat(_,"'")}).join(", ")));var g;return e===!0?g=C(c,m,l,p):g=k(c,e.halfCheckedKeys,m,l,p),g}},35381:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return Z}});function Z(ae,Q){return ae[Q]}},1089:function(Et,Fe,j){"use strict";j.d(Fe,{F:function(){return s},H8:function(){return o},I8:function(){return _},km:function(){return u},oH:function(){return l},w$:function(){return p},zn:function(){return m}});var Z=j(71002),ae=j(74902),Q=j(1413),K=j(45987),C=j(50344),k=j(98423),O=j(80334),B=j(35381),e=["children"];function I(n,r){return"".concat(n,"-").concat(r)}function w(n){return n&&n.type&&n.type.isTreeNode}function u(n,r){return n!=null?n:r}function p(n){var r=n||{},v=r.title,E=r._title,f=r.key,S=r.children,L=v||"title";return{title:L,_title:E||[L],key:f||"key",children:S||"children"}}function c(n,r){var v=new Map;function E(f){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(f||[]).forEach(function(L){var A=L[r.key],D=L[r.children];warning(A!=null,"Tree node must have a certain key: [".concat(S).concat(A,"]"));var a=String(A);warning(!v.has(a)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(a)),v.set(a,!0),E(D,"".concat(S).concat(a," > "))})}E(n)}function m(n){function r(v){var E=(0,C.Z)(v);return E.map(function(f){if(!w(f))return(0,O.ZP)(!f,"Tree/TreeNode can only accept TreeNode as children."),null;var S=f.key,L=f.props,A=L.children,D=(0,K.Z)(L,e),a=(0,Q.Z)({key:S},D),i=r(A);return i.length&&(a.children=i),a}).filter(function(f){return f})}return r(n)}function l(n,r,v){var E=p(v),f=E._title,S=E.key,L=E.children,A=new Set(r===!0?[]:r),D=[];function a(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(h,b){for(var T=I(t?t.pos:"0",b),y=u(h[S],T),d,R=0;R<f.length;R+=1){var M=f[R];if(h[M]!==void 0){d=h[M];break}}var F=Object.assign((0,k.Z)(h,[].concat((0,ae.Z)(f),[S,L])),{title:d,key:y,parent:t,pos:T,children:null,data:h,isStart:[].concat((0,ae.Z)(t?t.isStart:[]),[b===0]),isEnd:[].concat((0,ae.Z)(t?t.isEnd:[]),[b===i.length-1])});return D.push(F),r===!0||A.has(y)?F.children=a(h[L]||[],F):F.children=[],F})}return a(n),D}function g(n,r,v){var E={};(0,Z.Z)(v)==="object"?E=v:E={externalGetKey:v},E=E||{};var f=E,S=f.childrenPropName,L=f.externalGetKey,A=f.fieldNames,D=p(A),a=D.key,i=D.children,t=S||i,h;L?typeof L=="string"?h=function(y){return y[L]}:typeof L=="function"&&(h=function(y){return L(y)}):h=function(y,d){return u(y[a],d)};function b(T,y,d,R){var M=T?T[t]:n,F=T?I(d.pos,y):"0",U=T?[].concat((0,ae.Z)(R),[T]):[];if(T){var V=h(T,F),re={node:T,index:y,pos:F,key:V,parentPos:d.node?d.pos:null,level:d.level+1,nodes:U};r(re)}M&&M.forEach(function($,le){b($,le,{node:T,pos:F,level:d?d.level+1:-1},U)})}b(null)}function _(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=r.initWrapper,E=r.processEntity,f=r.onProcessFinished,S=r.externalGetKey,L=r.childrenPropName,A=r.fieldNames,D=arguments.length>2?arguments[2]:void 0,a=S||D,i={},t={},h={posEntities:i,keyEntities:t};return v&&(h=v(h)||h),g(n,function(b){var T=b.node,y=b.index,d=b.pos,R=b.key,M=b.parentPos,F=b.level,U=b.nodes,V={node:T,nodes:U,index:y,key:R,pos:d,level:F},re=u(R,d);i[d]=V,t[re]=V,V.parent=i[M],V.parent&&(V.parent.children=V.parent.children||[],V.parent.children.push(V)),E&&E(V,h)},{externalGetKey:a,childrenPropName:L,fieldNames:A}),f&&f(h),h}function o(n,r){var v=r.expandedKeys,E=r.selectedKeys,f=r.loadedKeys,S=r.loadingKeys,L=r.checkedKeys,A=r.halfCheckedKeys,D=r.dragOverNodeKey,a=r.dropPosition,i=r.keyEntities,t=(0,B.Z)(i,n),h={eventKey:n,expanded:v.indexOf(n)!==-1,selected:E.indexOf(n)!==-1,loaded:f.indexOf(n)!==-1,loading:S.indexOf(n)!==-1,checked:L.indexOf(n)!==-1,halfChecked:A.indexOf(n)!==-1,pos:String(t?t.pos:""),dragOver:D===n&&a===0,dragOverGapTop:D===n&&a===-1,dragOverGapBottom:D===n&&a===1};return h}function s(n){var r=n.data,v=n.expanded,E=n.selected,f=n.checked,S=n.loaded,L=n.loading,A=n.halfChecked,D=n.dragOver,a=n.dragOverGapTop,i=n.dragOverGapBottom,t=n.pos,h=n.active,b=n.eventKey,T=(0,Q.Z)((0,Q.Z)({},r),{},{expanded:v,selected:E,checked:f,loaded:S,loading:L,halfChecked:A,dragOver:D,dragOverGapTop:a,dragOverGapBottom:i,pos:t,active:h,key:b});return"props"in T||Object.defineProperty(T,"props",{get:function(){return(0,O.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),n}}),T}},50344:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return Q}});var Z=j(67294),ae=j(59864);function Q(K){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=[];return Z.Children.forEach(K,function(O){O==null&&!C.keepEmpty||(Array.isArray(O)?k=k.concat(Q(O)):(0,ae.isFragment)(O)&&O.props?k=k.concat(Q(O.props.children,C)):k.push(O))}),k}},66680:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return ae}});var Z=j(67294);function ae(Q){var K=Z.useRef();K.current=Q;var C=Z.useCallback(function(){for(var k,O=arguments.length,B=new Array(O),e=0;e<O;e++)B[e]=arguments[e];return(k=K.current)===null||k===void 0?void 0:k.call.apply(k,[K].concat(B))},[]);return C}},21770:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return k}});var Z=j(97685),ae=j(66680),Q=j(8410),K=j(63896);function C(O){return O!==void 0}function k(O,B){var e=B||{},I=e.defaultValue,w=e.value,u=e.onChange,p=e.postState,c=(0,K.Z)(function(){return C(w)?w:C(I)?typeof I=="function"?I():I:typeof O=="function"?O():O}),m=(0,Z.Z)(c,2),l=m[0],g=m[1],_=w!==void 0?w:l,o=p?p(_):_,s=(0,ae.Z)(u),n=(0,K.Z)([_]),r=(0,Z.Z)(n,2),v=r[0],E=r[1];(0,Q.o)(function(){var S=v[0];l!==S&&s(l,S)},[v]),(0,Q.o)(function(){C(w)||g(w)},[w]);var f=(0,ae.Z)(function(S,L){g(S,L),E([_],L)});return[o,f]}},91881:function(Et,Fe,j){"use strict";var Z=j(71002),ae=j(80334);function Q(K,C){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=new Set;function B(e,I){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=O.has(e);if((0,ae.ZP)(!u,"Warning: There may be circular references"),u)return!1;if(e===I)return!0;if(k&&w>1)return!1;O.add(e);var p=w+1;if(Array.isArray(e)){if(!Array.isArray(I)||e.length!==I.length)return!1;for(var c=0;c<e.length;c++)if(!B(e[c],I[c],p))return!1;return!0}if(e&&I&&(0,Z.Z)(e)==="object"&&(0,Z.Z)(I)==="object"){var m=Object.keys(e);return m.length!==Object.keys(I).length?!1:m.every(function(l){return B(e[l],I[l],p)})}return!1}return B(K,C)}Fe.Z=Q},98423:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return ae}});var Z=j(1413);function ae(Q,K){var C=(0,Z.Z)({},Q);return Array.isArray(K)&&K.forEach(function(k){delete C[k]}),C}},80334:function(Et,Fe,j){"use strict";var Z={};function ae(B,e){}function Q(B,e){}function K(){Z={}}function C(B,e,I){!e&&!Z[I]&&(B(!1,I),Z[I]=!0)}function k(B,e){C(ae,B,e)}function O(B,e){C(Q,B,e)}Fe.ZP=k},73299:function(Et,Fe,j){"use strict";j.d(Fe,{Z:function(){return Ge}});var Z=j(87462),ae=j(1413),Q=j(71002),K=j(97685),C=j(4942),k=j(45987),O=j(67294),B=j(73935),e=j(94184),I=j.n(e),w=j(48555),u=O.forwardRef(function(he,De){var be=he.height,Ee=he.offsetY,je=he.offsetX,Je=he.children,Qe=he.prefixCls,Xe=he.onInnerResize,He=he.innerProps,Se=he.rtl,x=he.extra,P={},N={display:"flex",flexDirection:"column"};if(Ee!==void 0){var W;P={height:be,position:"relative",overflow:"hidden"},N=(0,ae.Z)((0,ae.Z)({},N),{},(W={transform:"translateY(".concat(Ee,"px)")},(0,C.Z)(W,Se?"marginRight":"marginLeft",-je),(0,C.Z)(W,"position","absolute"),(0,C.Z)(W,"left",0),(0,C.Z)(W,"right",0),(0,C.Z)(W,"top",0),W))}return O.createElement("div",{style:P},O.createElement(w.Z,{onResize:function(oe){var se=oe.offsetHeight;se&&Xe&&Xe()}},O.createElement("div",(0,Z.Z)({style:N,className:I()((0,C.Z)({},"".concat(Qe,"-holder-inner"),Qe)),ref:De},He),Je,x)))});u.displayName="Filler";var p=u,c=function(De){return+setTimeout(De,16)},m=function(De){return clearTimeout(De)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(c=function(De){return window.requestAnimationFrame(De)},m=function(De){return window.cancelAnimationFrame(De)});var l=0,g=new Map;function _(he){g.delete(he)}var o=function(De){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;l+=1;var Ee=l;function je(Je){if(Je===0)_(Ee),De();else{var Qe=c(function(){je(Je-1)});g.set(Ee,Qe)}}return je(be),Ee};o.cancel=function(he){var De=g.get(he);return _(De),m(De)};var s=o;function n(he,De){var be="touches"in he?he.touches[0]:he;return be[De?"pageX":"pageY"]}var r=O.forwardRef(function(he,De){var be,Ee=he.prefixCls,je=he.rtl,Je=he.scrollOffset,Qe=he.scrollRange,Xe=he.onStartMove,He=he.onStopMove,Se=he.onScroll,x=he.horizontal,P=he.spinSize,N=he.containerSize,W=he.style,H=he.thumbStyle,oe=O.useState(!1),se=(0,K.Z)(oe,2),Te=se[0],we=se[1],Ze=O.useState(null),dt=(0,K.Z)(Ze,2),Tt=dt[0],ct=dt[1],Rt=O.useState(null),at=(0,K.Z)(Rt,2),ze=at[0],st=at[1],lt=!je,bt=O.useRef(),Ot=O.useRef(),Nt=O.useState(!1),It=(0,K.Z)(Nt,2),ht=It[0],Bt=It[1],Pt=O.useRef(),Kt=function(){clearTimeout(Pt.current),Bt(!0),Pt.current=setTimeout(function(){Bt(!1)},3e3)},Wt=Qe-N||0,$t=N-P||0,ir=Wt>0,ar=O.useMemo(function(){if(Je===0||Wt===0)return 0;var Kr=Je/Wt;return Kr*$t},[Je,Wt,$t]),hn=function($r){$r.stopPropagation(),$r.preventDefault()},dn=O.useRef({top:ar,dragging:Te,pageY:Tt,startTop:ze});dn.current={top:ar,dragging:Te,pageY:Tt,startTop:ze};var vr=function($r){we(!0),ct(n($r,x)),st(dn.current.top),Xe(),$r.stopPropagation(),$r.preventDefault()};O.useEffect(function(){var Kr=function($n){$n.preventDefault()},$r=bt.current,Cn=Ot.current;return $r.addEventListener("touchstart",Kr),Cn.addEventListener("touchstart",vr),function(){$r.removeEventListener("touchstart",Kr),Cn.removeEventListener("touchstart",vr)}},[]);var gn=O.useRef();gn.current=Wt;var Rr=O.useRef();Rr.current=$t,O.useEffect(function(){if(Te){var Kr,$r=function($n){var ai=dn.current,gi=ai.dragging,On=ai.pageY,yi=ai.startTop;if(s.cancel(Kr),gi){var Fn=n($n,x)-On,Sn=yi;!lt&&x?Sn-=Fn:Sn+=Fn;var Xn=gn.current,Tn=Rr.current,sn=Tn?Sn/Tn:0,yn=Math.ceil(sn*Xn);yn=Math.max(yn,0),yn=Math.min(yn,Xn),Kr=s(function(){Se(yn,x)})}},Cn=function(){we(!1),He()};return window.addEventListener("mousemove",$r),window.addEventListener("touchmove",$r),window.addEventListener("mouseup",Cn),window.addEventListener("touchend",Cn),function(){window.removeEventListener("mousemove",$r),window.removeEventListener("touchmove",$r),window.removeEventListener("mouseup",Cn),window.removeEventListener("touchend",Cn),s.cancel(Kr)}}},[Te]),O.useEffect(function(){Kt()},[Je]),O.useImperativeHandle(De,function(){return{delayHidden:Kt}});var gr="".concat(Ee,"-scrollbar"),yr={position:"absolute",visibility:ht&&ir?null:"hidden"},vn={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return x?(yr.height=8,yr.left=0,yr.right=0,yr.bottom=0,vn.height="100%",vn.width=P,lt?vn.left=ar:vn.right=ar):(yr.width=8,yr.top=0,yr.bottom=0,lt?yr.right=0:yr.left=0,vn.width="100%",vn.height=P,vn.top=ar),O.createElement("div",{ref:bt,className:I()(gr,(be={},(0,C.Z)(be,"".concat(gr,"-horizontal"),x),(0,C.Z)(be,"".concat(gr,"-vertical"),!x),(0,C.Z)(be,"".concat(gr,"-visible"),ht),be)),style:(0,ae.Z)((0,ae.Z)({},yr),W),onMouseDown:hn,onMouseMove:Kt},O.createElement("div",{ref:Ot,className:I()("".concat(gr,"-thumb"),(0,C.Z)({},"".concat(gr,"-thumb-moving"),Te)),style:(0,ae.Z)((0,ae.Z)({},vn),H),onMouseDown:vr}))}),v=r;function E(he){var De=he.children,be=he.setRef,Ee=O.useCallback(function(je){be(je)},[]);return O.cloneElement(De,{ref:Ee})}function f(he,De,be,Ee,je,Je,Qe){var Xe=Qe.getKey;return he.slice(De,be+1).map(function(He,Se){var x=De+Se,P=Je(He,x,{style:{width:Ee}}),N=Xe(He);return O.createElement(E,{key:N,setRef:function(H){return je(He,H)}},P)})}function S(he){return he instanceof HTMLElement||he instanceof SVGElement}function L(he){return S(he)?he:he instanceof O.Component?B.findDOMNode(he):null}var A=j(15671),D=j(43144),a=function(){function he(){(0,A.Z)(this,he),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,D.Z)(he,[{key:"set",value:function(be,Ee){this.maps[be]=Ee,this.id+=1}},{key:"get",value:function(be){return this.maps[be]}}]),he}(),i=a;function t(he,De,be){var Ee=O.useState(0),je=(0,K.Z)(Ee,2),Je=je[0],Qe=je[1],Xe=(0,O.useRef)(new Map),He=(0,O.useRef)(new i),Se=(0,O.useRef)();function x(){s.cancel(Se.current)}function P(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;x();var H=function(){Xe.current.forEach(function(se,Te){if(se&&se.offsetParent){var we=L(se),Ze=we.offsetHeight;He.current.get(Te)!==Ze&&He.current.set(Te,we.offsetHeight)}}),Qe(function(se){return se+1})};W?H():Se.current=s(H)}function N(W,H){var oe=he(W),se=Xe.current.get(oe);H?(Xe.current.set(oe,H),P()):Xe.current.delete(oe),!se!=!H&&(H?De==null||De(W):be==null||be(W))}return(0,O.useEffect)(function(){return x},[]),[N,P,He.current,Je]}function h(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var b=h()?O.useLayoutEffect:O.useEffect,T=function(De,be){var Ee=O.useRef(!0);b(function(){return De(Ee.current)},be),b(function(){return Ee.current=!1,function(){Ee.current=!0}},[])},y=function(De,be){T(function(Ee){if(!Ee)return De()},be)},d=T;function R(he){var De=O.useRef();De.current=he;var be=O.useCallback(function(){for(var Ee,je=arguments.length,Je=new Array(je),Qe=0;Qe<je;Qe++)Je[Qe]=arguments[Qe];return(Ee=De.current)===null||Ee===void 0?void 0:Ee.call.apply(Ee,[De].concat(Je))},[]);return be}function M(he){var De=React.useRef(!1),be=React.useState(he),Ee=_slicedToArray(be,2),je=Ee[0],Je=Ee[1];React.useEffect(function(){return De.current=!1,function(){De.current=!0}},[]);function Qe(Xe,He){He&&De.current||Je(Xe)}return[je,Qe]}function F(he){return he!==void 0}function U(he,De){var be=De||{},Ee=be.defaultValue,je=be.value,Je=be.onChange,Qe=be.postState,Xe=useState(function(){return F(je)?je:F(Ee)?typeof Ee=="function"?Ee():Ee:typeof he=="function"?he():he}),He=_slicedToArray(Xe,2),Se=He[0],x=He[1],P=je!==void 0?je:Se,N=Qe?Qe(P):P,W=useEvent(Je),H=useState([P]),oe=_slicedToArray(H,2),se=oe[0],Te=oe[1];useLayoutUpdateEffect(function(){var Ze=se[0];Se!==Ze&&W(Se,Ze)},[se]),useLayoutUpdateEffect(function(){F(je)||x(je)},[je]);var we=useEvent(function(Ze,dt){x(Ze,dt),Te([P],dt)});return[N,we]}var V=j(31461);function re(he,De,be){var Ee=React.useRef({});return(!("value"in Ee.current)||be(Ee.current.condition,De))&&(Ee.current.value=he(),Ee.current.condition=De),Ee.current.value}function $(he,De){typeof he=="function"?he(De):_typeof(he)==="object"&&he&&"current"in he&&(he.current=De)}function le(){for(var he=arguments.length,De=new Array(he),be=0;be<he;be++)De[be]=arguments[be];var Ee=De.filter(function(je){return je});return Ee.length<=1?Ee[0]:function(je){De.forEach(function(Je){$(Je,je)})}}function te(){for(var he=arguments.length,De=new Array(he),be=0;be<he;be++)De[be]=arguments[be];return useMemo(function(){return le.apply(void 0,De)},De,function(Ee,je){return Ee.length!==je.length||Ee.every(function(Je,Qe){return Je!==je[Qe]})})}function _e(he){var De,be,Ee=isMemo(he)?he.type.type:he.type;return!(typeof Ee=="function"&&!((De=Ee.prototype)!==null&&De!==void 0&&De.render)||typeof he=="function"&&!((be=he.prototype)!==null&&be!==void 0&&be.render))}function fe(he){return!isValidElement(he)||isFragment(he)?!1:_e(he)}function me(he,De,be,Ee){if(!De.length)return be;var je=_toArray(De),Je=je[0],Qe=je.slice(1),Xe;return!he&&typeof Je=="number"?Xe=[]:Array.isArray(he)?Xe=_toConsumableArray(he):Xe=_objectSpread({},he),Ee&&be===void 0&&Qe.length===1?delete Xe[Je][Qe[0]]:Xe[Je]=me(Xe[Je],Qe,be,Ee),Xe}function Ae(he,De,be){var Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return De.length&&Ee&&be===void 0&&!get(he,De.slice(0,-1))?he:me(he,De,be,Ee)}function Be(he){return _typeof(he)==="object"&&he!==null&&Object.getPrototypeOf(he)===Object.prototype}function Le(he){return Array.isArray(he)?[]:{}}var Ie=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function pe(){for(var he=arguments.length,De=new Array(he),be=0;be<he;be++)De[be]=arguments[be];var Ee=Le(De[0]);return De.forEach(function(je){function Je(Qe,Xe){var He=new Set(Xe),Se=get(je,Qe),x=Array.isArray(Se);if(x||Be(Se)){if(!He.has(Se)){He.add(Se);var P=get(Ee,Qe);x?Ee=Ae(Ee,Qe,[]):(!P||_typeof(P)!=="object")&&(Ee=Ae(Ee,Qe,Le(Se))),Ie(Se).forEach(function(N){Je([].concat(_toConsumableArray(Qe),[N]),He)})}}else Ee=Ae(Ee,Qe,Se)}Je([])}),Ee}var Ke={},Ce=[],ie=function(De){Ce.push(De)};function X(he,De){if(0)var be}function q(he,De){if(0)var be}function ue(){Ke={}}function ee(he,De,be){!De&&!Ke[be]&&(he(!1,be),Ke[be]=!0)}function z(he,De){ee(X,he,De)}function ne(he,De){ee(q,he,De)}z.preMessage=ie,z.resetWarned=ue,z.noteOnce=ne;var ce=null,ge=10;function ke(he,De,be,Ee,je,Je,Qe,Xe){var He=O.useRef(),Se=O.useState(null),x=(0,K.Z)(Se,2),P=x[0],N=x[1];return d(function(){if(P&&P.times<ge){if(!he.current){N(function(Kt){return(0,ae.Z)({},Kt)});return}Je();var W=P.targetAlign,H=P.originAlign,oe=P.index,se=P.offset,Te=he.current.clientHeight,we=!1,Ze=W,dt=null;if(Te){for(var Tt=W||H,ct=0,Rt=0,at=0,ze=Math.min(De.length-1,oe),st=0;st<=ze;st+=1){var lt=je(De[st]);Rt=ct;var bt=be.get(lt);at=Rt+(bt===void 0?Ee:bt),ct=at}for(var Ot=Tt==="top"?se:Te-se,Nt=ze;Nt>=0;Nt-=1){var It=je(De[Nt]),ht=be.get(It);if(ht===void 0){we=!0;break}if(Ot-=ht,Ot<=0)break}switch(Tt){case"top":dt=Rt-se;break;case"bottom":dt=at-Te+se;break;default:{var Bt=he.current.scrollTop,Pt=Bt+Te;Rt<Bt?Ze="top":at>Pt&&(Ze="bottom")}}dt!==null&&Qe(dt),dt!==P.lastTop&&(we=!0)}we&&N(function(Kt){return(0,ae.Z)((0,ae.Z)({},Kt),{},{times:Kt.times+1,targetAlign:Ze,lastTop:dt})})}},[P,he.current]),function(W){if(W==null){Xe();return}if(s.cancel(He.current),typeof W=="number")Qe(W);else if(W&&(0,Q.Z)(W)==="object"){var H,oe=W.align;"index"in W?H=W.index:H=De.findIndex(function(we){return je(we)===W.key});var se=W.offset,Te=se===void 0?0:se;N({times:0,index:H,offset:Te,originAlign:oe})}}}function $e(he,De,be,Ee){var je=be-he,Je=De-be,Qe=Math.min(je,Je)*2;if(Ee<=Qe){var Xe=Math.floor(Ee/2);return Ee%2?be+Xe+1:be-Xe}return je>Je?be-(Ee-Je):be+(Ee-je)}function ft(he,De,be){var Ee=he.length,je=De.length,Je,Qe;if(Ee===0&&je===0)return null;Ee<je?(Je=he,Qe=De):(Je=De,Qe=he);var Xe={__EMPTY_ITEM__:!0};function He(H){return H!==void 0?be(H):Xe}for(var Se=null,x=Math.abs(Ee-je)!==1,P=0;P<Qe.length;P+=1){var N=He(Je[P]),W=He(Qe[P]);if(N!==W){Se=P,x=x||N!==He(Qe[P+1]);break}}return Se===null?null:{index:Se,multiple:x}}function Ne(he,De,be){var Ee=O.useState(he),je=(0,K.Z)(Ee,2),Je=je[0],Qe=je[1],Xe=O.useState(null),He=(0,K.Z)(Xe,2),Se=He[0],x=He[1];return O.useEffect(function(){var P=ft(Je||[],he||[],De);(P==null?void 0:P.index)!==void 0&&(be==null||be(P.index),x(he[P.index])),Qe(he)},[he]),[Se]}var Re=(typeof navigator=="undefined"?"undefined":(0,Q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),xe=Re,Ue=function(he,De){var be=(0,O.useRef)(!1),Ee=(0,O.useRef)(null);function je(){clearTimeout(Ee.current),be.current=!0,Ee.current=setTimeout(function(){be.current=!1},50)}var Je=(0,O.useRef)({top:he,bottom:De});return Je.current.top=he,Je.current.bottom=De,function(Qe){var Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=Qe<0&&Je.current.top||Qe>0&&Je.current.bottom;return Xe&&He?(clearTimeout(Ee.current),be.current=!1):(!He||be.current)&&je(),!be.current&&He}};function ye(he,De,be,Ee,je){var Je=(0,O.useRef)(0),Qe=(0,O.useRef)(null),Xe=(0,O.useRef)(null),He=(0,O.useRef)(!1),Se=Ue(De,be);function x(se,Te){s.cancel(Qe.current),Je.current+=Te,Xe.current=Te,!Se(Te)&&(xe||se.preventDefault(),Qe.current=s(function(){var we=He.current?10:1;je(Je.current*we),Je.current=0}))}function P(se,Te){je(Te,!0),xe||se.preventDefault()}var N=(0,O.useRef)(null),W=(0,O.useRef)(null);function H(se){if(he){s.cancel(W.current),W.current=s(function(){N.current=null},2);var Te=se.deltaX,we=se.deltaY,Ze=se.shiftKey,dt=Te,Tt=we;(N.current==="sx"||!N.current&&Ze&&we&&!Te)&&(dt=we,Tt=0,N.current="sx");var ct=Math.abs(dt),Rt=Math.abs(Tt);N.current===null&&(N.current=Ee&&ct>Rt?"x":"y"),N.current==="y"?x(se,Tt):P(se,dt)}}function oe(se){he&&(He.current=se.detail===Xe.current)}return[H,oe]}var it=14/15;function rt(he,De,be){var Ee=(0,O.useRef)(!1),je=(0,O.useRef)(0),Je=(0,O.useRef)(null),Qe=(0,O.useRef)(null),Xe,He=function(N){if(Ee.current){var W=Math.ceil(N.touches[0].pageY),H=je.current-W;je.current=W,be(H)&&N.preventDefault(),clearInterval(Qe.current),Qe.current=setInterval(function(){H*=it,(!be(H,!0)||Math.abs(H)<=.1)&&clearInterval(Qe.current)},16)}},Se=function(){Ee.current=!1,Xe()},x=function(N){Xe(),N.touches.length===1&&!Ee.current&&(Ee.current=!0,je.current=Math.ceil(N.touches[0].pageY),Je.current=N.target,Je.current.addEventListener("touchmove",He),Je.current.addEventListener("touchend",Se))};Xe=function(){Je.current&&(Je.current.removeEventListener("touchmove",He),Je.current.removeEventListener("touchend",Se))},d(function(){return he&&De.current.addEventListener("touchstart",x),function(){var P;(P=De.current)===null||P===void 0||P.removeEventListener("touchstart",x),Xe(),clearInterval(Qe.current)}},[he])}var tt=20;function We(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,be=he/De*100;return isNaN(be)&&(be=0),be=Math.max(be,tt),be=Math.min(be,he/2),Math.floor(be)}function ot(he,De,be,Ee){var je=O.useMemo(function(){return[new Map,[]]},[he,be.id,Ee]),Je=(0,K.Z)(je,2),Qe=Je[0],Xe=Je[1],He=function(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x,N=Qe.get(x),W=Qe.get(P);if(N===void 0||W===void 0)for(var H=he.length,oe=Xe.length;oe<H;oe+=1){var se,Te=he[oe],we=De(Te);Qe.set(we,oe);var Ze=(se=be.get(we))!==null&&se!==void 0?se:Ee;if(Xe[oe]=(Xe[oe-1]||0)+Ze,we===x&&(N=oe),we===P&&(W=oe),N!==void 0&&W!==void 0)break}return{top:Xe[N-1]||0,bottom:Xe[W]}};return He}var _t=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],St=[],gt={overflowY:"auto",overflowAnchor:"none"};function wt(he,De){var be=he.prefixCls,Ee=be===void 0?"rc-virtual-list":be,je=he.className,Je=he.height,Qe=he.itemHeight,Xe=he.fullHeight,He=Xe===void 0?!0:Xe,Se=he.style,x=he.data,P=he.children,N=he.itemKey,W=he.virtual,H=he.direction,oe=he.scrollWidth,se=he.component,Te=se===void 0?"div":se,we=he.onScroll,Ze=he.onVirtualScroll,dt=he.onVisibleChange,Tt=he.innerProps,ct=he.extraRender,Rt=he.styles,at=(0,k.Z)(he,_t),ze=!!(W!==!1&&Je&&Qe),st=ze&&x&&(Qe*x.length>Je||!!oe),lt=H==="rtl",bt=I()(Ee,(0,C.Z)({},"".concat(Ee,"-rtl"),lt),je),Ot=x||St,Nt=(0,O.useRef)(),It=(0,O.useRef)(),ht=(0,O.useState)(0),Bt=(0,K.Z)(ht,2),Pt=Bt[0],Kt=Bt[1],Wt=(0,O.useState)(0),$t=(0,K.Z)(Wt,2),ir=$t[0],ar=$t[1],hn=(0,O.useState)(!1),dn=(0,K.Z)(hn,2),vr=dn[0],gn=dn[1],Rr=function(){gn(!0)},gr=function(){gn(!1)},yr=O.useCallback(function(pt){return typeof N=="function"?N(pt):pt==null?void 0:pt[N]},[N]),vn={getKey:yr};function Kr(pt){Kt(function(vt){var At;typeof pt=="function"?At=pt(vt):At=pt;var Dt=et(At);return Nt.current.scrollTop=Dt,Dt})}var $r=(0,O.useRef)({start:0,end:Ot.length}),Cn=(0,O.useRef)(),ii=Ne(Ot,yr),$n=(0,K.Z)(ii,1),ai=$n[0];Cn.current=ai;var gi=t(yr,null,null),On=(0,K.Z)(gi,4),yi=On[0],Fn=On[1],Sn=On[2],Xn=On[3],Tn=O.useMemo(function(){if(!ze)return{scrollHeight:void 0,start:0,end:Ot.length-1,offset:void 0};if(!st){var pt;return{scrollHeight:((pt=It.current)===null||pt===void 0?void 0:pt.offsetHeight)||0,start:0,end:Ot.length-1,offset:void 0}}for(var vt=0,At,Dt,Ut,tr=Ot.length,Ht=0;Ht<tr;Ht+=1){var or=Ot[Ht],er=yr(or),Xt=Sn.get(er),lr=vt+(Xt===void 0?Qe:Xt);lr>=Pt&&At===void 0&&(At=Ht,Dt=vt),lr>Pt+Je&&Ut===void 0&&(Ut=Ht),vt=lr}return At===void 0&&(At=0,Dt=0,Ut=Math.ceil(Je/Qe)),Ut===void 0&&(Ut=Ot.length-1),Ut=Math.min(Ut+1,Ot.length-1),{scrollHeight:vt,start:At,end:Ut,offset:Dt}},[st,ze,Pt,Ot,Xn,Je]),sn=Tn.scrollHeight,yn=Tn.start,Bn=Tn.end,fi=Tn.offset;$r.current.start=yn,$r.current.end=Bn;var Ri=O.useState({width:0,height:Je}),pn=(0,K.Z)(Ri,2),en=pn[0],Ni=pn[1],si=function(vt){Ni({width:vt.width||vt.offsetWidth,height:vt.height||vt.offsetHeight})},Di=(0,O.useRef)(),de=(0,O.useRef)(),Me=O.useMemo(function(){return We(en.width,oe)},[en.width,oe]),Ve=O.useMemo(function(){return We(en.height,sn)},[en.height,sn]),Oe=sn-Je,qe=(0,O.useRef)(Oe);qe.current=Oe;function et(pt){var vt=pt;return Number.isNaN(qe.current)||(vt=Math.min(vt,qe.current)),vt=Math.max(vt,0),vt}var ut=Pt<=0,Lt=Pt>=Oe,Gt=Ue(ut,Lt),Ft=function(){return{x:lt?-ir:ir,y:Pt}},Jt=(0,O.useRef)(Ft()),Vt=R(function(){if(Ze){var pt=Ft();(Jt.current.x!==pt.x||Jt.current.y!==pt.y)&&(Ze(pt),Jt.current=pt)}});function Qt(pt,vt){var At=pt;vt?((0,B.flushSync)(function(){ar(At)}),Vt()):Kr(At)}function sr(pt){var vt=pt.currentTarget.scrollTop;vt!==Pt&&Kr(vt),we==null||we(pt),Vt()}var zt=function(vt){var At=vt,Dt=oe-en.width;return At=Math.max(At,0),At=Math.min(At,Dt),At},fr=R(function(pt,vt){vt?((0,B.flushSync)(function(){ar(function(At){var Dt=At+(lt?-pt:pt);return zt(Dt)})}),Vt()):Kr(function(At){var Dt=At+pt;return Dt})}),qt=ye(ze,ut,Lt,!!oe,fr),G=(0,K.Z)(qt,2),J=G[0],Y=G[1];rt(ze,Nt,function(pt,vt){return Gt(pt,vt)?!1:(J({preventDefault:function(){},deltaY:pt}),!0)}),d(function(){function pt(At){ze&&At.preventDefault()}var vt=Nt.current;return vt.addEventListener("wheel",J),vt.addEventListener("DOMMouseScroll",Y),vt.addEventListener("MozMousePixelScroll",pt),function(){vt.removeEventListener("wheel",J),vt.removeEventListener("DOMMouseScroll",Y),vt.removeEventListener("MozMousePixelScroll",pt)}},[ze]),d(function(){oe&&ar(function(pt){return zt(pt)})},[en.width,oe]);var ve=function(){var vt,At;(vt=Di.current)===null||vt===void 0||vt.delayHidden(),(At=de.current)===null||At===void 0||At.delayHidden()},Pe=ke(Nt,Ot,Sn,Qe,yr,function(){return Fn(!0)},Kr,ve);O.useImperativeHandle(De,function(){return{getScrollInfo:Ft,scrollTo:function(vt){function At(Dt){return Dt&&(0,Q.Z)(Dt)==="object"&&("left"in Dt||"top"in Dt)}At(vt)?(vt.left!==void 0&&ar(zt(vt.left)),Pe(vt.top)):Pe(vt)}}}),d(function(){if(dt){var pt=Ot.slice(yn,Bn+1);dt(pt,Ot)}},[yn,Bn,Ot]);var Ye=ot(Ot,yr,Sn,Qe),nt=ct==null?void 0:ct({start:yn,end:Bn,virtual:st,offsetX:ir,offsetY:fi,rtl:lt,getSize:Ye}),xt=f(Ot,yn,Bn,oe,yi,P,vn),yt=null;Je&&(yt=(0,ae.Z)((0,C.Z)({},He?"height":"maxHeight",Je),gt),ze&&(yt.overflowY="hidden",oe&&(yt.overflowX="hidden"),vr&&(yt.pointerEvents="none")));var kt={};return lt&&(kt.dir="rtl"),O.createElement("div",(0,Z.Z)({style:(0,ae.Z)((0,ae.Z)({},Se),{},{position:"relative"}),className:bt},kt,at),O.createElement(w.Z,{onResize:si},O.createElement(Te,{className:"".concat(Ee,"-holder"),style:yt,ref:Nt,onScroll:sr,onMouseEnter:ve},O.createElement(p,{prefixCls:Ee,height:sn,offsetX:ir,offsetY:fi,scrollWidth:oe,onInnerResize:Fn,ref:It,innerProps:Tt,rtl:lt,extra:nt},xt))),st&&sn>Je&&O.createElement(v,{ref:Di,prefixCls:Ee,scrollOffset:Pt,scrollRange:sn,rtl:lt,onScroll:Qt,onStartMove:Rr,onStopMove:gr,spinSize:Ve,containerSize:en.height,style:Rt==null?void 0:Rt.verticalScrollBar,thumbStyle:Rt==null?void 0:Rt.verticalScrollBarThumb}),st&&oe&&O.createElement(v,{ref:de,prefixCls:Ee,scrollOffset:ir,scrollRange:oe,rtl:lt,onScroll:Qt,onStartMove:Rr,onStopMove:gr,spinSize:Me,containerSize:en.width,horizontal:!0,style:Rt==null?void 0:Rt.horizontalScrollBar,thumbStyle:Rt==null?void 0:Rt.horizontalScrollBarThumb}))}var mt=O.forwardRef(wt);mt.displayName="List";var Ct=mt,Ge=Ct},66392:function(Et,Fe){"use strict";var j;var Z=Symbol.for("react.element"),ae=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),O=Symbol.for("react.context"),B=Symbol.for("react.server_context"),e=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function l(g){if(typeof g=="object"&&g!==null){var _=g.$$typeof;switch(_){case Z:switch(g=g.type,g){case Q:case C:case K:case I:case w:return g;default:switch(g=g&&g.$$typeof,g){case B:case O:case e:case p:case u:case k:return g;default:return _}}case ae:return _}}}j=O,j=k,j=Z,j=e,j=Q,j=p,j=u,j=ae,j=C,j=K,j=I,j=w,j=function(){return!1},j=function(){return!1},j=function(g){return l(g)===O},j=function(g){return l(g)===k},j=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===Z},j=function(g){return l(g)===e},j=function(g){return l(g)===Q},j=function(g){return l(g)===p},j=function(g){return l(g)===u},j=function(g){return l(g)===ae},j=function(g){return l(g)===C},j=function(g){return l(g)===K},j=function(g){return l(g)===I},j=function(g){return l(g)===w},j=function(g){return typeof g=="string"||typeof g=="function"||g===Q||g===C||g===K||g===I||g===w||g===c||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===u||g.$$typeof===k||g.$$typeof===O||g.$$typeof===e||g.$$typeof===m||g.getModuleId!==void 0)},j=l},31461:function(Et,Fe,j){"use strict";j(66392)},74300:function(Et,Fe,j){"use strict";Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.CopyToClipboard=void 0;var Z=Q(j(67294)),ae=Q(j(20640));function Q(o){return o&&o.__esModule?o:{default:o}}function K(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?K=function(n){return typeof n}:K=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},K(o)}function C(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);s&&(r=r.filter(function(v){return Object.getOwnPropertyDescriptor(o,v).enumerable})),n.push.apply(n,r)}return n}function k(o){for(var s=1;s<arguments.length;s++){var n=arguments[s]!=null?arguments[s]:{};s%2?C(n,!0).forEach(function(r){g(o,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):C(n).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(n,r))})}return o}function O(o,s){if(o==null)return{};var n=B(o,s),r,v;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(o);for(v=0;v<E.length;v++)r=E[v],!(s.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(o,r)&&(n[r]=o[r])}return n}function B(o,s){if(o==null)return{};var n={},r=Object.keys(o),v,E;for(E=0;E<r.length;E++)v=r[E],!(s.indexOf(v)>=0)&&(n[v]=o[v]);return n}function e(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function I(o,s){for(var n=0;n<s.length;n++){var r=s[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function w(o,s,n){return s&&I(o.prototype,s),n&&I(o,n),o}function u(o,s){return s&&(K(s)==="object"||typeof s=="function")?s:c(o)}function p(o){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},p(o)}function c(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function m(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),s&&l(o,s)}function l(o,s){return l=Object.setPrototypeOf||function(r,v){return r.__proto__=v,r},l(o,s)}function g(o,s,n){return s in o?Object.defineProperty(o,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[s]=n,o}var _=function(o){m(s,o);function s(){var n,r;e(this,s);for(var v=arguments.length,E=new Array(v),f=0;f<v;f++)E[f]=arguments[f];return r=u(this,(n=p(s)).call.apply(n,[this].concat(E))),g(c(r),"onClick",function(S){var L=r.props,A=L.text,D=L.onCopy,a=L.children,i=L.options,t=Z.default.Children.only(a),h=(0,ae.default)(A,i);D&&D(A,h),t&&t.props&&typeof t.props.onClick=="function"&&t.props.onClick(S)}),r}return w(s,[{key:"render",value:function(){var r=this.props,v=r.text,E=r.onCopy,f=r.options,S=r.children,L=O(r,["text","onCopy","options","children"]),A=Z.default.Children.only(S);return Z.default.cloneElement(A,k({},L,{onClick:this.onClick}))}}]),s}(Z.default.PureComponent);Fe.CopyToClipboard=_,g(_,"defaultProps",{onCopy:void 0,options:void 0})},74855:function(Et,Fe,j){"use strict";var Z=j(74300),ae=Z.CopyToClipboard;ae.CopyToClipboard=ae,Et.exports=ae},91033:function(Et,Fe,j){"use strict";var Z=function(){if(typeof Map!="undefined")return Map;function a(i,t){var h=-1;return i.some(function(b,T){return b[0]===t?(h=T,!0):!1}),h}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(t){var h=a(this.__entries__,t),b=this.__entries__[h];return b&&b[1]},i.prototype.set=function(t,h){var b=a(this.__entries__,t);~b?this.__entries__[b][1]=h:this.__entries__.push([t,h])},i.prototype.delete=function(t){var h=this.__entries__,b=a(h,t);~b&&h.splice(b,1)},i.prototype.has=function(t){return!!~a(this.__entries__,t)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(t,h){h===void 0&&(h=null);for(var b=0,T=this.__entries__;b<T.length;b++){var y=T[b];t.call(h,y[1],y[0])}},i}()}(),ae=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Q=function(){return typeof j.g!="undefined"&&j.g.Math===Math?j.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),K=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Q):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),C=2;function k(a,i){var t=!1,h=!1,b=0;function T(){t&&(t=!1,a()),h&&d()}function y(){K(T)}function d(){var R=Date.now();if(t){if(R-b<C)return;h=!0}else t=!0,h=!1,setTimeout(y,i);b=R}return d}var O=20,B=["top","right","bottom","left","width","height","size","weight"],e=typeof MutationObserver!="undefined",I=function(){function a(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=k(this.refresh.bind(this),O)}return a.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},a.prototype.removeObserver=function(i){var t=this.observers_,h=t.indexOf(i);~h&&t.splice(h,1),!t.length&&this.connected_&&this.disconnect_()},a.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},a.prototype.updateObservers_=function(){var i=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return i.forEach(function(t){return t.broadcastActive()}),i.length>0},a.prototype.connect_=function(){!ae||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},a.prototype.disconnect_=function(){!ae||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},a.prototype.onTransitionEnd_=function(i){var t=i.propertyName,h=t===void 0?"":t,b=B.some(function(T){return!!~h.indexOf(T)});b&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),w=function(a,i){for(var t=0,h=Object.keys(i);t<h.length;t++){var b=h[t];Object.defineProperty(a,b,{value:i[b],enumerable:!1,writable:!1,configurable:!0})}return a},u=function(a){var i=a&&a.ownerDocument&&a.ownerDocument.defaultView;return i||Q},p=v(0,0,0,0);function c(a){return parseFloat(a)||0}function m(a){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(h,b){var T=a["border-"+b+"-width"];return h+c(T)},0)}function l(a){for(var i=["top","right","bottom","left"],t={},h=0,b=i;h<b.length;h++){var T=b[h],y=a["padding-"+T];t[T]=c(y)}return t}function g(a){var i=a.getBBox();return v(0,0,i.width,i.height)}function _(a){var i=a.clientWidth,t=a.clientHeight;if(!i&&!t)return p;var h=u(a).getComputedStyle(a),b=l(h),T=b.left+b.right,y=b.top+b.bottom,d=c(h.width),R=c(h.height);if(h.boxSizing==="border-box"&&(Math.round(d+T)!==i&&(d-=m(h,"left","right")+T),Math.round(R+y)!==t&&(R-=m(h,"top","bottom")+y)),!s(a)){var M=Math.round(d+T)-i,F=Math.round(R+y)-t;Math.abs(M)!==1&&(d-=M),Math.abs(F)!==1&&(R-=F)}return v(b.left,b.top,d,R)}var o=function(){return typeof SVGGraphicsElement!="undefined"?function(a){return a instanceof u(a).SVGGraphicsElement}:function(a){return a instanceof u(a).SVGElement&&typeof a.getBBox=="function"}}();function s(a){return a===u(a).document.documentElement}function n(a){return ae?o(a)?g(a):_(a):p}function r(a){var i=a.x,t=a.y,h=a.width,b=a.height,T=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,y=Object.create(T.prototype);return w(y,{x:i,y:t,width:h,height:b,top:t,right:i+h,bottom:b+t,left:i}),y}function v(a,i,t,h){return{x:a,y:i,width:t,height:h}}var E=function(){function a(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=i}return a.prototype.isActive=function(){var i=n(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},a}(),f=function(){function a(i,t){var h=r(t);w(this,{target:i,contentRect:h})}return a}(),S=function(){function a(i,t,h){if(this.activeObservations_=[],this.observations_=new Z,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=t,this.callbackCtx_=h}return a.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(i instanceof u(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(i)||(t.set(i,new E(i)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(i instanceof u(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(i)&&(t.delete(i),t.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&i.activeObservations_.push(t)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,t=this.activeObservations_.map(function(h){return new f(h.target,h.broadcastRect())});this.callback_.call(i,t,i),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),L=typeof WeakMap!="undefined"?new WeakMap:new Z,A=function(){function a(i){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=I.getInstance(),h=new S(i,t,this);L.set(this,h)}return a}();["observe","unobserve","disconnect"].forEach(function(a){A.prototype[a]=function(){var i;return(i=L.get(this))[a].apply(i,arguments)}});var D=function(){return typeof Q.ResizeObserver!="undefined"?Q.ResizeObserver:A}();Fe.Z=D},11742:function(Et){Et.exports=function(){var Fe=document.getSelection();if(!Fe.rangeCount)return function(){};for(var j=document.activeElement,Z=[],ae=0;ae<Fe.rangeCount;ae++)Z.push(Fe.getRangeAt(ae));switch(j.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":j.blur();break;default:j=null;break}return Fe.removeAllRanges(),function(){Fe.type==="Caret"&&Fe.removeAllRanges(),Fe.rangeCount||Z.forEach(function(Q){Fe.addRange(Q)}),j&&j.focus()}}},18034:function(Et){var Fe=arguments[3],j=arguments[4],Z=arguments[5],ae=JSON.stringify;Et.exports=function(Q,K){for(var C,k=Object.keys(Z),O=0,B=k.length;O<B;O++){var e=k[O],I=Z[e].exports;if(I===Q||I&&I.default===Q){C=e;break}}if(!C){C=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var w={},O=0,B=k.length;O<B;O++){var e=k[O];w[e]=e}j[C]=["function(require,module,exports){"+Q+"(self); }",w]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[C]=C,j[u]=["function(require,module,exports){var f = require("+ae(C)+");(f.default ? f.default : f)(self);}",p];var c={};m(u);function m(n){c[n]=!0;for(var r in j[n][1]){var v=j[n][1][r];c[v]||m(v)}}var l="("+Fe+")({"+Object.keys(c).map(function(n){return ae(n)+":["+j[n][0]+","+ae(j[n][1])+"]"}).join(",")+"},{},["+ae(u)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,_=new Blob([l],{type:"text/javascript"});if(K&&K.bare)return _;var o=g.createObjectURL(_),s=new Worker(o);return s.objectURL=o,s}},4977:function(Et){"use strict";Et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="}}]);